T1033 Google Chronicle · YARA-L

Detect System Owner/User Discovery in Google Chronicle

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/

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule T1033_System_Owner_User_Discovery {
  meta:
    author = "Argus Detection Engineering"
    description = "Detects T1033 System Owner/User Discovery via execution of user enumeration utilities with suspicious parent process or elevated privilege context"
    mitre_attack_tactic = "Discovery"
    mitre_attack_technique = "T1033"
    mitre_attack_url = "https://attack.mitre.org/techniques/T1033/"
    severity = "MEDIUM"
    confidence = "HIGH"

  events:
    $e.metadata.event_type = "PROCESS_LAUNCH"
    (
      (
        re.regex($e.target.process.file.full_path, `(?i).*\\whoami\.exe$`) and
        re.regex($e.target.process.command_line, `(?i).*(/all|/groups|/priv|/fo).*`)
      ) or
      re.regex($e.target.process.file.full_path, `(?i).*\\(query|qwinsta|quser)\.exe$`) or
      (
        re.regex($e.target.process.file.full_path, `(?i).*\\wmic\.exe$`) and
        re.regex($e.target.process.command_line, `(?i).*(useraccount).*`)
      ) or
      (
        re.regex($e.target.process.file.full_path, `(?i).*\\net1?\.exe$`) and
        re.regex($e.target.process.command_line, `(?i).*(user\s+/domain|localgroup\s+administrators|group\s+/domain).*`)
      ) or
      (
        re.regex($e.target.process.file.full_path, `(?i).*\\(powershell|pwsh)\.exe$`) and
        re.regex($e.target.process.command_line, `(?i).*(Get-LocalUser|Get-ADUser|Win32_UserAccount|WindowsIdentity|whoami).*`)
      )
    )
    (
      re.regex($e.principal.process.file.full_path, `(?i).*\\(cmd|powershell|pwsh|wscript|cscript|mshta|rundll32|regsvr32|schtasks|msbuild|installutil)\.exe$`) or
      re.regex($e.principal.user.userid, `(?i).*(system|administrator|admin).*`) or
      re.regex($e.target.process.command_line, `(?i).*(/all|/groups|/priv|/fo|useraccount|Get-LocalUser|Get-ADUser|WindowsIdentity|user\s*/domain|localgroup administrators).*`)
    )

  condition:
    $e
}
medium severity high confidence

Chronicle YARA-L 2.0 rule detecting T1033 System Owner/User Discovery. Matches PROCESS_LAUNCH UDM events where a user discovery binary (whoami, query, qwinsta, quser, wmic, net, powershell) is executed with suspicious flags or from a suspicious parent process. Correlates principal process (parent) context with target process (child) command line to reduce false positives from bare whoami invocations.

Data Sources

Chronicle UDM with Windows Event ForwardingChronicle with CrowdStrike Falcon telemetryChronicle with Carbon Black EDRChronicle with Microsoft Defender for Endpoint via SIEM connector

Required Tables

UDM events (PROCESS_LAUNCH)

False Positives & Tuning

  • Legitimate system health check scripts invoked from cmd.exe or PowerShell that use whoami or Get-LocalUser to validate service account permissions during automated maintenance windows
  • Enterprise monitoring agents such as Splunk Universal Forwarder, Elastic Agent, or SolarWinds that run periodic user context checks using wmic or PowerShell cmdlets
  • Developer workstations where build automation tools (MSBuild, InstallUtil) spawn PowerShell to query the current user context for path resolution or permission checks during software compilation
Download portable Sigma rule (.yml)

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Unlock Pro Content

Get the full detection package for T1033 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections