Detect System Owner/User Discovery in Sumo Logic CSE
Adversaries may attempt to identify the primary user, currently logged in user, set of users that commonly uses a system, or whether a user is actively using the system. They may do this by retrieving account usernames via built-in OS utilities such as whoami, query user, qwinsta, w, who, and id, or by querying environment variables, WMI, and Active Directory. The information is used during automated discovery to shape follow-on behaviors — determining whether to fully deploy a payload, escalate privileges, or target a specific high-value user account.
MITRE ATT&CK
- Tactic
- Discovery
- Technique
- T1033 System Owner/User Discovery
- Canonical reference
- https://attack.mitre.org/techniques/T1033/
Sumo Detection Query
(_sourceCategory="windows/sysmon" OR _sourceCategory="windows/security" OR _sourceCategory="os/windows")
| where EventID = "1" or EventID = "4688"
| where (
(toLowerCase(Image) matches "*\\whoami.exe" and (toLowerCase(CommandLine) matches "*/all*" or toLowerCase(CommandLine) matches "*/groups*" or toLowerCase(CommandLine) matches "*/priv*" or toLowerCase(CommandLine) matches "*/fo*"))
or toLowerCase(Image) matches "*\\query.exe" or toLowerCase(Image) matches "*\\qwinsta.exe" or toLowerCase(Image) matches "*\\quser.exe"
or (toLowerCase(Image) matches "*\\wmic.exe" and (toLowerCase(CommandLine) matches "*useraccount*"))
or (toLowerCase(Image) matches "*\\net.exe" and (toLowerCase(CommandLine) matches "*user /domain*" or toLowerCase(CommandLine) matches "*localgroup administrators*" or toLowerCase(CommandLine) matches "*group /domain*"))
or (toLowerCase(Image) matches "*\\net1.exe" and (toLowerCase(CommandLine) matches "*user /domain*" or toLowerCase(CommandLine) matches "*localgroup administrators*"))
or ((toLowerCase(Image) matches "*\\powershell.exe" or toLowerCase(Image) matches "*\\pwsh.exe") and (toLowerCase(CommandLine) matches "*get-localuser*" or toLowerCase(CommandLine) matches "*get-aduser*" or toLowerCase(CommandLine) matches "*win32_useraccount*" or toLowerCase(CommandLine) matches "*windowsidentity*" or toLowerCase(CommandLine) matches "*whoami*"))
)
| if(toLowerCase(ParentImage) matches "*(cmd.exe|powershell.exe|pwsh.exe|wscript.exe|cscript.exe|mshta.exe|rundll32.exe|regsvr32.exe|schtasks.exe|msbuild.exe|installutil.exe)", 1, 0) as suspicious_parent
| if(toLowerCase(CommandLine) matches "*(/all|/groups|/priv|/fo|useraccount|get-localuser|get-aduser|windowsidentity|user /domain|localgroup administrators)*", 1, 0) as enriched_flags
| if(toLowerCase(User) matches "*(system|administrator|admin)*", 1, 0) as high_priv
| suspicious_parent + enriched_flags + high_priv as RiskScore
| where RiskScore >= 1
| fields _messageTime, Computer, User, Image, CommandLine, ParentImage, ParentCommandLine, suspicious_parent, enriched_flags, high_priv, RiskScore
| sort by RiskScore desc, _messageTime desc Detects T1033 System Owner/User Discovery in Sumo Logic by searching Windows Sysmon (Event ID 1) and Security (Event ID 4688) process creation logs for execution of user discovery commands including whoami with enumeration flags, query/qwinsta/quser, wmic useraccount, net user /domain, and PowerShell user enumeration cmdlets. Risk score computed from suspicious parent process, enriched flags, and high-privilege context.
Data Sources
Required Tables
False Positives & Tuning
- Windows administration scripts that use whoami /all to verify token privileges before applying group policy or configuring services, particularly during system initialization
- Privileged Access Workstation (PAW) monitoring tools that enumerate local administrators via Get-LocalUser or net localgroup administrators for access validation
- Threat hunting or red team exercises conducted in production environments where security teams execute discovery commands from PowerShell or cmd.exe to simulate adversary behavior
Other platforms for T1033
Testing Methodology
Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Whoami Full Enumeration
Expected signal: Sysmon Event ID 1: Process Create with Image=C:\Windows\System32\whoami.exe, CommandLine='whoami /all', ParentImage=cmd.exe or calling shell. Security Event ID 4688 if command line auditing is enabled. No network events expected.
- Test 2Query Active User Sessions
Expected signal: Sysmon Event ID 1: Process Create with Image=C:\Windows\System32\query.exe, CommandLine='query user'. Alternatively may appear as quser.exe. Security Event ID 4688 with command line auditing enabled.
- Test 3WMI User Account Enumeration
Expected signal: Sysmon Event ID 1: Process Create with Image=C:\Windows\System32\wbem\wmic.exe, CommandLine containing 'useraccount get'. No network events if targeting local system. Security Event ID 4688 with full command line if auditing is enabled.
- Test 4Linux Multi-Command User Discovery
Expected signal: Linux auditd: SYSCALL records for execve of /usr/bin/whoami, /usr/bin/id, /usr/bin/w, /usr/bin/who, /usr/bin/last, /bin/cat with respective arguments. Syslog entries if auditd is configured to log to syslog. On systems with Sysmon for Linux: EventType=ProcessCreate for each command.
- Test 5PowerShell Active Directory User Enumeration
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Get-WmiObject' and 'Win32_UserAccount'. PowerShell ScriptBlock Logging Event ID 4104 in Microsoft-Windows-PowerShell/Operational log with full script content. No AD network queries for local account enumeration.
References (10)
- https://attack.mitre.org/techniques/T1033/
- https://attack.mitre.org/tactics/TA0007/
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceprocessevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1033/T1033.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_whoami_execution.yml
- https://www.secureworks.com/research/karagany-backdoor
- https://blog.talosintelligence.com/2020/04/poetrat-covid-19-lures.html
- https://www.cybereason.com/blog/research/dropping-anchor-from-a-trickbot-infection-to-the-discovery-of-the-anchor-malware
- https://securelist.com/shadowpad-in-corporate-networks/81432/
- https://us-cert.cisa.gov/ncas/alerts/aa20-239a
Unlock Pro Content
Get the full detection package for T1033 including response playbook, investigation guide, and atomic red team tests.