Detection rules › Sigma

Local Accounts Discovery

Status
test
Severity
low
Log source
category process_creation, product windows
Author
Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community
Source
github.com/SigmaHQ/sigma

Local accounts, System Owner/User discovery using operating systems utilities

Known false positives

  • Legitimate administrator or user enumerates local users for legitimate reason

MITRE ATT&CK coverage

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Local Accounts Discovery
id: 502b42de-4306-40b4-9596-6f590c81f073
status: test
related:
    - id: e28a5a99-da44-436d-b7a0-2afc20a5f413 # Whoami Utility Execution
      type: obsolete
description: Local accounts, System Owner/User discovery using operating systems utilities
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1033/T1033.md
author: Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community
date: 2019-10-21
modified: 2025-10-20
tags:
    - attack.discovery
    - attack.t1033
    - attack.t1087.001
logsource:
    category: process_creation
    product: windows
detection:
    selection_other_img:
        - Image|endswith:
              - '\whoami.exe'
              - '\quser.exe'
              - '\qwinsta.exe'
        - OriginalFileName:
              - 'whoami.exe'
              - 'quser.exe'
              - 'qwinsta.exe'
    selection_other_wmi:
        Image|endswith: '\wmic.exe'
        CommandLine|contains|all:
            - 'useraccount'
            - 'get'
    selection_other_cmdkey:
        Image|endswith: '\cmdkey.exe'
        CommandLine|contains: ' /l'
    selection_cmd:
        Image|endswith: '\cmd.exe'
        CommandLine|contains|all:
            - ' /c'
            - 'dir '
            - '\Users\'
    filter_cmd:
        CommandLine|contains: ' rmdir ' # don't match on 'dir'   "C:\Windows\System32\cmd.exe" /q /c rmdir /s /q "C:\Users\XX\AppData\Local\Microsoft\OneDrive\19.232.1124.0005"
    selection_net:
        Image|endswith:
            - '\net.exe'
            - '\net1.exe'
        CommandLine|contains: 'user'
    filter_net:
        CommandLine|contains:
            - '/domain'       # local account discovery only
            - '/add'          # discovery only
            - '/delete'       # discovery only
            - '/active'       # discovery only
            - '/expires'      # discovery only
            - '/passwordreq'  # discovery only
            - '/scriptpath'   # discovery only
            - '/times'        # discovery only
            - '/workstations' # discovery only
    condition: (selection_cmd and not filter_cmd) or (selection_net and not filter_net) or 1 of selection_other_*
falsepositives:
    - Legitimate administrator or user enumerates local users for legitimate reason
level: low
simulation:
    - type: atomic-red-team
      name: WMI Reconnaissance Users
      technique: T1047
      atomic_guid: c107778c-dcf5-47c5-af2e-1d058a3df3ea
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_susp_local_system_owner_account_discovery/info.yml

Stages and Predicates

Stage 0: condition

(selection_cmd and not filter_cmd) or (selection_net and not filter_net) or 1 of selection_other_*

Stage 1: selection_cmd

selection_cmd:
    Image|endswith: '\cmd.exe'
    CommandLine|contains|all:
        - ' /c'
        - 'dir '
        - '\Users\'

Stage 2: not filter_cmd

filter_cmd:
    CommandLine|contains: ' rmdir '

Stage 3: selection_net

selection_net:
    Image|endswith:
        - '\net.exe'
        - '\net1.exe'
    CommandLine|contains: 'user'

Stage 4: not filter_net

filter_net:
    CommandLine|contains:
        - '/domain'
        - '/add'
        - '/delete'
        - '/active'
        - '/expires'
        - '/passwordreq'
        - '/scriptpath'
        - '/times'
        - '/workstations'

Stage 5: selection_other_img

selection_other_img:
    - Image|endswith:
          - '\whoami.exe'
          - '\quser.exe'
          - '\qwinsta.exe'
    - OriginalFileName:
          - 'whoami.exe'
          - 'quser.exe'
          - 'qwinsta.exe'

Stage 6: selection_other_wmi

selection_other_wmi:
    Image|endswith: '\wmic.exe'
    CommandLine|contains|all:
        - 'useraccount'
        - 'get'

Stage 7: selection_other_cmdkey

selection_other_cmdkey:
    Image|endswith: '\cmdkey.exe'
    CommandLine|contains: ' /l'

Exclusions

The rule actively suppresses these predicates.

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • /c corpus 2 (sigma 1, chronicle 1)
  • /l corpus 2 (sigma 1, chronicle 1)
  • \Users\
  • dir corpus 8 (sigma 5, splunk 2, chronicle 1)
  • get corpus 5 (sigma 3, splunk 1, chronicle 1)
  • user corpus 17 (sigma 11, splunk 4, chronicle 2)
  • useraccount corpus 4 (sigma 2, splunk 1, chronicle 1)
field:"CommandLine" kind:match
Imageends_with
  • \cmd.exe corpus 130 (sigma 130)
  • \cmdkey.exe corpus 3 (sigma 3)
  • \net.exe corpus 49 (sigma 49)
  • \net1.exe corpus 47 (sigma 47)
  • \quser.exe corpus 2 (sigma 2)
  • \qwinsta.exe corpus 2 (sigma 2)
  • \whoami.exe corpus 19 (sigma 19)
  • \wmic.exe corpus 62 (sigma 62)
field:"Image" kind:ends_with
OriginalFileNameeq
  • quser.exe corpus 3 (sigma 2, splunk 1)
  • qwinsta.exe corpus 2 (sigma 1, splunk 1)
  • whoami.exe corpus 9 (sigma 9)
field:"OriginalFileName" kind:eq