[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E5VB52KJ7XM560J4B9Q105":3,"skill-same:01M7E5VB52KJ7XM560J4B9Q105":95},{"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":57,"commitSha":58,"skillDirectory":59,"forksCount":60,"repositoryHtmlUrl":61,"repositoryHomepageUrl":6,"ownerHtmlUrl":62,"ownerBlogUrl":6,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M7E5VB52KJ7XM560J4B9Q105","performing-lateral-movement-detection",null,"Detects lateral movement techniques including Pass-the-Hash, PsExec, WMI execution, RDP pivoting, and SMB-based spreading by correlating Windows Security\u002FSysmon event logs, network flow data (NetFlow\u002FZeek), and endpoint telemetry in a SIEM, mapped to MITRE ATT&CK Lateral Movement (TA0008) techniques with sample SPL detection queries. Use when a SOC team needs to detect attackers pivoting between internal systems after initial compromise, trace an attacker's movement path during an incident investigation, or build detection engineering rules for TA0008; not for detecting initial access or external attacks.","sanjeevafk\u002Fagent-skills","sanjeevafk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F230678117?v=4","01M7C540EFY46ETG1NNWKS5X3Q","Sanjeev","01M7C540F366J5C1D587BMKH9Q",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-lateral-movement-detection\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-lateral-movement-detection\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-lateral-movement-detection\ndescription: 'Detects lateral movement techniques including Pass-the-Hash, PsExec,\n  WMI execution, RDP pivoting, and SMB-based spreading by correlating Windows Security\u002FSysmon\n  event logs, network flow data (NetFlow\u002FZeek), and endpoint telemetry in a SIEM,\n  mapped to MITRE ATT&CK Lateral Movement (TA0008) techniques with sample SPL detection\n  queries. Use when a SOC team needs to detect attackers pivoting between internal\n  systems after initial compromise, trace an attacker''s movement path during an\n  incident investigation, or build detection engineering rules for TA0008; not for\n  detecting initial access or external attacks.\n\n  '\ndomain: cybersecurity\nsubdomain: soc-operations\ntags:\n- soc\n- lateral-movement\n- mitre-attack\n- pass-the-hash\n- psexec\n- wmi\n- rdp\n- smb\n- detection\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nd3fend_techniques:\n- Token Binding\n- Execution Isolation\n- Restore Access\n- Application Protocol Command Analysis\n- Process Termination\nnist_csf:\n- DE.CM-01\n- DE.AE-02\n- RS.MA-01\n- DE.AE-06\nmitre_attack:\n- T1078\n- T1685.002\n- T1685.005\n- T1566\n- T1021\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,"nist_csf":38,"subdomain":43,"description":44,"mitre_attack":45,"d3fend_techniques":51},[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",[39,40,41,42],"DE.CM-01","DE.AE-02","RS.MA-01","DE.AE-06","soc-operations","Detects lateral movement techniques including Pass-the-Hash, PsExec, WMI execution, RDP pivoting, and SMB-based spreading by correlating Windows Security\u002FSysmon event logs, network flow data (NetFlow\u002FZeek), and endpoint telemetry in a SIEM, mapped to MITRE ATT&CK Lateral Movement (TA0008) techniques with sample SPL detection queries. Use when a SOC team needs to detect attackers pivoting between internal systems after initial compromise, trace an attacker's movement path during an incident investigation, or build detection engineering rules for TA0008; not for detecting initial access or external attacks.\n",[46,47,48,49,50],"T1078","T1685.002","T1685.005","T1566","T1021",[52,53,54,55,56],"Token Binding","Execution Isolation","Restore Access","Application Protocol Command Analysis","Process Termination","main","4e084e84eb42fc53e144c89c0f7f48b39c8a4b0f","collections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-lateral-movement-detection",1,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills","https:\u002F\u002Fgithub.com\u002Fsanjeevafk","First make it work. Then make it right. Then make it fast.","2026-11-14 13:36:16",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add sanjeevafk\u002Fagent-skills --skill performing-lateral-movement-detection",{"tool":71,"command":72},"bunx","bunx skills add sanjeevafk\u002Fagent-skills --skill performing-lateral-movement-detection",{"tool":74,"command":75},"pnpm","pnpm dlx skills add sanjeevafk\u002Fagent-skills --skill performing-lateral-movement-detection","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-lateral-movement-detection\u002FSKILL.md",true,[79,83,89],{"path":80,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fapi-reference.md","REFERENCE","参考文档",1793,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-lateral-movement-detection\u002Freferences\u002Fapi-reference.md",{"path":90,"resourceType":91,"resourceTypeDesc":92,"sizeBytes":93,"sourceHtmlUrl":94},"scripts\u002Fagent.py","SCRIPT","脚本",8962,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-lateral-movement-detection\u002Fscripts\u002Fagent.py",[96,104,112,120,128,135],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":100,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":20},"01M7EFHX67M3KKXT1BXVPA5ADT","zarr-python","Chunked N-D arrays for cloud storage (Zarr-Python 3). Compressed arrays, parallel I\u002FO, S3\u002FGCS via fsspec, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","MIT","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":100,"licenseFileUrl":108,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":20},"01M7EFFQGM51TZBGRENXY50ZYM","whiteboard-diagrams","Create accurate, simple, hand-drawn whiteboard diagrams from a user's process, system, architecture, learning workflow, comparison, or causal explanation. Use when the user asks for a scribbly whiteboard visual, educational workflow graphic, hand-drawn explainer, or diagram like the bundled reference; ask one focused clarification question when the subject or relationships are missing, then generate and visually verify the final image.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":116,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":20},"01M7EFF1CSQNTDMHFK4ZGY6NYK","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":124,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":20},"01M7EFE8106X6C28FT8PA74427","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[],{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":100,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":20},"01M7EFCSNZM9G7ZHS6F127Q71X","verification-loop","A comprehensive verification system for Claude Code sessions.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[],{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":100,"licenseFileUrl":139,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":20},"01M7EFCE7EZMKPRYDDNKBQ9EEH","vercel-deploy","Deploy applications and websites to Vercel. Use when the user requests deployment actions like \"deploy my app\", \"deploy and give me the link\", \"push this live\", or \"create a preview deployment\".","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FSKILL.md",[],[]]