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
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
List all user credentials on the page for cmdkey.exe
cmdkey /listIdentifyMake sure an SMB share is available in the current console on the page for net
net use \\smb_shared_folder /USER:usernameIdentifyTo display a list of all user accounts for the local computer, run the following command on the page for net user
net userIdentifyTo display information about the user account TommyH, run the following command on the page for net user
net user tommyhIdentifyTo 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:00IdentifyTo 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-5PMIdentifyTo 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-5PMIdentifyTo display the domain and user name of the person who is currently logged on to this computer, type on the page for whoami
whoamiIdentifyTo display all of the information in the current access token, type on the page for whoami
whoami /allIdentifyDisplay the groups that the current user is a member of on the page for whoami
whoami /groupsIdentifyAnd 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.