Playbooks

T1021, T1570, T1047

Lateral Movement Response

A step-by-step playbook for detecting and responding to lateral movement via RDP, WMI, PsExec, SMB, and SSH — including detection Event IDs, containment strategies, and forensic collection.

View on Graph

What This Playbook Covers

  • This playbook handles confirmed lateral movement — when you have evidence that an attacker has moved from one host to another using remote administration tools. It does not cover the initial compromise or the final impact phase.
  • Lateral movement is the most critical phase to interrupt. Before lateral movement, the breach is limited to a single host. After lateral movement, the attacker controls credentials, can reach sensitive servers, and may establish persistence.
  • MITRE ATT&CK references: T1021 (Remote Services — RDP, SMB, SSH), T1570 (Lateral Tool Transfer), T1047 (Windows Management Instrumentation), T1059 (Command and Scripting Interpreter).
  • Parallel playbooks: Privilege Escalation Investigation (often precedes lateral movement), Suspicious Authentication (credential abuse), Initial Access Response (find how the attacker got in).

Phase 1: Identify the Lateral Movement Method (0-15 minutes)

Each lateral movement technique produces a distinct detection signature. Identify the method first to determine the best containment strategy.

RDP Lateral Movement (T1021.001)

Detection SignalLog SourceEvent ID / Indicator
RDP connection inboundWindows Security LogEvent ID 4624 — LogonType = 10 (RemoteInteractive)
RDP connection from unusual hostWindows Security LogEvent ID 4624 — LogonType = 10 + source IP not on RDP allowlist
RDP session disconnect/reconnectTerminalServices-LocalSessionManagerEvent ID 21 (shell start), 24 (disconnect), 25 (reconnect)
Multiple RDP connections from same sourceCorrelation across hosts (use Splunk for correlation)Same source IP connecting to multiple hosts via RDP

SPL query — RDP lateral movement detection:

index=windows sourcetype="WinEventLog:Security" EventCode=4624 LogonType=10
| stats count by SourceIp, Computer, Account_Name, bin(_time, 1h)
| where count > 2
| eval alert = "RDP lateral movement — " . Account_Name . " from " . SourceIp . " to " . Computer . " (" . count . " connections in 1h)"
| table _time, SourceIp, Computer, Account_Name, count, alert
| sort - count

WMI Lateral Movement (T1047)

Detection SignalLog SourceEvent ID / Indicator
WMI process creationWindows Security Log — Event ID 4688Parent process is WmiPrvSE.exe — child process is unexpected (cmd, powershell, wscript)
WMI connectionMicrosoft-Windows-WMI-Activity/OperationalEvent ID 5857 — WMI activity from non-standard namespace
WMI network connectionSysmon Event ID 3wmiprvse.exe making outbound network connections
Remote WMI queryWindows Defender / EDRAPI calls: IWbemServices::ExecQuery from remote host

SPL query — WMI lateral movement detection:

index=windows sourcetype="WinEventLog:Security" EventCode=4688
| search ParentProcessName="*WmiPrvSE.exe"
| where NewProcessName NOT IN ("C:\\Windows\\System32\\wbem\\WmiPrvSE.exe", "C:\\Windows\\System32\\svchost.exe")
| eval alert = "WMI process creation — " . NewProcessName . " spawned by WmiPrvSE.exe on " . Computer
| table _time, Computer, NewProcessName, CommandLine, alert

PsExec Lateral Movement (T1570, T1021.002)

Detection SignalLog SourceEvent ID / Indicator
PsExec service creationSystem Event LogEvent ID 7045 — PSEXESVC.exe service installed
PsExec named pipeSysmon Event ID 17/18Named pipe creation: \\.\pipe\psexec-* or \\.\pipe\psexecsvc
SMB ADMIN$ file copyWindows Security LogEvent ID 5140 — network share access to ADMIN$ or C$
PsExec process from ADMIN$Windows Security Log — Event ID 4688Process executing from C:\Windows\ADMIN$\*.exe
PsExec SMB connectionSysmon Event ID 3 (analyze with Wireshark)SMB (port 445) connection from remote host

SPL query — PsExec detection:

index=windows sourcetype="WinEventLog:System" EventCode=7045
| search ServiceName="PSEXESVC" OR ServiceName="psexec"
| eval alert = "CRITICAL — PsExec service installed on " . Computer
| table _time, Computer, ServiceName, ImagePath, alert

SMB Lateral Movement / Pass-the-Hash (T1021.002, T1550.002)

Detection SignalLog SourceEvent ID / Indicator
NTLM authentication (pass-the-hash)Windows Security LogEvent ID 4776 — NTLM authentication with NTLM hash (not password)
SMB share access from unusual userWindows Security LogEvent ID 5140 — network share accessed by non-administrative user
SMB file copySysmon Event ID 11File creation on remote shares (\\*\C$, \\*\ADMIN$)
Multiple SMB logons from same sourceWindows Security LogEvent ID 4624 — LogonType = 3 (Network) from same source to multiple destinations

SSH Lateral Movement (Linux)

Detection SignalLog SourceIndicator
SSH login from unusual source/var/log/auth.log or /var/log/secureAccepted publickey or Accepted password from non-standard IP
SSH key-based persistence.ssh/authorized_keysUnexpected SSH keys added to user’s authorized_keys
SSH outbound to internal rangesFirewall logsOutbound SSH (port 22) to internal servers

Phase 2: Containment (15-30 minutes)

Immediate Actions — Regardless of Movement Type

  • Isolate the compromised host — disable network on the origin host (not just the destination)
  • Block the lateral movement path — create firewall rules between subnets if segmentation is weak
  • Disable the compromised user account — the attacker is using stolen credentials
  • Revoke Kerberos tickets for the compromised user — klist purge or Invoke-KerberosTicketPurge

Technique-Specific Containment

Movement TypeSpecific Containment
RDPTemporarily disable RDP on affected hosts, restrict RDP source IPs at firewall
WMIBlock WMI (DCOM port 135, RPC dynamic ports 49152-65535) at firewall
PsExecRemove ADMIN$ share temporarily, block SMB port 445 between segments
SMB Pass-the-HashForce Kerberos authentication — disable NTLM via GPO (Network security: Restrict NTLM)
SSHRotate SSH keys, disable password authentication, restrict SSH to bastion hosts

Phase 3: Trace the Movement Path (30-60 minutes)

Step 1 — Build the Lateral Movement Chain

Identify every host the attacker touched:

Initial Compromise: HOST_A (10.0.1.5)
    ↓ RDP (LogonType 10) via user jdoe
HOST_B (10.0.2.10)
    ↓ WMI (WmiPrvSE.exe → powershell.exe)
HOST_C (10.0.2.20)
    ↓ PsExec (Service: PSEXESVC)
HOST_D — Domain Controller (10.0.100.5)

Step 2 — Collect Evidence Per Host

EvidenceCollection MethodWhat It Reveals
Security Event Logwevtutil epl Security collected.evtxAuth events, logon types, failed logins
Sysmon logsPath: C:\Windows\System32\winevt\Logs\Microsoft-Windows-Sysmon%4Operational.evtxProcess creation, network, file, named pipes
Prefetch filesC:\Windows\Prefetch\*.pfExecuted tools (mimikatz, psexec, powershell)
Recent filesC:\Users\*\Recent\*Files opened by attacker
Network connectionsNetStat / Sysmon Event ID 3Outbound connections to C2, lateral movement targets
Command historyPowerShell Get-History, $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txtCommands executed by attacker

Phase 4: Detection Query Reference

Find All Lateral Movement in a Time Window

SPL — comprehensive lateral movement detection:

index=windows (sourcetype="WinEventLog:Security" OR sourcetype="WinEventLog:Sysmon" OR sourcetype="WinEventLog:System")
| eval movement_type = 
    if(EventCode=4624 AND LogonType=10, "RDP") .
    if(EventCode=4624 AND LogonType=3 AND SourceIp!="", "SMB/Network") .
    if(EventCode=4688 AND ParentProcessName="*WmiPrvSE*", "WMI") .
    if(EventCode=7045 AND ServiceName="PSEXESVC", "PsExec") .
    if(EventCode=5140 AND ShareName="ADMIN$", "ADMIN$ Share")
| where movement_type != ""
| eval alert = "LATERAL MOVEMENT: " . movement_type . " — " . " from " . coalesce(SourceIp, "local") . " on " . Computer
| table _time, Computer, SourceIp, Account_Name, movement_type, alert
| sort - _time

Network-Based Detection — Multiple Logons from Same Source

index=windows sourcetype="WinEventLog:Security" EventCode=4624
| stats dc(Computer) as unique_hosts, values(Computer) as hosts_accessed by SourceIp, Account_Name, bin(_time, 1h)
| where unique_hosts > 3
| eval alert = Account_Name . " accessed " . unique_hosts . " hosts from " . SourceIp . " in 1 hour — lateral movement pattern"
| table _time, SourceIp, Account_Name, unique_hosts, hosts_accessed, alert
| sort - unique_hosts

Phase 5: Recovery and Hardening

ControlWhat It PreventsDeployment Effort
Enable Credential GuardPass-the-hash, Kerberos ticket theftGPO — Windows 10/11 Enterprise
Disable NTLM (Kerberos only)Pass-the-hash, NTLM relayGPO — test for compatibility first
Network segmentationLimits blast radius of lateral movementInfrastructure change — medium effort
Just Enough Administration (JEA)Restrict WMI/RDP/PsExec to specific admin hostsPowerShell Desired State Configuration
Local admin password rotation (LAPS)Prevents pass-the-hash reuse of local admin passwordsGPO + LAPS client
Session recordingRecords RDP/SSH sessions for forensic reviewThird-party tool (CyberArk, BeyondTrust)

Sources