Windows PowerShell script enabling WinRM via Enable-PSRemoting

Alerts on PowerShell scripts that include Enable-PSRemoting, a common step to activate WinRM for remote access.

FreeReviewedSigma · Medium · v2
Product
windows
Category
ps_script
Author
frack113 (SigmaHQ), DRL 1.1
Published
2022-01-07
Updated
2026-07-31

ATT&CK techniques

Lateral Movement
  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Execution

  5. Persistence

  6. Priv Esc

  7. Defense Evasion

  8. Cred Access

  9. Discovery

  10. Collection

  11. C2

  12. Exfiltration

  13. Impact

What it detects

This rule flags PowerShell script block content containing the Enable-PSRemoting command with a trailing space, which is used to enable Windows Remote Management (WinRM) for remote access. Attackers can use this to establish remote management capability under the context of the user whose credentials are available, supporting subsequent remote actions. It relies on Script Block Logging telemetry that records the PowerShell script content executed on the host.

Related detections9 linkedT1021.006 — drag to rearrange
Malicious Invoke-WMIExec Lateral Movement Download and Execute (via ps_script)
Windows process creation: child process spawned by winrshost.exe
Windows Winrs.exe Local Command Execution via localhost/loopback
Windows PowerShell: Invoke-Command targeting -ComputerName via script block
Windows HackTool Activity: Evil-WinRM Ruby Process with -i, -u, -p Arguments
Zeek HTTP POST to /wsman without Authorization — Possible OMIGOD unauthenticated RCE (CVE-2021-38647)
Windows remote PowerShell session activity via wsmprovhost.exe process relationships
Windows Remote PowerShell via PS Classic (wsmprovhost.exe, HostName=ServerRemoteHost)
Windows Remote PowerShell Session via PS Module ContextInfo and wsmprovhost.exe
Windows PowerShell script enabling WinRM via Enable-PSRemoting
Pivot detection · T1021.006 · 9 related

Changelog

v2
  1. v2
    Candidate ingested via manual entry.2026-07-31
  2. v1
    No changelog recorded for this version.2026-07-30

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.