CmdID

CmdID / Rules / Windows

Local Accounts Discovery

A Sigma rule for process creation on Windows, by Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community.

low 2 ATT&CK techniques 12 programs it names 13 everyday examples trip it

What it looks for

its detection, as SigmaHQ writes it
detection:
  filter_cmd:
    CommandLine|contains: ' rmdir '
  filter_net:
    CommandLine|contains:
      - '/domain'
      - '/add'
      - '/delete'
      - '/active'
      - '/expires'
      - '/passwordreq'
      - '/scriptpath'
      - '/times'
      - '/workstations'
  selection_cmd:
    CommandLine|contains|all:
      - ' /c'
      - 'dir '
      - '\Users\'
    Image|endswith: '\cmd.exe'
  selection_net:
    CommandLine|contains: 'user'
    Image|endswith:
      - '\net.exe'
      - '\net1.exe'
  selection_other_cmdkey:
    CommandLine|contains: ' /l'
    Image|endswith: '\cmdkey.exe'
  selection_other_img:
    - Image|endswith:
        - '\whoami.exe'
        - '\quser.exe'
        - '\qwinsta.exe'
    - OriginalFileName:
        - 'whoami.exe'
        - 'quser.exe'
        - 'qwinsta.exe'
  selection_other_wmi:
    CommandLine|contains|all:
      - 'useraccount'
      - 'get'
    Image|endswith: '\wmic.exe'
  condition: (selection_cmd and not filter_cmd) or (selection_net and not filter_net) or 1 of selection_other_*

The rule’s detection, its selections and fields in order of name. The whole rule, with its references and false positives, is on SigmaHQ, by Timur Zinniatullin, Daniil Yugoslavskiy, oscd.community, under the Detection Rule License 1.1. CmdID evaluates it on a command line alone: a test on what a command line cannot show, such as the parent process or the user, is not met.

Command lines that trip it

everyday examples from tldr-pages, CC BY 4.0, each read by CmdID

List all user credentials on the page for cmdkey.exe

cmdkey /listIdentify

Make sure an SMB share is available in the current console on the page for net

net use \\smb_shared_folder /USER:usernameIdentify

To display a list of all user accounts for the local computer, run the following command on the page for net user

net userIdentify

To display information about the user account TommyH, run the following command on the page for net user

net user tommyhIdentify

To set the sign-in time from 8 AM to 5 PM for the username MikeD using 24-hour notation, run the following command on the page for net user

net user miked /time:M-F,08:00-17:00Identify

To set the sign-in time from 8 AM to 5 PM for MikeD using 12-hour notation, run the following command on the page for net user

net user miked /time:M-F,8AM-5PMIdentify

To specify sign-in hours of 4 AM to 12 PM on Monday, 12 PM to 8 PM on Tuesday, and 8 AM to 5 PM Wednesday through Friday for username AnibalS, run the following command on the page for net user

net user anibals /time:M,4AM-12PM;T,12PM-8PM;W-F,8AM-5PMIdentify

To display the domain and user name of the person who is currently logged on to this computer, type on the page for whoami

whoamiIdentify

To display all of the information in the current access token, type on the page for whoami

whoami /allIdentify

Display the groups that the current user is a member of on the page for whoami

whoami /groupsIdentify

Display the privileges of the current user on the page for whoami

whoami /privIdentify

Display the user principal name (UPN) of the current user on the page for whoami

whoami /upnIdentify

And 1 more example on CmdID’s program pages.

The commands LOLBAS or GTFOBins documents for cmdkey.exe trip it too: each is on its program’s page, read by CmdID.

Programs and files it names

their pages here

ATT&CK

the techniques it is tagged with
T1033System Owner/User Discovery
T1087.001Account Discovery: Local Account