Windows PowerShell: Invoke-Command targeting -ComputerName via script block

Detects PowerShell Invoke-Command targeting remote hosts by matching script block text with -ComputerName.

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 logging events containing an Invoke-Command call that includes the -ComputerName parameter targeting a remote host. Attackers can use this pattern to run commands on remote systems while leveraging existing valid user sessions for lateral movement. It relies on telemetry that records PowerShell script block text, specifically matching the presence of the Invoke-Command command and the remote computer argument.

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 script enabling WinRM via Enable-PSRemoting
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: Invoke-Command targeting -ComputerName via script block
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.