Logged-on user identity queried by a built-in enumeration tool
AN0254 describes an adversary running the shipped tools that answer "who am I and who else is on this box" — the analytic names `whoami`, `query user` and `net user` — so each leg here anchors on one of those and on the API-level equivalents that avoid the executables. What MITRE says separates reconnaissance from routine use lives entirely in its tuning knobs: ParentProcessContext (enumeration from a non-interactive shell or service), UserContext (a service account issuing the command) and TimeWindow (grouping the query with lateral movement that follows). Sigma models no timeframe and no per-user baseline, so none of the three is encoded and the rule is left matching the single-event precursor, which is why the level sits near the bottom of the scale rather than in the middle. Two limits worth stating: the `net user` leg overlaps local account enumeration and will fire on that as well, and AN0254's other log source — the PowerShell 4103/4104 channel — is not used, so a cmdlet or `whoami` typed into a session that is already running creates no process and is invisible here. This is Sysmon EventID 1 telemetry; confirm process creation is not filtered out of the running Sysmon config before reading an empty result as quiet rather than blind. Three of the five legs test `CommandLine`, so if the `process_creation` index is fed from Security 4688 instead they need the separate *Include command line in process creation events* policy, which is off in a default install and in the MS/CIS baselines; without it the `whoami` and `quser` legs still fire and the rule looks healthy while three of five are silently dead. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0093, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 4 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
Sentinel · KQL
Run this as a search.
DeviceProcessEvents| where (FolderPath endswith "\\whoami.exe" or (FolderPath endswith "\\quser.exe" or FolderPath endswith "\\qwinsta.exe") or (FolderPath endswith "\\query.exe" and (ProcessCommandLine contains " user" or ProcessCommandLine contains " session")) or ((FolderPath endswith "\\net.exe" or FolderPath endswith "\\net1.exe") and ProcessCommandLine contains " user") or (ProcessCommandLine contains "WindowsIdentity]::GetCurrent" or ProcessCommandLine contains "Environment]::UserName" or ProcessCommandLine contains "$env:USERNAME" or ProcessCommandLine contains "Win32_LoggedOnUser"))
Splunk · SPL
Run this as a search.
index=* (Image="*\\whoami.exe" OR (Image="*\\quser.exe" OR Image="*\\qwinsta.exe") OR (Image="*\\query.exe" AND (CommandLine="* user*" OR CommandLine="* session*")) OR ((Image="*\\net.exe" OR Image="*\\net1.exe") AND CommandLine="* user*") OR (CommandLine="*WindowsIdentity]::GetCurrent*" OR CommandLine="*Environment]::UserName*" OR CommandLine="*$env:USERNAME*" OR CommandLine="*Win32_LoggedOnUser*"))Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE (TO_LOWER(process.executable) LIKE "*\\\\whoami.exe" OR (TO_LOWER(process.executable) LIKE "*\\\\quser.exe" OR TO_LOWER(process.executable) LIKE "*\\\\qwinsta.exe") OR (TO_LOWER(process.executable) LIKE "*\\\\query.exe" AND (TO_LOWER(process.command_line) LIKE "* user*" OR TO_LOWER(process.command_line) LIKE "* session*")) OR ((TO_LOWER(process.executable) LIKE "*\\\\net.exe" OR TO_LOWER(process.executable) LIKE "*\\\\net1.exe") AND TO_LOWER(process.command_line) LIKE "* user*") OR (TO_LOWER(process.command_line) LIKE "*windowsidentity]::getcurrent*" OR TO_LOWER(process.command_line) LIKE "*environment]::username*" OR TO_LOWER(process.command_line) LIKE "*$env:username*" OR TO_LOWER(process.command_line) LIKE "*win32_loggedonuser*"))
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,windows,process_creation,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <!-- 5 rules: the Sigma condition ORs across different fields, which one rule cannot express. Any one matching is a hit. --> <rule id="100000" level="5"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)\\whoami\.exe$</field> <description>Logged-on user identity queried by a built-in enumeration tool (1/5)</description> <mitre> <id>T1033</id> </mitre> </rule> <rule id="100001" level="5"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)(\\quser\.exe$|\\qwinsta\.exe$)</field> <description>Logged-on user identity queried by a built-in enumeration tool (2/5)</description> <mitre> <id>T1033</id> </mitre> </rule> <rule id="100002" level="5"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)\\query\.exe$</field> <field name="CommandLine" type="pcre2">(?i)( user| session)</field> <description>Logged-on user identity queried by a built-in enumeration tool (3/5)</description> <mitre> <id>T1033</id> </mitre> </rule> <rule id="100003" level="5"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)(\\net\.exe$|\\net1\.exe$)</field> <field name="CommandLine" type="pcre2">(?i) user</field> <description>Logged-on user identity queried by a built-in enumeration tool (4/5)</description> <mitre> <id>T1033</id> </mitre> </rule> <rule id="100004" level="5"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="CommandLine" type="pcre2">(?i)(WindowsIdentity\]::GetCurrent|Environment\]::UserName|\$env:USERNAME|Win32_LoggedOnUser)</field> <description>Logged-on user identity queried by a built-in enumeration tool (5/5)</description> <mitre> <id>T1033</id> </mitre> </rule></group>
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
Log in to join the discussion.
No comments yet. Someone who deploys this will have something to say about it.