Skip to main content

Hunting — Lateral Movement via SMB/PsExec

The prompt
In Microsoft Defender XDR advanced hunting, write and run a KQL query to identify potential lateral movement in the last 48 hours.

Look for:
- Remote service creation events (ServiceControlManager)
- PsExec or equivalent tool usage (process name or command line contains psexec, paexec, or remcom)
- Network connections on port 445 (SMB) originating from workstations (not servers)

Return a table: source device, destination device, tool or method used, timestamp, and initiating user. Flag any source device that attempted lateral movement to more than 2 destinations.

How to use it

  1. 1Select Copy the prompt above.
  2. 2Paste it into Microsoft 365 Copilot.
  3. 3Replace anything in brackets with your own detail, then send it.

Copilot gathers and drafts. You verify and decide. Check every figure, name and date against the system it came from before you act on it.

Written for

Threat Hunter, SOC Analyst L3