PowerShell In-Memory Shellcode Execution via Memory Allocation APIs (via ps_script)

PremiumReviewedSigma · Medium · v1
Product
windows
Category
ps_script
Author
HuntRule
Published
2026-07-03
Updated
2026-08-28

ATT&CK techniques

Priv Esc → Defense Evasion
  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Execution

  5. Persistence

  6. Cred Access

  7. Discovery

  8. Lateral Movement

  9. Collection

  10. C2

  11. Exfiltration

  12. Impact

What it detects

This rule detects a PowerShell script block that combines GlobalAlloc VirtualProtect and CreateThread calls to allocate executable memory and run shellcode, the in-memory loading behavior of the RokRAT search.dat loader read from the public directory. Adversaries leverage reflective shellcode execution to run their payload without touching disk as a file, making early detection critical for surfacing fileless code execution before RokRAT deploys.

Related detections9 linkedT1055 — drag to rearrange
Suspicious DllHost Spawned By MMC Without Arguments via PASTALOADER
Suspicious In-Memory .NET Assembly Load via PowerShell Base64 Payload (via process_creation)
Suspicious PowerShell Shellcode Loader via Function Pointer Delegate
Suspicious Named Pipe Created by Kazuar Backdoor for Interprocess Command Channel
Suspicious SmallTiger Backdoor DLL Load via Image Load
Suspicious svchost Execution With Anomalous Arguments via DeedRAT (via process_creation)
Suspicious Sang Loader Execution with Install or PassUAC Arguments
Suspicious GodRAT Shellcode Injection via Puppet Argument (via process_creation)
Suspicious Executable Execution From AppData Roaming msgui via Process Creation
PowerShell In-Memory Shellcode Execution via Memory Allocation APIs (via ps_script)
Pivot detection · T1055 · 9 related

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