[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M755KB13V1AV06HAXVAB0HBW":3,"skill-same:01M755KB13V1AV06HAXVAB0HBW":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":40,"commitSha":41,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":6,"updatedAt":45,"install":46,"resources":59},"01M755KB13V1AV06HAXVAB0HBW","performing-lateral-movement-detection",null,"Detects lateral movement techniques including Pass-the-Hash, PsExec, WMI execution, RDP pivoting, and SMB-based spreading using SIEM correlation of Windows event logs, network flow data, and endpoint telemetry mapped to MITRE ATT&CK Lateral Movement (TA0008) techniques.","SamuelChien\u002Fmega-skills-collection","SamuelChien","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F4652114?v=4","01M74KK34WVHA0P5ZYSJRDDFMG","Samuel Chien","01M74KK35FQN1N9VZ9EPTH3P2S",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fperforming-lateral-movement-detection\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fperforming-lateral-movement-detection\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: performing-lateral-movement-detection\ndescription: >\n  Detects lateral movement techniques including Pass-the-Hash, PsExec, WMI execution, RDP pivoting,\n  and SMB-based spreading using SIEM correlation of Windows event logs, network flow data, and\n  endpoint telemetry mapped to MITRE ATT&CK Lateral Movement (TA0008) techniques.\ndomain: cybersecurity\nsubdomain: soc-operations\ntags: [soc, lateral-movement, mitre-attack, pass-the-hash, psexec, wmi, rdp, smb, detection]\nversion: \"1.0\"\nauthor: mahipal\nlicense: Apache-2.0\n---\n# Performing Lateral Movement Detection\n\n## When to Use\n\nUse this skill when:\n- SOC teams need to detect attackers pivoting between systems after initial compromise\n- Incident investigations require tracking an attacker's movement path through the network\n- Detection engineering needs lateral movement rules mapped to ATT&CK TA0008 techniques\n- Red\u002Fpurple team exercises identify lateral movement detection gaps\n\n**Do not use** for detecting initial access or external attacks — lateral movement detection focuses on internal host-to-host pivot activity.\n\n## Prerequisites\n\n- Windows Security Event Logs (EventCode 4624, 4625, 4648, 4672) from all endpoints and servers\n- Sysmon deployed with process creation (EventCode 1), network connections (EventCode 3), and named pipe (EventCode 17\u002F18)\n- Network flow data (NetFlow\u002FsFlow, Zeek connection logs) for internal traffic analysis\n- SIEM with cross-source correlation capability\n- Baseline of normal internal authentication patterns\n\n## Workflow\n\n### Step 1: Detect Pass-the-Hash \u002F Pass-the-Ticket (T1550)\n\n**Pass-the-Hash Detection (EventCode 4624 with NTLM):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=4624 Logon_Type=3\nAuthenticationPackageName=\"NTLM\"\n| where TargetUserName!=\"ANONYMOUS LOGON\" AND TargetUserName!=\"$\"\n| stats count, dc(ComputerName) AS unique_targets, values(ComputerName) AS targets\n  by src_ip, TargetUserName\n| where unique_targets > 3\n| eval alert = \"Possible Pass-the-Hash: NTLM network logon to \".unique_targets.\" hosts\"\n| sort - unique_targets\n| table src_ip, TargetUserName, unique_targets, count, targets, alert\n```\n\n**Overpass-the-Hash Detection (Kerberos with RC4):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=4769\nTicketEncryptionType=\"0x17\"\n| where ServiceName!=\"krbtgt\" AND ServiceName!=\"$\"\n| stats count, dc(ServiceName) AS unique_services by src_ip, TargetUserName\n| where count > 5\n| eval alert = \"Possible Overpass-the-Hash: RC4 Kerberos tickets from \".src_ip\n| table _time, src_ip, TargetUserName, unique_services, count, alert\n```\n\n**Golden\u002FSilver Ticket Detection (T1558):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=4769\n| where TicketOptions=\"0x40810000\" OR TicketOptions=\"0x40800000\"\n| eval ticket_lifetime = TicketExpireTime - TicketIssueTime\n| where ticket_lifetime > 36000  --- >10 hours (abnormal)\n| stats count by src_ip, TargetUserName, ServiceName, TicketEncryptionType, TicketOptions\n| eval alert = \"Possible Golden\u002FSilver Ticket: Abnormal ticket properties\"\n```\n\n### Step 2: Detect Remote Service Exploitation (T1021)\n\n**PsExec Detection (T1021.002):**\n```spl\n--- Via Sysmon process creation\nindex=sysmon EventCode=1\n(Image=\"*\\\\psexec.exe\" OR Image=\"*\\\\psexesvc.exe\"\n OR OriginalFileName=\"psexec.c\" OR OriginalFileName=\"psexesvc.exe\"\n OR ParentImage=\"*\\\\psexesvc.exe\")\n| table _time, Computer, User, ParentImage, Image, CommandLine, Hashes\n\n--- Via named pipe creation (Sysmon EventCode 17)\nindex=sysmon EventCode=17\nPipeName IN (\"\\\\PSEXESVC*\", \"\\\\RemCom*\", \"\\\\csexec*\")\n| table _time, Computer, User, Image, PipeName\n\n--- Via Windows service creation (EventCode 7045)\nindex=wineventlog sourcetype=\"WinEventLog:System\" EventCode=7045\nServiceName=\"PSEXESVC\" OR ServiceFileName=\"*PSEXESVC*\"\n| table _time, Computer, ServiceName, ServiceFileName, AccountName\n```\n\n**WMI Remote Execution (T1047):**\n```spl\nindex=sysmon EventCode=1\n(Image=\"*\\\\wmic.exe\" AND CommandLine=\"*\u002Fnode:*\")\nOR (ParentImage=\"*\\\\WmiPrvSE.exe\" AND Image IN (\"*\\\\cmd.exe\", \"*\\\\powershell.exe\"))\n| eval execution_type = case(\n    match(Image, \"wmic\"), \"WMI Command Line\",\n    match(ParentImage, \"WmiPrvSE\"), \"WMI Provider Host (remote execution)\"\n  )\n| table _time, Computer, User, execution_type, ParentImage, Image, CommandLine\n```\n\n**WinRM\u002FPowerShell Remoting (T1021.006):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=4624\nLogon_Type=3 AuthenticationPackageName=\"Kerberos\"\n| where ProcessName=\"*\\\\wsmprovhost.exe\" OR ProcessName=\"*\\\\powershell.exe\"\n| stats count, dc(ComputerName) AS unique_targets by src_ip, TargetUserName\n| where unique_targets > 2\n| eval alert = \"PowerShell Remoting to \".unique_targets.\" hosts from \".src_ip\n\n--- Sysmon variant\nindex=sysmon EventCode=1\nParentImage=\"*\\\\wsmprovhost.exe\"\nImage IN (\"*\\\\cmd.exe\", \"*\\\\powershell.exe\", \"*\\\\csc.exe\")\n| table _time, Computer, User, Image, CommandLine\n```\n\n**RDP Lateral Movement (T1021.001):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=4624 Logon_Type=10\n| stats count, dc(ComputerName) AS rdp_targets, values(ComputerName) AS destinations,\n        earliest(_time) AS first_rdp, latest(_time) AS last_rdp\n  by src_ip, TargetUserName\n| where rdp_targets > 2\n| eval duration_hours = round((last_rdp - first_rdp) \u002F 3600, 1)\n| eval alert = TargetUserName.\" RDP'd to \".rdp_targets.\" hosts in \".duration_hours.\" hours\"\n| sort - rdp_targets\n```\n\n### Step 3: Detect SMB-Based Lateral Movement\n\n**Anomalous SMB Traffic Patterns:**\n```spl\nindex=firewall OR index=zeek sourcetype IN (\"pan:traffic\", \"bro:conn:json\")\ndest_port=445 action=allowed\n| where src_ip!=dest_ip\n| stats count AS smb_sessions, dc(dest_ip) AS unique_targets,\n        sum(bytes_out) AS total_bytes\n  by src_ip\n| where unique_targets > 10\n| eval alert = case(\n    unique_targets > 50, \"CRITICAL: Mass SMB enumeration from \".src_ip,\n    unique_targets > 20, \"HIGH: Significant SMB lateral movement\",\n    unique_targets > 10, \"MEDIUM: Elevated SMB connections\"\n  )\n| sort - unique_targets\n```\n\n**Admin Share Access (C$, ADMIN$):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=5140\nShareName IN (\"\\\\\\\\*\\\\C$\", \"\\\\\\\\*\\\\ADMIN$\", \"\\\\\\\\*\\\\IPC$\")\n| where SubjectUserName!=\"SYSTEM\" AND SubjectUserName!=\"$\"\n| stats count, dc(ComputerName) AS unique_hosts by SubjectUserName, ShareName, src_ip\n| where unique_hosts > 3\n| eval alert = \"Admin share access to \".unique_hosts.\" hosts by \".SubjectUserName\n| sort - unique_hosts\n```\n\n### Step 4: Build Lateral Movement Graph\n\nVisualize the attack path:\n\n```spl\n--- Build source->destination graph for authentication events\nindex=wineventlog EventCode=4624 Logon_Type IN (3, 10)\nearliest=-24h\n| stats count AS connections, latest(_time) AS last_connection\n  by src_ip, ComputerName, TargetUserName, Logon_Type\n| eval edge = src_ip.\" -> \".ComputerName.\" (User: \".TargetUserName.\", Type: \".Logon_Type.\")\"\n| sort - connections\n| table edge, connections, last_connection\n\n--- Network flow correlation\nindex=netflow earliest=-24h\ndest_port IN (445, 135, 3389, 5985, 5986)\n| stats sum(bytes) AS total_bytes, count AS flow_count,\n        dc(dest_ip) AS targets by src_ip, dest_port\n| where targets > 5\n| eval service = case(\n    dest_port=445, \"SMB\",\n    dest_port=135, \"RPC\u002FWMI\",\n    dest_port=3389, \"RDP\",\n    dest_port IN (5985, 5986), \"WinRM\"\n  )\n| sort - targets\n| table src_ip, service, targets, flow_count, total_bytes\n```\n\n### Step 5: Detect DCOM and Scheduled Task-Based Movement\n\n**DCOM Lateral Execution (T1021.003):**\n```spl\nindex=sysmon EventCode=1\nParentImage IN (\"*\\\\mmc.exe\", \"*\\\\excel.exe\", \"*\\\\outlook.exe\")\nImage IN (\"*\\\\cmd.exe\", \"*\\\\powershell.exe\", \"*\\\\mshta.exe\")\n| where ParentCommandLine=\"*-Embedding*\"\n| eval alert = \"DCOM-based lateral movement: \".ParentImage.\" spawned \".Image\n| table _time, Computer, User, ParentImage, Image, CommandLine, alert\n```\n\n**Remote Scheduled Task Creation (T1053.005):**\n```spl\nindex=wineventlog EventCode=4698\n| where SubjectUserName!=\"SYSTEM\"\n| eval task_xml = TaskContent\n| search task_xml=\"*http*\" OR task_xml=\"*powershell*\" OR task_xml=\"*cmd*\" OR task_xml=\"*\\\\Temp\\\\*\"\n| table _time, Computer, SubjectUserName, TaskName, task_xml\n```\n\n### Step 6: Correlate Movement with Kill Chain Phases\n\nBuild end-to-end attack chain detection:\n\n```spl\n--- Detect complete lateral movement sequence\nindex=wineventlog OR index=sysmon\n(EventCode=4625 OR EventCode=4624 OR EventCode=1 OR EventCode=4698 OR EventCode=5140)\n| eval phase = case(\n    EventCode=4625, \"1-Recon\u002FBruteForce\",\n    EventCode=4624 AND Logon_Type=3, \"2-Lateral Movement\",\n    EventCode=5140 AND match(ShareName, \"C\\$|ADMIN\\$\"), \"3-Admin Share Access\",\n    EventCode=1 AND match(ParentImage, \"psexesvc|WmiPrvSE|wsmprovhost\"), \"4-Remote Execution\",\n    EventCode=4698, \"5-Persistence (Scheduled Task)\",\n    1=1, \"other\"\n  )\n| where phase!=\"other\"\n| stats count by phase, src_ip, ComputerName, TargetUserName\n| sort phase, _time\n| table phase, src_ip, ComputerName, TargetUserName, count\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|-----------|\n| **Lateral Movement** | Post-compromise technique where attackers pivot between systems to reach targets |\n| **Pass-the-Hash** | Using stolen NTLM hash for authentication without knowing the plaintext password |\n| **Pass-the-Ticket** | Using stolen Kerberos TGT\u002FTGS tickets for authentication across the domain |\n| **PsExec** | Sysinternals tool (and attack technique) for remote process execution via SMB and named pipes |\n| **WMI Execution** | Using Windows Management Instrumentation for remote command execution via DCOM or WinRM |\n| **Admin Share** | Default Windows administrative shares (C$, ADMIN$, IPC$) used for remote system management |\n\n## Tools & Systems\n\n- **Splunk Enterprise Security**: SIEM platform for correlating Windows events, Sysmon, and network flows\n- **Microsoft Defender for Identity**: Cloud service detecting lateral movement via domain controller monitoring\n- **BloodHound**: Active Directory attack path analysis tool for identifying lateral movement opportunities\n- **CrowdStrike Falcon**: EDR platform with lateral movement detection and automated containment\n- **Zeek (Bro)**: Network monitor generating connection logs for SMB, RDP, and WinRM traffic analysis\n\n## Common Scenarios\n\n- **PsExec Spread**: Attacker uses PsExec to execute malware across 20 workstations — detect via service creation events\n- **RDP Pivoting**: Compromised VPN account used to RDP through multiple internal hosts — detect via Logon_Type 10 chains\n- **WMI Recon and Execution**: Attacker uses WMI for discovery then execution — detect via WmiPrvSE child processes\n- **Pass-the-Hash Campaign**: Stolen local admin hash used across subnet — detect via NTLM Logon_Type 3 to multiple hosts\n- **Scheduled Task Persistence**: Remote scheduled task created on domain controller — detect via EventCode 4698 from non-admin source\n\n## Output Format\n\n```\nLATERAL MOVEMENT DETECTION REPORT\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nPeriod:       2024-03-15 14:00 to 18:00 UTC\nSource:       192.168.1.105 (WORKSTATION-042)\n\nMovement Path:\n  14:23  192.168.1.105 → 10.0.5.20  (DC-PRIMARY) — PtH via NTLM Type 3\n  14:25  10.0.5.20 → 10.0.5.21     (DC-BACKUP)  — Kerberos ticket reuse\n  14:28  10.0.5.20 → 10.0.10.15    (FILESERVER-01) — PsExec service creation\n  14:32  10.0.10.15 → 10.0.10.20   (DB-PRIMARY) — WMI remote execution\n  14:35  10.0.10.20 → 10.0.10.25   (DB-BACKUP)  — SMB admin share access\n\nTechniques Detected:\n  T1550.002 — Pass-the-Hash (NTLM authentication to DC)\n  T1021.002 — PsExec (remote service installation)\n  T1047     — WMI Execution (WmiPrvSE child process)\n  T1021.002 — SMB Admin Share (C$ access on DB-BACKUP)\n\nAffected Systems: 5 hosts across 2 network segments\nUser Account:     admin_compromised (Domain Admin)\nContainment:      All 5 hosts isolated at 14:45 UTC\n```\n","# Performing Lateral Movement Detection\n\n## When to Use\n\nUse this skill when:\n- SOC teams need to detect attackers pivoting between systems after initial compromise\n- Incident investigations require tracking an attacker's movement path through the network\n- Detection engineering needs lateral movement rules mapped to ATT&CK TA0008 techniques\n- Red\u002Fpurple team exercises identify lateral movement detection gaps\n\n**Do not use** for detecting initial access or external attacks — lateral movement detection focuses on internal host-to-host pivot activity.\n\n## Prerequisites\n\n- Windows Security Event Logs (EventCode 4624, 4625, 4648, 4672) from all endpoints and servers\n- Sysmon deployed with process creation (EventCode 1), network connections (EventCode 3), and named pipe (EventCode 17\u002F18)\n- Network flow data (NetFlow\u002FsFlow, Zeek connection logs) for internal traffic analysis\n- SIEM with cross-source correlation capability\n- Baseline of normal internal authentication patterns\n\n## Workflow\n\n### Step 1: Detect Pass-the-Hash \u002F Pass-the-Ticket (T1550)\n\n**Pass-the-Hash Detection (EventCode 4624 with NTLM):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=4624 Logon_Type=3\nAuthenticationPackageName=\"NTLM\"\n| where TargetUserName!=\"ANONYMOUS LOGON\" AND TargetUserName!=\"$\"\n| stats count, dc(ComputerName) AS unique_targets, values(ComputerName) AS targets\n  by src_ip, TargetUserName\n| where unique_targets > 3\n| eval alert = \"Possible Pass-the-Hash: NTLM network logon to \".unique_targets.\" hosts\"\n| sort - unique_targets\n| table src_ip, TargetUserName, unique_targets, count, targets, alert\n```\n\n**Overpass-the-Hash Detection (Kerberos with RC4):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=4769\nTicketEncryptionType=\"0x17\"\n| where ServiceName!=\"krbtgt\" AND ServiceName!=\"$\"\n| stats count, dc(ServiceName) AS unique_services by src_ip, TargetUserName\n| where count > 5\n| eval alert = \"Possible Overpass-the-Hash: RC4 Kerberos tickets from \".src_ip\n| table _time, src_ip, TargetUserName, unique_services, count, alert\n```\n\n**Golden\u002FSilver Ticket Detection (T1558):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=4769\n| where TicketOptions=\"0x40810000\" OR TicketOptions=\"0x40800000\"\n| eval ticket_lifetime = TicketExpireTime - TicketIssueTime\n| where ticket_lifetime > 36000  --- >10 hours (abnormal)\n| stats count by src_ip, TargetUserName, ServiceName, TicketEncryptionType, TicketOptions\n| eval alert = \"Possible Golden\u002FSilver Ticket: Abnormal ticket properties\"\n```\n\n### Step 2: Detect Remote Service Exploitation (T1021)\n\n**PsExec Detection (T1021.002):**\n```spl\n--- Via Sysmon process creation\nindex=sysmon EventCode=1\n(Image=\"*\\\\psexec.exe\" OR Image=\"*\\\\psexesvc.exe\"\n OR OriginalFileName=\"psexec.c\" OR OriginalFileName=\"psexesvc.exe\"\n OR ParentImage=\"*\\\\psexesvc.exe\")\n| table _time, Computer, User, ParentImage, Image, CommandLine, Hashes\n\n--- Via named pipe creation (Sysmon EventCode 17)\nindex=sysmon EventCode=17\nPipeName IN (\"\\\\PSEXESVC*\", \"\\\\RemCom*\", \"\\\\csexec*\")\n| table _time, Computer, User, Image, PipeName\n\n--- Via Windows service creation (EventCode 7045)\nindex=wineventlog sourcetype=\"WinEventLog:System\" EventCode=7045\nServiceName=\"PSEXESVC\" OR ServiceFileName=\"*PSEXESVC*\"\n| table _time, Computer, ServiceName, ServiceFileName, AccountName\n```\n\n**WMI Remote Execution (T1047):**\n```spl\nindex=sysmon EventCode=1\n(Image=\"*\\\\wmic.exe\" AND CommandLine=\"*\u002Fnode:*\")\nOR (ParentImage=\"*\\\\WmiPrvSE.exe\" AND Image IN (\"*\\\\cmd.exe\", \"*\\\\powershell.exe\"))\n| eval execution_type = case(\n    match(Image, \"wmic\"), \"WMI Command Line\",\n    match(ParentImage, \"WmiPrvSE\"), \"WMI Provider Host (remote execution)\"\n  )\n| table _time, Computer, User, execution_type, ParentImage, Image, CommandLine\n```\n\n**WinRM\u002FPowerShell Remoting (T1021.006):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=4624\nLogon_Type=3 AuthenticationPackageName=\"Kerberos\"\n| where ProcessName=\"*\\\\wsmprovhost.exe\" OR ProcessName=\"*\\\\powershell.exe\"\n| stats count, dc(ComputerName) AS unique_targets by src_ip, TargetUserName\n| where unique_targets > 2\n| eval alert = \"PowerShell Remoting to \".unique_targets.\" hosts from \".src_ip\n\n--- Sysmon variant\nindex=sysmon EventCode=1\nParentImage=\"*\\\\wsmprovhost.exe\"\nImage IN (\"*\\\\cmd.exe\", \"*\\\\powershell.exe\", \"*\\\\csc.exe\")\n| table _time, Computer, User, Image, CommandLine\n```\n\n**RDP Lateral Movement (T1021.001):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=4624 Logon_Type=10\n| stats count, dc(ComputerName) AS rdp_targets, values(ComputerName) AS destinations,\n        earliest(_time) AS first_rdp, latest(_time) AS last_rdp\n  by src_ip, TargetUserName\n| where rdp_targets > 2\n| eval duration_hours = round((last_rdp - first_rdp) \u002F 3600, 1)\n| eval alert = TargetUserName.\" RDP'd to \".rdp_targets.\" hosts in \".duration_hours.\" hours\"\n| sort - rdp_targets\n```\n\n### Step 3: Detect SMB-Based Lateral Movement\n\n**Anomalous SMB Traffic Patterns:**\n```spl\nindex=firewall OR index=zeek sourcetype IN (\"pan:traffic\", \"bro:conn:json\")\ndest_port=445 action=allowed\n| where src_ip!=dest_ip\n| stats count AS smb_sessions, dc(dest_ip) AS unique_targets,\n        sum(bytes_out) AS total_bytes\n  by src_ip\n| where unique_targets > 10\n| eval alert = case(\n    unique_targets > 50, \"CRITICAL: Mass SMB enumeration from \".src_ip,\n    unique_targets > 20, \"HIGH: Significant SMB lateral movement\",\n    unique_targets > 10, \"MEDIUM: Elevated SMB connections\"\n  )\n| sort - unique_targets\n```\n\n**Admin Share Access (C$, ADMIN$):**\n```spl\nindex=wineventlog sourcetype=\"WinEventLog:Security\" EventCode=5140\nShareName IN (\"\\\\\\\\*\\\\C$\", \"\\\\\\\\*\\\\ADMIN$\", \"\\\\\\\\*\\\\IPC$\")\n| where SubjectUserName!=\"SYSTEM\" AND SubjectUserName!=\"$\"\n| stats count, dc(ComputerName) AS unique_hosts by SubjectUserName, ShareName, src_ip\n| where unique_hosts > 3\n| eval alert = \"Admin share access to \".unique_hosts.\" hosts by \".SubjectUserName\n| sort - unique_hosts\n```\n\n### Step 4: Build Lateral Movement Graph\n\nVisualize the attack path:\n\n```spl\n--- Build source->destination graph for authentication events\nindex=wineventlog EventCode=4624 Logon_Type IN (3, 10)\nearliest=-24h\n| stats count AS connections, latest(_time) AS last_connection\n  by src_ip, ComputerName, TargetUserName, Logon_Type\n| eval edge = src_ip.\" -> \".ComputerName.\" (User: \".TargetUserName.\", Type: \".Logon_Type.\")\"\n| sort - connections\n| table edge, connections, last_connection\n\n--- Network flow correlation\nindex=netflow earliest=-24h\ndest_port IN (445, 135, 3389, 5985, 5986)\n| stats sum(bytes) AS total_bytes, count AS flow_count,\n        dc(dest_ip) AS targets by src_ip, dest_port\n| where targets > 5\n| eval service = case(\n    dest_port=445, \"SMB\",\n    dest_port=135, \"RPC\u002FWMI\",\n    dest_port=3389, \"RDP\",\n    dest_port IN (5985, 5986), \"WinRM\"\n  )\n| sort - targets\n| table src_ip, service, targets, flow_count, total_bytes\n```\n\n### Step 5: Detect DCOM and Scheduled Task-Based Movement\n\n**DCOM Lateral Execution (T1021.003):**\n```spl\nindex=sysmon EventCode=1\nParentImage IN (\"*\\\\mmc.exe\", \"*\\\\excel.exe\", \"*\\\\outlook.exe\")\nImage IN (\"*\\\\cmd.exe\", \"*\\\\powershell.exe\", \"*\\\\mshta.exe\")\n| where ParentCommandLine=\"*-Embedding*\"\n| eval alert = \"DCOM-based lateral movement: \".ParentImage.\" spawned \".Image\n| table _time, Computer, User, ParentImage, Image, CommandLine, alert\n```\n\n**Remote Scheduled Task Creation (T1053.005):**\n```spl\nindex=wineventlog EventCode=4698\n| where SubjectUserName!=\"SYSTEM\"\n| eval task_xml = TaskContent\n| search task_xml=\"*http*\" OR task_xml=\"*powershell*\" OR task_xml=\"*cmd*\" OR task_xml=\"*\\\\Temp\\\\*\"\n| table _time, Computer, SubjectUserName, TaskName, task_xml\n```\n\n### Step 6: Correlate Movement with Kill Chain Phases\n\nBuild end-to-end attack chain detection:\n\n```spl\n--- Detect complete lateral movement sequence\nindex=wineventlog OR index=sysmon\n(EventCode=4625 OR EventCode=4624 OR EventCode=1 OR EventCode=4698 OR EventCode=5140)\n| eval phase = case(\n    EventCode=4625, \"1-Recon\u002FBruteForce\",\n    EventCode=4624 AND Logon_Type=3, \"2-Lateral Movement\",\n    EventCode=5140 AND match(ShareName, \"C\\$|ADMIN\\$\"), \"3-Admin Share Access\",\n    EventCode=1 AND match(ParentImage, \"psexesvc|WmiPrvSE|wsmprovhost\"), \"4-Remote Execution\",\n    EventCode=4698, \"5-Persistence (Scheduled Task)\",\n    1=1, \"other\"\n  )\n| where phase!=\"other\"\n| stats count by phase, src_ip, ComputerName, TargetUserName\n| sort phase, _time\n| table phase, src_ip, ComputerName, TargetUserName, count\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|-----------|\n| **Lateral Movement** | Post-compromise technique where attackers pivot between systems to reach targets |\n| **Pass-the-Hash** | Using stolen NTLM hash for authentication without knowing the plaintext password |\n| **Pass-the-Ticket** | Using stolen Kerberos TGT\u002FTGS tickets for authentication across the domain |\n| **PsExec** | Sysinternals tool (and attack technique) for remote process execution via SMB and named pipes |\n| **WMI Execution** | Using Windows Management Instrumentation for remote command execution via DCOM or WinRM |\n| **Admin Share** | Default Windows administrative shares (C$, ADMIN$, IPC$) used for remote system management |\n\n## Tools & Systems\n\n- **Splunk Enterprise Security**: SIEM platform for correlating Windows events, Sysmon, and network flows\n- **Microsoft Defender for Identity**: Cloud service detecting lateral movement via domain controller monitoring\n- **BloodHound**: Active Directory attack path analysis tool for identifying lateral movement opportunities\n- **CrowdStrike Falcon**: EDR platform with lateral movement detection and automated containment\n- **Zeek (Bro)**: Network monitor generating connection logs for SMB, RDP, and WinRM traffic analysis\n\n## Common Scenarios\n\n- **PsExec Spread**: Attacker uses PsExec to execute malware across 20 workstations — detect via service creation events\n- **RDP Pivoting**: Compromised VPN account used to RDP through multiple internal hosts — detect via Logon_Type 10 chains\n- **WMI Recon and Execution**: Attacker uses WMI for discovery then execution — detect via WmiPrvSE child processes\n- **Pass-the-Hash Campaign**: Stolen local admin hash used across subnet — detect via NTLM Logon_Type 3 to multiple hosts\n- **Scheduled Task Persistence**: Remote scheduled task created on domain controller — detect via EventCode 4698 from non-admin source\n\n## Output Format\n\n```\nLATERAL MOVEMENT DETECTION REPORT\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nPeriod:       2024-03-15 14:00 to 18:00 UTC\nSource:       192.168.1.105 (WORKSTATION-042)\n\nMovement Path:\n  14:23  192.168.1.105 → 10.0.5.20  (DC-PRIMARY) — PtH via NTLM Type 3\n  14:25  10.0.5.20 → 10.0.5.21     (DC-BACKUP)  — Kerberos ticket reuse\n  14:28  10.0.5.20 → 10.0.10.15    (FILESERVER-01) — PsExec service creation\n  14:32  10.0.10.15 → 10.0.10.20   (DB-PRIMARY) — WMI remote execution\n  14:35  10.0.10.20 → 10.0.10.25   (DB-BACKUP)  — SMB admin share access\n\nTechniques Detected:\n  T1550.002 — Pass-the-Hash (NTLM authentication to DC)\n  T1021.002 — PsExec (remote service installation)\n  T1047     — WMI Execution (WmiPrvSE child process)\n  T1021.002 — SMB Admin Share (C$ access on DB-BACKUP)\n\nAffected Systems: 5 hosts across 2 network segments\nUser Account:     admin_compromised (Domain Admin)\nContainment:      All 5 hosts isolated at 14:45 UTC\n```\n",{"name":5,"tags":25,"author":35,"domain":36,"license":15,"version":37,"subdomain":38,"description":39},[26,27,28,29,30,31,32,33,34],"soc","lateral-movement","mitre-attack","pass-the-hash","psexec","wmi","rdp","smb","detection","mahipal","cybersecurity","1.0","soc-operations","Detects lateral movement techniques including Pass-the-Hash, PsExec, WMI execution, RDP pivoting, and SMB-based spreading using SIEM correlation of Windows event logs, network flow data, and endpoint telemetry mapped to MITRE ATT&CK Lateral Movement (TA0008) techniques.\n","main","c2b1fdccc779e99ac814e55fb69ca8d71215dd0f","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection","https:\u002F\u002Fgithub.com\u002FSamuelChien","http:\u002F\u002Fsamuelchien.com\u002F","2026-05-26 08:27:14",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add SamuelChien\u002Fmega-skills-collection --skill performing-lateral-movement-detection",{"tool":52,"command":53},"bunx","bunx skills add SamuelChien\u002Fmega-skills-collection --skill performing-lateral-movement-detection",{"tool":55,"command":56},"pnpm","pnpm dlx skills add SamuelChien\u002Fmega-skills-collection --skill performing-lateral-movement-detection","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fperforming-lateral-movement-detection\u002FSKILL.md",true,[60,64,70],{"path":61,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fapi-reference.md","REFERENCE","参考文档",1793,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fperforming-lateral-movement-detection\u002Freferences\u002Fapi-reference.md",{"path":71,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":74,"sourceHtmlUrl":75},"scripts\u002Fagent.py","SCRIPT","脚本",8962,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fperforming-lateral-movement-detection\u002Fscripts\u002Fagent.py",[77,85,92,99,106,113],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":20},"01M76R4WZQZAXGGXMQCA0FZ716","zustand-store-ts","Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state\u002Faction separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.","MIT","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-ts\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":20},"01M76R4T9KENDH7FENGZQHBW4G","zustand-store-creator","Zustand Store Creator - Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":20},"01M76R3YWN84B7SANJ52X799ZE","zero-trust-config-helper","Zero Trust Config Helper - Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":20},"01M76R3HNSV2AEYSKHM915GJ58","zapier-integration-helper","Zapier Integration Helper - Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":20},"01M76R3DJSKAT4FA7DV4BF3GCE","zai-cli","Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP.\nUse when user needs image\u002Fvideo analysis, OCR, UI-to-code conversion, error diagnosis,\nreal-time web search, web page to markdown extraction, or GitHub code exploration.\nTrigger with phrases like \"analyze this image\", \"search the web for\", \"read this page\",\n\"explore this repo\", or \"use zai\". Requires Z_AI_API_KEY.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzai-cli\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":20},"01M76R2KAM699XE9AJVAWE4H2E","yt-research","Research competitor YouTube channels, niches, and trending topics for your content strategy.\nUse this skill whenever the user says \"research channels\", \"analyze competitors\", \"find trending topics\",\n\"niche analysis\", \"competitive research\", \"what are other creators doing\", \"scrape YouTube channels\",\nor wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fyt-research\u002FSKILL.md",[],[]]