THREAT-LateralMovement-SMBPsExec

Lateral Movement via SMB and PsExec-Style Remote Execution

Lateral Movement Execution Last updated:

SMB-based lateral movement using PsExec, PAExec, or RemCom is the dominant lateral movement technique in ransomware deployments by Akira, Black Basta, and LockBit affiliates. The attacker gains initial credentials (via spray, phishing, or VPN compromise), then uses remote execution tools to install and run payloads on other hosts across the domain — typically targeting domain controllers first for maximum impact. Key behavioural indicators: (1) PsExec binary appearing in user temp directories rather than System32 (attackers drop it from a C2 payload); (2) PSEXESVC service being created on remote hosts — the server-side component of PsExec; (3) Admin share (ADMIN$) access used to copy the execution wrapper; (4) Use of Windows Management Instrumentation (WMI) or WinRM as alternatives when PsExec is blocked. NCSC has observed Akira affiliates using this exact pattern against UK SMBs since 2023.

What is THREAT-LateralMovement-SMBPsExec Lateral Movement via SMB and PsExec-Style Remote Execution?

Lateral Movement via SMB and PsExec-Style Remote Execution (THREAT-LateralMovement-SMBPsExec) maps to the Lateral Movement and Execution tactics — the adversary is trying to move through your environment in MITRE ATT&CK.

This page provides production-ready detection logic for Lateral Movement via SMB and PsExec-Style Remote Execution, covering the data sources and telemetry it touches: Microsoft Defender for Endpoint (DeviceProcessEvents, DeviceServiceEvents, DeviceNetworkEvents), Sysmon Event ID 1, 3, 7, Windows Security Event Log. The queries below are rated high severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Lateral Movement Execution
Microsoft Sentinel / Defender
kusto
// THREAT: Lateral Movement via SMB/PsExec-Style Remote Execution
// Detects PsExec, PAExec, PSEXESVC service creation, and Admin share lateral movement

// Alert 1: PsExec/PAExec execution from non-standard locations
let LegitPsExecPaths = dynamic(["C:\\Tools\\", "C:\\Sysinternals\\", "C:\\Program Files\\Sysinternals"]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("psexec.exe", "psexec64.exe", "paexec.exe", "remcom.exe", "csexec.exe")
| where not(FolderPath has_any (LegitPsExecPaths))
| extend SuspiciousLocation = FolderPath has_any (
    "C:\\Users\\", "C:\\Windows\\Temp\\", "C:\\ProgramData\\",
    "AppData\\", "C:\\Temp\\", "C:\\Public\\"
  )
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
    ProcessCommandLine, InitiatingProcessFileName, SuspiciousLocation
| extend ThreatType = "LateralMovement_PsExec_SuspiciousPath"
| extend StagingRisk = 85;
// Alert 2: PSEXESVC service creation (server-side PsExec indicator)
DeviceServiceEvents
| where Timestamp > ago(24h)
| where ServiceName in~ ("PSEXESVC", "paexec", "remcom")
| project Timestamp, DeviceName, AccountName, ServiceName, ServiceState,
    InitiatingProcessFileName, InitiatingProcessCommandLine
| extend ThreatType = "LateralMovement_PSEXESVC_RemoteService"
| extend StagingRisk = 90;
// Alert 3: Admin share access from internal hosts (staging/lateral movement)
DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemotePort in (445, 139)
| where ActionType =~ "ConnectionSuccess"
| where RemoteIPType =~ "Private"
// Exclude expected domain controller replication and group policy traffic
| where InitiatingProcessFileName !in~ ("svchost.exe", "lsass.exe", "system")
| summarize
    Connections=count(),
    TargetHosts=dcount(RemoteIP),
    TargetIPs=make_set(RemoteIP)
  by DeviceName, AccountName, InitiatingProcessFileName, bin(Timestamp, 15m)
| where Connections >= 5 or TargetHosts >= 3
| extend ThreatType = "LateralMovement_AdminShare_BulkAccess"
| extend StagingRisk = 75

Three-vector lateral movement detection: (1) PsExec/PAExec execution from temp/user directories rather than authorised management paths — attackers drop PsExec from their payload rather than using a pre-installed version; (2) PSEXESVC service creation on target hosts — the server-side PsExec indicator on the destination system; (3) bulk SMB connections to internal hosts from non-system processes — indicates automated scanning or lateral spread across network shares.

high severity high confidence

Data Sources

Microsoft Defender for Endpoint (DeviceProcessEvents, DeviceServiceEvents, DeviceNetworkEvents) Sysmon Event ID 1, 3, 7 Windows Security Event Log

Required Tables

DeviceProcessEvents DeviceServiceEvents DeviceNetworkEvents

False Positives

  • Authorised IT administrators using PsExec from Sysinternals for remote administration from approved management workstations
  • Software deployment tools (SCCM, Ansible, Puppet) that use WMI or SMB for mass package deployment
  • Domain join and Group Policy application traffic over SMB (exclude SYSTEM and svchost.exe as initiators)
  • Enterprise backup agents (Veeam, Backup Exec) that access admin shares during backup jobs

Sigma rule & cross-platform mapping

The detection logic for Lateral Movement via SMB and PsExec-Style Remote Execution (THREAT-LateralMovement-SMBPsExec) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: process_creation
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 1 adversary technique from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1PsExec Remote Command Execution for Lateral Movement Simulation

    Expected signal: On source: Sysmon Event ID 1 for psexec.exe, Sysmon Event ID 3 for SMB connection to target. On target: Windows Event ID 7045 (PSEXESVC service installed), Sysmon Event ID 11 (PSEXESVC.exe created in C:\Windows\), Security Event ID 4624 (network logon).


Response Playbook

Triage

  1. Identify the source host and account for PsExec execution. Is this a known IT management workstation? Is the account an IT admin account or a compromised user account?
  2. If PSEXESVC service is created on a target host, trace back the source: which host initiated the connection? The source host and account combination is the attacker's pivot point.
  3. Map lateral movement paths: which hosts were accessed? Is there a pattern (all domain controllers, all finance workstations, all file servers) that indicates the attacker's objective?
  4. Check the PsExec command line: what was executed remotely? If it's the ransomware payload, encryption may already be in progress on the target hosts.
  5. Determine the credential used: was it a domain admin, local admin, or service account? How was it obtained? This is critical for containment.

Containment

  1. Isolate affected hosts via EDR host isolation immediately — do not rely on network-level isolation alone as the attacker may have multiple pivot points.
  2. Disable the compromised account used for lateral movement.
  3. Block SMB (port 445) between workstations at the internal firewall if host-to-host SMB is not required. Most ransomware lateral movement relies on workstation-to-workstation SMB.
  4. Force domain admin session logoff from all workstations (there should be no domain admin sessions on non-server hosts).
  5. Deploy emergency GPO to block PsExec execution via AppLocker or WDAC if not already in place: add PSEXESVC to application control blocklist.

Evidence Collection

  1. Sysmon Event ID 1 for PsExec/PAExec processes with full command line
  2. Sysmon Event ID 11 for PSEXESVC.exe file creation with source process
  3. Windows Event ID 7045 (new service installed) for PSEXESVC service
  4. Windows Security Event ID 4624 (logon) for network logons used during lateral movement
  5. SMB access logs (Windows Event ID 5140) for Admin share access events

Escalation Criteria

  • ! PSEXESVC created on a domain controller
  • ! Ransomware payload executed via PsExec on multiple hosts
  • ! Shadow copy deletion following PsExec lateral movement
  • ! Domain admin account used for lateral movement (indicates full domain compromise)
  • ! Lateral movement to backup servers or data repositories (pre-encryption exfiltration)

Investigation Guide

Forensic Artifacts

  • > PSEXESVC.exe in C:\Windows\: file creation time, hash, source of copy
  • > Windows Event ID 7045: new service installed — PSEXESVC service entry with start time
  • > SMB share access logs: Windows Security Event ID 5140/5145 showing Admin$ access
  • > Prefetch: PSEXESVC.EXE-*.pf and PSEXEC.EXE-*.pf on both source and target hosts
  • > Network captures: SMB traffic between source and target hosts during lateral movement

Tuning Guidance

The highest-fidelity signal in this detection is PSEXESVC service creation — this specific service name has no legitimate reason to appear unless PsExec is being used for remote execution. Create a zero-tolerance alert for PSEXESVC creation on servers and domain controllers. For workstations, add a whitelist of authorised IT admin source hosts from which PsExec use is expected. SMB connection monitoring generates more noise — use the 5-target threshold as a starting point and adjust based on your environment's normal file server access patterns.


Hunting Queries

Hunt for workstations with high numbers of outbound SMB connections to other internal hosts from non-system processes — indicates automated lateral movement or ransomware spreading via network shares.

Hunting — KQL
kql
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where RemotePort == 445
| where ActionType =~ "ConnectionSuccess"
| where InitiatingProcessFileName !in~ ("svchost.exe", "lsass.exe", "system", "ntoskrnl.exe")
| summarize
    TargetHosts=dcount(RemoteIP),
    Connections=count(),
    Targets=make_set(RemoteIP)
  by DeviceName, AccountName, InitiatingProcessFileName, bin(Timestamp, 1h)
| where TargetHosts >= 5
| sort by TargetHosts desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=3
  DestinationPort=445 NOT (Image="*svchost.exe" OR Image="*lsass.exe")
| bin _time span=1h
| stats dc(DestinationIp) AS TargetHosts, count AS Conns, values(DestinationIp) AS Targets
  BY host, User, Image
| where TargetHosts >= 5
| sort - TargetHosts

Atomic Red Team Tests

Test 1 PsExec Remote Command Execution for Lateral Movement Simulation
windows

Uses PsExec to execute a benign command on a remote host, simulating lateral movement. Tests detection of PSEXESVC service creation and remote execution via admin share.

Command

powershell
psexec.exe \\<TARGET_HOST> -u <DOMAIN>\<ADMIN_USER> -p <PASSWORD> -accepteula ipconfig /all

Expected Telemetry

On source: Sysmon Event ID 1 for psexec.exe, Sysmon Event ID 3 for SMB connection to target. On target: Windows Event ID 7045 (PSEXESVC service installed), Sysmon Event ID 11 (PSEXESVC.exe created in C:\Windows\), Security Event ID 4624 (network logon).

Expected Detection

Alert fires on PSEXESVC_Dropped indicator on target host (RiskScore=90) and PsExec_SuspiciousPath on source if dropped from non-standard path.

Related Detections