1---2name: detecting-lateral-movement-with-splunk3description: Detect adversary lateral movement across networks using Splunk SPL queries against Windows authentication logs, SMB traffic, and remote service abuse.4license: Apache-2.05---67# Detecting Lateral Movement with Splunk89## When to Use1011- When hunting for adversary movement between compromised systems12- After detecting credential theft to trace subsequent lateral activity13- When investigating unusual authentication patterns across the network14- During incident response to scope the breadth of compromise15- When proactively hunting for TA0008 (Lateral Movement) techniques1617## Detection Gaps & Validation1819- **Coverage is the biggest gap.** 4624 Type 3/10 analysis only works if WEF collects from *all* endpoints, not just DCs. Most missed lateral movement is on member servers and workstations whose Security logs were never forwarded — verify ingestion per host class with `| tstats count by host`.20- **Pass-the-Hash uses cached creds, not 4648.** Over-relying on 4648 (explicit credential logon) misses PtH, which appears as 4624 Type 3 with `AuthenticationPackageName=NTLM` and `LogonProcessName=seclogo` against systems that should use Kerberos.21- **Auth without execution context misses WMI/DCOM.** T1047 lands as a 4624 plus a `wmiprvse.exe` child (Sysmon EID 1); correlate the logon to subsequent process creation. WinRM shows `wsmprovhost.exe` (5985/5986); PsExec drops the `PSEXESVC` service (7045) and hits ADMIN$ (5145).22- **Baseline maturity:** first-time source→destination pair detection throws false-positive storms right after deployment until enough history accrues.23- **Validate the rule fires:** run `PsExec \\host cmd` and `Enter-PSSession host` from a test box and confirm the 4624 Type 3 + 7045/`wsmprovhost.exe` queries return your activity.24- **Tune false positives:** vulnerability scanners, SCCM, and admin jump hosts authenticate broadly by design. Allowlist their source IPs and service accounts before alerting on fan-out.2526## Prerequisites2728- Splunk Enterprise or Splunk Cloud with Windows event data ingested29- Windows Security Event Logs forwarded (4624, 4625, 4648, 4672, 4768, 4769)30- Sysmon deployed for process creation and network connection data31- Network flow data or firewall logs for SMB/RDP/WinRM correlation32- Active Directory user and group membership reference data3334## Workflow35361. **Define Lateral Movement Scope**: Identify which lateral movement techniques to hunt (RDP, SMB/Admin Shares, WinRM, PsExec, WMI, DCOM, SSH).372. **Query Authentication Events**: Use SPL to search for Type 3 (Network) and Type 10 (RemoteInteractive) logons across the environment.383. **Build Authentication Graphs**: Map source-to-destination authentication relationships to identify unusual connection patterns.394. **Detect First-Time Relationships**: Identify new source-destination pairs that have not been seen in the historical baseline.405. **Correlate with Process Activity**: Link authentication events to subsequent process creation on destination hosts.416. **Identify Anomalous Patterns**: Flag lateral movement to sensitive servers, unusual hours, service account misuse, or rapid multi-host access.427. **Report and Contain**: Document lateral movement path, affected systems, and coordinate containment response.4344## Key Concepts4546| Concept | Description |47|---------|-------------|48| T1021 | Remote Services (parent technique) |49| T1021.001 | Remote Desktop Protocol (RDP) |50| T1021.002 | SMB/Windows Admin Shares |51| T1021.003 | Distributed COM (DCOM) |52| T1021.004 | SSH |53| T1021.006 | Windows Remote Management (WinRM) |54| T1570 | Lateral Tool Transfer |55| T1047 | Windows Management Instrumentation |56| T1569.002 | Service Execution (PsExec) |57| Logon Type 3 | Network logon (SMB, WinRM, mapped drives) |58| Logon Type 10 | Remote Interactive (RDP) |59| Event ID 4624 | Successful logon |60| Event ID 4648 | Explicit credential logon (runas, PsExec) |6162## Tools & Systems6364| Tool | Purpose |65|------|---------|66| Splunk Enterprise | SIEM for log aggregation and SPL queries |67| Splunk Enterprise Security | Threat detection and notable events |68| Windows Event Forwarding | Centralize Windows logs |69| Sysmon | Detailed process and network telemetry |70| BloodHound | AD attack path analysis |71| PingCastle | AD security assessment |7273## Common Scenarios74751. **PsExec Lateral Movement**: Adversary uses PsExec to execute commands on remote systems via SMB, generating Type 3 logon with ADMIN$ share access.762. **RDP Pivoting**: Attacker RDPs to internal systems using stolen credentials, creating Type 10 logon events.773. **WMI Remote Execution**: Adversary uses WMIC process call create to spawn processes on remote hosts.784. **WinRM PowerShell Remoting**: Attacker uses Enter-PSSession or Invoke-Command to execute code on remote systems.795. **Pass-the-Hash via SMB**: Compromised NTLM hashes used to authenticate to remote systems without knowing the plaintext password.8081## Output Format8283```84Hunt ID: TH-LATMOV-[DATE]-[SEQ]85Movement Type: [RDP/SMB/WinRM/WMI/DCOM/PsExec]86Source Host: [Hostname/IP]87Destination Host: [Hostname/IP]88Account Used: [Username]89Logon Type: [3/10/other]90First Seen: [Timestamp]91Event Count: [Number of events]92Risk Level: [Critical/High/Medium/Low]93Lateral Movement Path: [A -> B -> C -> D]94```