Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / ACTIVE DIRECTORY / LATERAL MOVEMENT / EXEC

WinRM Exec

This note documents detection patterns related to WinRM Exec within Active Directory environments.


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Security4624Successful logonHighNetwork logon via WinRM authentication.
Security4672Special privileges assignedHighAdministrative privileges used during remote session.
Security4688Process createdCriticalCommand execution spawned through WinRM session.
Microsoft-Windows-WinRM/Operational91WinRM session createdCriticalIndicates remote WinRM session established.
Sysmon1Process creationHighpowershell.exe or cmd.exe spawned via WinRM.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
PowerShell remote sessionpowershell.exe with remote session parametersHighTypical WinRM usage.
Network communication on 5985/5986HTTP/HTTPS WinRM trafficMediumSupports remote command execution.
Parent process chainwsmprovhost.exe spawning shellCriticalCommon WinRM execution artifact.

Common Tools

ToolUsage
Evil-WinRMPopular offensive WinRM shell.
PowerShell Enter-PSSessionNative remote PowerShell execution.
PowerShell Invoke-CommandExecutes commands over WinRM.
CrackMapExecAutomates WinRM lateral movement.

Relevant Artifacts

  • Security logs (4624, 4672, 4688)
  • WinRM operational logs
  • Sysmon process logs
  • Network logs for ports 5985 / 5986
  • EDR telemetry
  • PowerShell transcript logs

MITRE ATT&CK References

  • T1021 Remote Services
  • T1021.006 Windows Remote Management

Decision Tree

  1. Detect WinRM session creation.
  2. Identify source host.
  3. Inspect authentication account.
  4. Review executed command.
  5. Determine lateral movement scope.

Example Detection Templates

KQL

DeviceProcessEvents
| where InitiatingProcessFileName == "wsmprovhost.exe"

EQL

process where parent.name == "wsmprovhost.exe"

Sigma

title: Suspicious WinRM Command Execution
logsource:
  product: windows
  category: process_creation
detection:
  selection:
    ParentImage|endswith: wsmprovhost.exe
  condition: selection
level: high

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
WinRM restrictionsLimit remote management accessHighReduces attack surface.
MonitoringAlert on wsmprovhost spawning shellsHighStrong detection signal.
Credential hygieneLimit admin credential reuseCriticalPrevents lateral movement.