Windows whoami.exe Execution With /FO CSV or Output Redirection
Detects whoami.exe runs that request CSV output or indicate output redirection for saved results.
- Product
- windows
- Category
- process_creation
- Author
- Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
- Published
- 2023-02-28
- Updated
- 2026-07-30
ATT&CK techniques
DiscoveryRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags process creation events where whoami.exe is executed with the /FO CSV option to format output as CSV, or where command-line patterns indicate exporting output to a file (including wildcard-style redirection such as whoami*>). Attackers commonly use whoami to enumerate the current user context before further actions, and exporting results can support staging or later collection. The detection relies on Windows process creation telemetry, specifically Image and OriginalFileName fields and CommandLine substring matches for the relevant flags and redirection patterns.
Reporting behind it
- brica.dehttps://brica.de/alerts/alert/public/1247926/agent-tesla-keylogger-delivered-inside-a-power-iso-daa-archive/
- app.any.runhttps://app.any.run/tasks/7eaba74e-c1ea-400f-9c17-5e30eee89906/
- youtube.comhttps://www.youtube.com/watch?v=DsJ9ByX84o4&t=6s
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_whoami_output.yml
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: Windows whoami.exe Execution With /FO CSV or Output Redirection
id: 6dc0d6ee-3ff0-41f6-b690-9e8fa54d84d6
status: test
description: This rule flags process creation events where whoami.exe is executed with the /FO CSV option to format output as CSV, or where command-line patterns indicate exporting output to a file (including wildcard-style redirection such as whoami*>). Attackers commonly use whoami to enumerate the current user context before further actions, and exporting results can support staging or later collection. The detection relies on Windows process creation telemetry, specifically Image and OriginalFileName fields and CommandLine substring matches for the relevant flags and redirection patterns.
references:
- https://brica.de/alerts/alert/public/1247926/agent-tesla-keylogger-delivered-inside-a-power-iso-daa-archive/
- https://app.any.run/tasks/7eaba74e-c1ea-400f-9c17-5e30eee89906/
- https://www.youtube.com/watch?v=DsJ9ByX84o4&t=6s
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_whoami_output.yml
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems), Huntrule Team
date: 2023-02-28
modified: 2023-12-04
tags:
- attack.discovery
- attack.t1033
- car.2016-03-001
logsource:
category: process_creation
product: windows
detection:
selection_main_img:
- Image|endswith: \whoami.exe
- OriginalFileName: whoami.exe
selection_main_cli:
CommandLine|contains:
- " /FO CSV"
- " -FO CSV"
selection_special:
CommandLine|contains: whoami*>
condition: all of selection_main_* or selection_special
falsepositives:
- Unknown
level: medium
license: DRL-1.1
related:
- id: c30fb093-1109-4dc8-88a8-b30d11c95a5d
type: derived