WINRM
WSMPROVHOST
PORT 5985
PS REMOTING
DetectionBlue TeamSOCOctober 12, 2026•9 min read

Detecting WinRM and PowerShell Remoting Lateral Movement

Remote commands over WinRM all run inside one process: wsmprovhost.exe. What it spawns, and who connected to it, tells you most of the story.

Scroll

WinRM is the transport for Enter-PSSession, Invoke-Command and tools such as Evil-WinRM. On the target, every remote session is hosted by wsmprovhost.exe, which makes it an unusually clean anchor for detection. The logging that surrounds it adds the identity and source.

Signals at a Glance

SignalWhereATT&CK
wsmprovhost.exe starting, and the processes it spawnsSysmon 1, Event 4688T1021.006
Inbound connection to TCP 5985 or 5986 from a non-admin sourceFirewall, Zeek, Sysmon 3T1021.006
Shell creation and user authentication on the serverWinRM/Operational 91, 169T1021.006
Remote script blocks with ServerRemoteHost / suspicious contentPowerShell 4103, 4104, 400T1059.001
Type 3 logon immediately before wsmprovhost startsEvent 4624T1078

wsmprovhost and Its Children

A remote PowerShell session runs inside wsmprovhost.exe. Interactive administration looks like script blocks in the PowerShell log; an attacker typically also launches child processes such as cmd.exe, whoami.exe or net.exe. Alert on the interpreter and reconnaissance children, then enrich with the connecting account:

title: Suspicious Child of wsmprovhost
logsource:
  product: windows
  category: process_creation
detection:
  parent:
    ParentImage|endswith: '\wsmprovhost.exe'
  suspicious_child:
    Image|endswith:
      - '\cmd.exe'
      - '\whoami.exe'
      - '\net.exe'
      - '\net1.exe'
      - '\nltest.exe'
      - '\rundll32.exe'
      - '\mshta.exe'
  condition: parent and suspicious_child
level: medium
# tune/validate: raise to high on servers with no remoting use; baseline configuration-management tools.

From the network side, WinRM is a small, well-defined surface. Inbound 5985/5986 to endpoints outside your server management VLAN is unusual:

// Microsoft Defender (KQL) - inbound WinRM to hosts from non-admin sources
DeviceNetworkEvents
| where ActionType == "InboundConnectionAccepted"
| where LocalPort in (5985, 5986)
| where RemoteIP !in (externaldata_admin_hosts)   // replace with a watchlist of approved sources
| summarize conns=count(), targets=dcount(DeviceName) by RemoteIP, bin(Timestamp, 1h)
| order by targets desc
// tune/validate: define the approved-sources watchlist first; the dynamic list name above is a placeholder.

Logging That Makes It Visible

Vetted sources

Use the SigmaHQ wsmprovhost and WinRM rules, Elastic and Splunk ESCU remote PowerShell content and MITRE CAR analytics for PowerShell remoting. Atomic Red Team includes WinRM tests, and Zeek can log connections on 5985 and 5986 for hosts without endpoint coverage. Baseline your own environment: Ansible, DSC and monitoring tools produce legitimate remoting.

Build Detections That Fire

Mjolnir Security helps blue teams turn threat intelligence into high-fidelity detections across endpoint, network, identity and cloud telemetry.

Detection EngineeringManaged Detection & ResponseThreat HuntingIncident ResponsePurple Teaming
  • Detection Engineering We build and tune detections mapped to ATT&CK from your own telemetry.
  • Threat Hunting as a Service Hypothesis-driven hunts for the behaviours on this page.
  • 24/7 Incident Response Containment when a detection fires. Call +1 833 403 5875.
Written by: Mjolnir Threat Research (MTAC)  |  Published: October 12, 2026  |  Last reviewed: October 12, 2026