Skip to content

Instantly share code, notes, and snippets.

View nullbind's full-sized avatar

Scott Sutherland nullbind

View GitHub Profile
@nullbind
nullbind / Invoke-HuntEvents.ps1
Created May 1, 2019 17:30
Invoke-HuntEvents.ps1
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
@nullbind
nullbind / FindFiles.ps1
Created May 1, 2019 17:33
FindFiles.ps1
$allusersstartuP = Invoke-Command -Session (Get-PSSession) -ScriptBlock {Get-childItem "$env:ALLUSERSPROFILE\Microsoft\Windows\Start Menu\Programs\StartUp\" | select fullname}
@nullbind
nullbind / Invoke-HuntWmiSubscription.ps1
Created May 1, 2019 17:34
Invoke-HuntWmiSubscription.ps1
# Author: Alexander Leary
#--------------------------------------------------------------------------------
# Add-ObjectWMI
#--------------------------------------------------------------------------------
Function local:Add-ObjectWMI{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true, HelpMessage="Name")]
[string]$Name = "",
@nullbind
nullbind / Get-DomainComputerWSMAN.ps1
Created May 1, 2019 17:36
Get-DomainComputerWSMAN.ps1
# 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
@nullbind
nullbind / TellMeYourSecrets.ps1
Created May 2, 2019 17:19
TellMeYourSecrets.ps1
# 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()
@nullbind
nullbind / poc.png
Created May 22, 2019 20:56
MSBuild - Property functions -
<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
@nullbind
nullbind / test.ps1
Created June 5, 2019 21:08
test.ps1
This file has been truncated, but you can view the full file.
function Invoke-DCSync
{
<#
.SYNOPSIS
Uses dcsync from mimikatz to collect NTLM hashes from the domain.
Author: @monoxgas
Improved by: @harmj0y
@nullbind
nullbind / portable-adps.ps1
Created August 23, 2019 21:38
portable-adps.ps1
This file has been truncated, but you can view the full file.
# DLL bytes as a string
@nullbind
nullbind / Get-WmiNamespaceDacl.ps1
Last active August 27, 2019 15:08
Get-WmiNamespaceDacl.ps1
<# 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
@nullbind
nullbind / Get-WmiProviderInfo.ps1
Last active July 22, 2020 16:53
Get-WmiProviderInfo.ps1
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
}