Suspicious Whoami Execution With Output Redirected to a File (via process_creation)

PremiumReviewedSigma · Medium · v1
Product
windows
Category
process_creation
Author
HuntRule
Published
2026-09-05
Updated
2026-09-05

ATT&CK techniques

Discovery
  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Execution

  5. Persistence

  6. Priv Esc

  7. Defense Evasion

  8. Cred Access

  9. Lateral Movement

  10. Collection

  11. C2

  12. Exfiltration

  13. Impact

What it detects

This rule detects whoami being run with its output redirected into a file, a reconnaissance-and-staging behavior used by loaders such as SocGholish to capture the current user and privilege context for the operator to review. Automated whoami-to-file collection is documented in the Red Canary Threat Detection Report as an early post-compromise step. Because interactive users rarely redirect whoami output to disk, this is a useful indicator of scripted hands-on activity.

Related detections9 linkedT1033 — drag to rearrange
Possible Logged-On Session Discovery via Quser or Qwinsta (via process_creation)
Suspicious Reconnaissance Spawned by Injected SearchProtocolHost via process_creation
Windows Process Creation: whoami.exe Executed With /all for Full Identity Enumeration
Linux Process Execution of esxcli Network Commands for ESXi Network Discovery
Linux Process Execution of esxcli VM Listing Commands
Linux ESXi esxcli VSAN Information Discovery via esxcli Command
Linux Process Creation: ESXi esxcli system discovery via system namespace
Linux ESXi esxcli Storage Information Discovery via esxcli storage commands
Windows whoami.exe Group Membership Reconnaissance via /groups Flag
Suspicious Whoami Execution With Output Redirected to a File (via process_creation)
Pivot detection · T1033 · 9 related

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