CmdID

CmdID / Rules / Linux

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

its detection, as SigmaHQ writes it
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

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

Display information about currently logged in users on the page for finger

fingerIdentify

Display information about a specific user on the page for finger

finger usernameIdentify

Display the user's login name, real name, terminal name, and other information on the page for finger

finger -sIdentify

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

List login information of a specific user on the page for last

last usernameIdentify

Specify how many of the last logins to show on the page for last

last --limit login_countIdentify

List last logged in users on the page for lastb

sudo lastbIdentify

List all last logged in users since a given time on the page for lastb

sudo lastb --since YYYY-MM-DDIdentify

List all last logged in users until a given time on the page for lastb

sudo lastb --until YYYY-MM-DDIdentify

Display current user's ID (UID), group ID (GID), and groups to which they belong on the page for id

Display the current user identity on the page for id

id --user --nameIdentify

Display the current user identity as a number on the page for id

id --userIdentify

And 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.

Programs and files it names

their pages here

ATT&CK

the techniques it is tagged with
T1087.001Account Discovery: Local Account