Local System Accounts Discovery - MacOs
A Sigma rule for process creation on macOS, by Alejandro Ortuno, oscd.community.
low 1 ATT&CK technique 12 programs it names 28 everyday examples trip it
What it looks for
detection:
selection_dscacheutil:
CommandLine|contains|all:
- '-q'
- 'user'
Image|endswith: '/dscacheutil'
selection_dscl:
CommandLine|contains|all:
- 'list'
- '/users'
Image|endswith: '/dscl'
selection_home_dir_listing:
CommandLine|endswith:
- '/Users'
- '/Users'''
- '/Users"'
Image|endswith: '/ls'
selection_id:
Image|endswith: '/id'
selection_logged_in_users:
Image|endswith:
- '/who'
- '/w'
- '/users'
- '/last'
selection_loginwindow_prefs:
CommandLine|contains: 'com.apple.loginwindow'
Image|endswith:
- '/defaults'
- '/plutil'
selection_lsof:
CommandLine|contains: '-u'
Image|endswith: '/lsof'
selection_passwd_sudo:
CommandLine|contains:
- '/etc/passwd'
- '/etc/sudoers'
Image|endswith:
- '/cat'
- '/awk'
- '/grep'
selection_root:
CommandLine|contains: '''*:0:'''
condition: 1 of selection*
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 Alejandro Ortuno, 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
View last login information (e.g., username, terminal, boot time, kernel) of all users as read from /var/log/wtmp on the page for last
lastIdentifyDisplay current user's ID (UID), group ID (GID), and groups to which they belong on the page for id
idIdentifyDisplay an arbitrary user's ID (UID), group ID (GID), and groups to which they belong on the page for id
id usernameIdentifyAnd 16 more examples on CmdID’s program pages.
The commands documented for chown, last, lastb, setfacl, sg trip it too: each is on its program’s page, read by CmdID.