This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://gist.githubusercontent.com/oscitancy/387e7d0d73af03eb8ba56139efdfac85/raw/58d9c6bac40dabe559d6d9e2c92876677243680f/Get-DHCPResponse.ps1 | |
| <# | |
| .SYNOPSIS | |
| Sends out a DHCP Discover packet to see who responds. | |
| .DESCRIPTION | |
| Creates a DHCP Discover Packet then broadcasts it on Port 67 then waits for | |
| responses sent back on Port 68. Does a basic parsing of the bytes recieved so | |
| that you can diagnose problems manually. |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # --------------------------------------------------- | |
| # Load the Active Directory PowerShell module | |
| # --------------------------------------------------- | |
| # $ADModuleBytes = [System.IO.File]::ReadAllBytes("C:\Windows\Microsoft.NET\assembly\GAC_64\Microsoft.ActiveDirectory.Management\v4.0_10.0.0.0__31bf3856ad364e35\Microsoft.ActiveDirectory.Management.dll") | |
| # $ADModuleString = [System.Convert]::ToBase64String($ADModuleBytes) | |
| # Set the string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get All User SPNs | |
| $UserSPNs = Get-ADObject -LDAPFilter "(&(objectClass=user)(ServicePrincipalName=*))" -Properties samaccountname,description,serviceprincipalname | |
| # Get All Domain Admins | |
| $DomainAdmins = Get-ADGroupMember -Recursive -Identity "Domain Admins“ | select SamAccountName –expandproperty SamAccountName | |
| # Get Domain Admins with SPNs | |
| $DomainAdmins | | |
| ForEach-Object { | |
| $DA = $_; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-LdapQuery | |
| { | |
| [CmdletBinding()] | |
| Param( | |
| [Parameter(Mandatory = $false, | |
| HelpMessage = 'Domain user to authenticate with domain\user.')] | |
| [string]$Username, | |
| [Parameter(Mandatory = $false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # source: https://mcpmag.com/articles/2017/07/27/gathering-installed-software-using-powershell.aspx | |
| Function Get-Software { | |
| [OutputType('System.Software.Inventory')] | |
| [Cmdletbinding()] | |
| Param( | |
| [Parameter(ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <!-- | |
| File: Inveigh.xml | |
| Author: Kevin Robertson | |
| Description | |
| This file can be used to execute InveighZero through MSBuild. | |
| Original Repository: https://github.com/Kevin-Robertson/InveighZero | |
| Using msbuild.exe to execute .net code through inline tasks is a technique that | |
| was developed by Casey Smith. You can explicitly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # based on: https://msrc-blog.microsoft.com/2008/12/09/ms08-075-reducing-attack-surface-by-turning-off-protocol-handlers/ | |
| # https://blogs.msdn.microsoft.com/noahc/2006/10/19/register-a-custom-url-protocol-handler/ | |
| # https://zero.lol/2019-05-22-fun-with-uri-handlers/ | |
| # https://www.vdoo.com/blog/exploiting-custom-protocol-handlers-in-windows | |
| # https://docs.microsoft.com/en-us/windows/win32/shell/app-registration | |
| # https://docs.microsoft.com/en-us/windows/win32/shell/fa-intro | |
| # HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts | |
| # jnlp:file://///server/file.txt | |
| $null = $DataTable = New-Object System.Data.DataTable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| AppDomain Hijacking Execution Method | |
| File: Inveigh-AppDomain-Hijack.cs | |
| Author: Kevin Robertson | |
| Description | |
| This file can be used to execute InveighZero through MSBuild. | |
| Original Repository: https://github.com/Kevin-Robertson/InveighZero | |
| Note: The reflection technique used to load the inveighzero.exe from a string was based on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function New-InMemoryModule | |
| { | |
| Param | |
| ( | |
| [Parameter(Position = 0)] | |
| [ValidateNotNullOrEmpty()] | |
| [String] | |
| $ModuleName = [Guid]::NewGuid().ToString() | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <?xml-stylesheet type="text/xsl" href="https://gist.githubusercontent.com/bohops/ee9e2d7bdd606c264a0c6599b0146599/raw/6456162763d2bb427e71e41f84792867cb1b4c0f/xsl-notepad.xsl" ?> | |
| <customers> | |
| <customer> | |
| <name>Microsoft</name> | |
| </customer> | |
| </customers> |