Windows PowerShell: WebRequest User-Agent Modification in ScriptBlockText

Detects PowerShell scripts that make web requests and set a custom -UserAgent value.

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

ATT&CK techniques

C2
  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Execution

  5. Persistence

  6. Priv Esc

  7. Defense Evasion

  8. Cred Access

  9. Discovery

  10. Lateral Movement

  11. Collection

  12. Exfiltration

  13. Impact

What it detects

This rule looks for PowerShell script block content that uses common web request cmdlets (Invoke-WebRequest or Invoke-RestMethod) together with setting a custom -UserAgent parameter. Adversaries may alter the User-Agent header to better blend command-and-control traffic with legitimate web requests. It relies on Script Block Logging telemetry that captures ScriptBlockText containing the relevant cmdlet and -UserAgent usage patterns.

Related detections9 linkedT1071.001 — drag to rearrange
Malicious Cobalt Strike Default Named Pipe Activity
Malicious VoidLink Kernel Rootkit C2 Endpoints via HTTP (via proxy)
Malicious EtherRAT C2 Exfiltration Endpoints via HTTP (via proxy)
Possible PlugX and NPS Proxy Command and Control Domain Lookup
Possible Backdoor Mistic Command and Control Domain Lookup
Suspicious Weaver Ant In-Memory Web Shell Marker in Web Request (via webserver)
Malicious BlueNoroff C2 Communication via cur1-agent User-Agent (via proxy)
Possible GammaSteel C2 Using Spoofed iPhone User Agent
Suspicious PolarEdge Backdoor C2 URL with Module and putdata Command (via proxy)
Windows PowerShell: WebRequest User-Agent Modification in ScriptBlockText
Pivot detection · T1071.001 · 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.