Local System Accounts Discovery Attempt - Linux
A Sigma rule for process creation on Linux, by Alejandro Ortuno, oscd.community, CheraghiMilad.
low 1 ATT&CK technique 21 programs it names 33 everyday examples trip it
What it looks for
detection:
filter_optional_landscape_sysinfo:
Image|endswith: '/who'
ParentCommandLine|contains: '/usr/bin/landscape-sysinfo'
selection_getent:
CommandLine|contains:
- ' passwd'
- ' shadow'
Image|endswith: '/getent'
selection_id:
Image|endswith: '/id'
selection_lastlog:
Image|endswith:
- '/lastlog'
- '/last'
- '/lastb'
selection_lsof:
CommandLine|contains: '-u'
Image|endswith: '/lsof'
selection_read_utilities:
CommandLine|contains:
- '/etc/passwd'
- '/etc/shadow'
- '/etc/sudoers'
- 'master.passwd'
- 'pwd.db'
Image|endswith:
- '/cat'
- '/ed'
- '/emacs'
- '/head'
- '/less'
- '/makemap'
- '/more'
- '/nano'
- '/sqlite3'
- '/tail'
- '/vi'
- '/vim'
selection_root_string:
CommandLine|contains: 'x:0:'
selection_who:
Image|endswith:
- '/finger'
- '/users'
- '/w'
- '/who'
selection_ypcat:
CommandLine|contains: 'passwd'
Image|endswith: '/ypcat'
condition: 1 of selection_* and not 1 of filter_optional_*
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, CheraghiMilad, 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
Display the user's login name, real name, terminal name, and other information on the page for finger
finger -sIdentifyView last login information (e.g., username, terminal, boot time, kernel) of all users as read from /var/log/wtmp on the page for last
lastIdentifyList all last logged in users since a given time on the page for lastb
sudo lastb --since YYYY-MM-DDIdentifyList all last logged in users until a given time on the page for lastb
sudo lastb --until YYYY-MM-DDIdentifyDisplay current user's ID (UID), group ID (GID), and groups to which they belong on the page for id
idIdentifyAnd 21 more examples on CmdID’s program pages.
The commands documented for chown, finger, getent, last, lastb, setfacl, sg trip it too: each is on its program’s page, read by CmdID.