PowerShell Script Block WinAPI Calls Indicative of Injection or Token Abuse (Windows)

Detects PowerShell ScriptBlocks containing WinAPI function-name combinations consistent with injection and token manipulation.

FreeReviewedSigma · High · v2
Product
windows
Category
ps_script
Author
Nasreddine Bencherchali (Nextron Systems), Nikita Nazarov, oscd.community (SigmaHQ), DRL 1.1
Published
2020-10-06
Updated
2026-07-31

ATT&CK techniques

Execution → Defense Evasion
  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Persistence

  5. Priv Esc

  6. Cred Access

  7. Discovery

  8. Lateral Movement

  9. Collection

  10. C2

  11. Exfiltration

  12. Impact

What it detects

This rule flags PowerShell script block content that references multiple WinAPI functions associated with memory manipulation, remote thread creation, or token handling. Such patterns can reflect attacker attempts to inject code, steal privileges, or operate on other processes while evading traditional file-based inspection. It relies on Windows PowerShell Script Block Logging telemetry containing the matched WinAPI function names within the script block text.

Related detections9 linkedT1059.001 — drag to rearrange
Suspicious PowerShell Reflective Assembly Load With GZip Decompression (via process_creation)
PowerShell Reflective Shellcode Loader via Dynamic API Delegates (via ps_script)
Obfuscated XE Group Reflective Loader via PowerShell Spawned by IIS Worker Process (via process_creation)
Suspicious PowerShell Reflective Assembly Load Invoking VAI Method (via process_creation)
PowerShell Scripts Calling WinAPI DLLs on Windows
Windows PowerShell ScriptBlock WinAPI Function Calls
Windows PowerShell: Base64 Encoded Reflective .NET Assembly Load
Suspicious Script Host Spawning Hidden PowerShell (via process_creation)
Suspicious PowerShell Invoke-Expression with Replace Obfuscation
PowerShell Script Block WinAPI Calls Indicative of Injection or Token Abuse (Windows)
Pivot detection · T1059.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.