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.4domain: cybersecurity5subdomain: threat-hunting6tags: [threat-hunting, mitre-attack, lateral-movement, splunk, siem, proactive-detection, ta0008]7version: "1.0"8author: mahipal9license: MIT10metadata:11 source: https://skillmd.com/skills/njones17/detecting-lateral-movement-with-splunk12---1314# Detecting Lateral Movement with Splunk1516## When to Use1718- When hunting for adversary movement between compromised systems19- After detecting credential theft to trace subsequent lateral activity20- When investigating unusual authentication patterns across the network21- During incident response to scope the breadth of compromise22- When proactively hunting for TA0008 (Lateral Movement) techniques2324## Prerequisites2526- Splunk Enterprise or Splunk Cloud with Windows event data ingested27- Windows Security Event Logs forwarded (4624, 4625, 4648, 4672, 4768, 4769)28- Sysmon deployed for process creation and network connection data29- Network flow data or firewall logs for SMB/RDP/WinRM correlation30- Active Directory user and group membership reference data3132## Workflow33341. **Define Lateral Movement Scope**: Identify which lateral movement techniques to hunt (RDP, SMB/Admin Shares, WinRM, PsExec, WMI, DCOM, SSH).352. **Query Authentication Events**: Use SPL to search for Type 3 (Network) and Type 10 (RemoteInteractive) logons across the environment.363. **Build Authentication Graphs**: Map source-to-destination authentication relationships to identify unusual connection patterns.374. **Detect First-Time Relationships**: Identify new source-destination pairs that have not been seen in the historical baseline.385. **Correlate with Process Activity**: Link authentication events to subsequent process creation on destination hosts.396. **Identify Anomalous Patterns**: Flag lateral movement to sensitive servers, unusual hours, service account misuse, or rapid multi-host access.407. **Report and Contain**: Document lateral movement path, affected systems, and coordinate containment response.4142## Key Concepts4344| Concept | Description |45|---------|-------------|46| T1021 | Remote Services (parent technique) |47| T1021.001 | Remote Desktop Protocol (RDP) |48| T1021.002 | SMB/Windows Admin Shares |49| T1021.003 | Distributed COM (DCOM) |50| T1021.004 | SSH |51| T1021.006 | Windows Remote Management (WinRM) |52| T1570 | Lateral Tool Transfer |53| T1047 | Windows Management Instrumentation |54| T1569.002 | Service Execution (PsExec) |55| Logon Type 3 | Network logon (SMB, WinRM, mapped drives) |56| Logon Type 10 | Remote Interactive (RDP) |57| Event ID 4624 | Successful logon |58| Event ID 4648 | Explicit credential logon (runas, PsExec) |5960## Tools & Systems6162| Tool | Purpose |63|------|---------|64| Splunk Enterprise | SIEM for log aggregation and SPL queries |65| Splunk Enterprise Security | Threat detection and notable events |66| Windows Event Forwarding | Centralize Windows logs |67| Sysmon | Detailed process and network telemetry |68| BloodHound | AD attack path analysis |69| PingCastle | AD security assessment |7071## Common Scenarios72731. **PsExec Lateral Movement**: Adversary uses PsExec to execute commands on remote systems via SMB, generating Type 3 logon with ADMIN$ share access.742. **RDP Pivoting**: Attacker RDPs to internal systems using stolen credentials, creating Type 10 logon events.753. **WMI Remote Execution**: Adversary uses WMIC process call create to spawn processes on remote hosts.764. **WinRM PowerShell Remoting**: Attacker uses Enter-PSSession or Invoke-Command to execute code on remote systems.775. **Pass-the-Hash via SMB**: Compromised NTLM hashes used to authenticate to remote systems without knowing the plaintext password.7879## Output Format8081```82Hunt ID: TH-LATMOV-[DATE]-[SEQ]83Movement Type: [RDP/SMB/WinRM/WMI/DCOM/PsExec]84Source Host: [Hostname/IP]85Destination Host: [Hostname/IP]86Account Used: [Username]87Logon Type: [3/10/other]88First Seen: [Timestamp]89Event Count: [Number of events]90Risk Level: [Critical/High/Medium/Low]91Lateral Movement Path: [A -> B -> C -> D]92```