Threat HuntingSeptember 20, 2024• 10 min read
Threat Hunting for Lateral Movement in Windows Environments
Techniques for proactively hunting lateral movement activity using Windows Event Logs, focusing on PsExec, WMI, and RDP-based techniques.
Lateral MovementWindowsPsExecWMIThreat Hunting
Overview
Lateral movement is a critical phase in most attack chains. Once an attacker gains initial access, they need to move through the network to reach valuable targets. This write-up covers hunting techniques for common lateral movement methods.
Key Data Sources
Hunting Queries
PsExec Detection
PsExec creates a named pipe and service for remote execution:
event.code: 1 AND
process.name: "PSEXESVC.exe" OR
(process.name: "services.exe" AND process.command_line: *PSEXESVC*)WMI Remote Execution
event.code: 1 AND
process.parent.name: "WmiPrvSE.exe" AND
NOT process.name: ("WmiPrvSE.exe", "WmiApSrv.exe")Suspicious RDP Activity
event.code: 4624 AND
winlog.event_data.LogonType: 10 AND
source.ip: (10.0.0.0/8 OR 172.16.0.0/12 OR 192.168.0.0/16)