Skip to content

Lesson 9 of 14 · 22m

Lateral Movement: The Target-Side Tell

PsExec, WMI, WinRM, scheduled tasks, and RDP each leave a durable parent on the target host — build the five-rule table and prove it with tests.

Every lateral movement technique leaves two footprints: one on the host the attacker sits on, one on the host they land on. Source-side artifacts — wmic /node:, Enter-PSSession, mstsc.exe — are easy to mimic or skip entirely. The durable detections key on the target side: when a server receives a command via remote administration, the work it does is spawned by a specific parent process, and that parent is the tell no matter what tool initiated it.

PsExec-style service execution

PsExec (and its dozens of imitators — RemCom, Cobalt Strike's psexec, every ransomware kit) works the same way: copy a service binary to \\TARGET\ADMIN$, install it as a Windows service, run it as SYSTEM, clean up. Four artifacts on the target:

  • Sysmon EID 11 — file create writing PSEXESVC.exe (or any binary) into ADMIN$/C:\Windows
  • System log EID 7045 — "a service was installed," with the service name and binary path
  • Sysmon EID 1 — the service process spawned with ParentImage: services.exe under SYSTEM
  • Sysmon EID 17/18 — the \PSEXESVC named pipe

The durable version of this rule isn't "PSEXESVC exists" — attackers rename it freely. It's the composition: a remote service install (7045 on a host that doesn't get new services) plus a services.exe child running from a user-writable path.

WMI — T1047

wmic /node:SERVER process call create and Invoke-CimMethod/Invoke-WmiMethod all land the same way: on the target, the new process is spawned by WmiPrvSE.exe. That parent-child join is the detection — ParentImage: WmiPrvSE.exe spawning cmd, powershell, or anything interactive is remote WMI execution regardless of what the attacker typed on their box. On the source, wmic.exe with /node: or Invoke-CimMethod -ComputerName is corroborating telemetry — and wmic.exe is being removed from Windows 11 anyway, which is why target-side detection is the durable play.

PSRemoting / WinRM

Enter-PSSession, Invoke-Command, and winrs execute inside wsmprovhost.exe on the target — same durable-parent pattern, different parent. The commands also land in the target's EID 4104 script block stream (the PowerShell logging lesson), and WinRM's Operational log adds EID 91 (shell creation) and 168 (authorization). Alert on wsmprovhost.exe spawning anything other than powershell.exe, and watch PowerShell child processes of wsmprovhost arriving from hosts that aren't admin jump boxes.

Scheduled tasks — T1053.005

schtasks /s TARGET /create … and New-ScheduledTask over RPC produce Security 4698 (task created) plus TaskScheduler Operational 106/129/200/201 on the target. The task's work runs parented under svchost.exe hosting the Schedule service — same pattern again: known service parent spawning attacker content. Sharp version: 4698 where the task author/account isn't an admin tool's service account and the action path is user-writable or remote.

RDP — T1021.001

Target side: Security 4624 LogonType 10 (RemoteInteractive; type 7 is a console reconnect/unlock) and Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational 1149 carrying the source IP and account. Source side: mstsc.exe outbound to a server it has no business touching. The high-value detection is unexpected pairings — workstation→server RDP from accounts that never administer anything — which requires a baseline of who legitimately RDPs where, not a blanket "RDP happened" alert.

The pattern underneath all of it

TechniqueDurable target-side tell
PsExecservices.exe → new binary from ADMIN$-adjacent path; 7045
WMIWmiPrvSE.exe → shell/interpreter
WinRMwsmprovhost.exe → work; WinRM 91/168
Sched task4698 + svchost(Schedule) → payload
RDP4624 type 10 + 1149; unexpected pairing

Remote administration tools are legitimate — that's why they work for attackers. You cannot block the service parents; you can detect who uses them, from where, spawning what. Build this table as five rules, fire Atomic Red Team's T1047/T1053.005 tests plus a real psexec and Enter-PSSession against a lab host, and watch each parent-child pair land.

The practice

For every lateral movement technique in your threat model, write the detection on the target side first. Then corroborate on the source. An attacker can choose their tool; they cannot choose who parents the work it lands on.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.