Detection rules › Sigma

Local System Accounts Discovery - Linux

Status
test
Severity
low
Log source
product linux, category process_creation
Author
Alejandro Ortuno, oscd.community, CheraghiMilad
Source
github.com/SigmaHQ/sigma

Detects enumeration of local system accounts. This information can help adversaries determine which local accounts exist on a system to aid in follow-on behavior.

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Local System Accounts Discovery - Linux
id: b45e3d6f-42c6-47d8-a478-df6bd6cf534c
status: test
description: Detects enumeration of local system accounts. This information can help adversaries determine which local accounts exist on a system to aid in follow-on behavior.
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1087.001/T1087.001.md
    - https://my.f5.com/manage/s/article/K589
    - https://man.freebsd.org/cgi/man.cgi?pwd_mkdb
author: Alejandro Ortuno, oscd.community, CheraghiMilad
date: 2020-10-08
modified: 2024-12-10
tags:
    - attack.discovery
    - attack.t1087.001
logsource:
    category: process_creation
    product: linux
detection:
    selection_1:
        Image|endswith: '/lastlog'
    selection_2:
        CommandLine|contains: '''x:0:'''
    selection_3:
        Image|endswith:
            - '/cat'
            - '/ed'
            - '/head'
            - '/more'
            - '/nano'
            - '/tail'
            - '/vi'
            - '/vim'
            - '/less'
            - '/emacs'
            - '/sqlite3'
            - '/makemap'
        CommandLine|contains:
            - '/etc/passwd'
            - '/etc/shadow'
            - '/etc/sudoers'
            - '/etc/spwd.db'
            - '/etc/pwd.db'
            - '/etc/master.passwd'
    selection_4:
        Image|endswith: '/id'
    selection_5:
        Image|endswith: '/lsof'
        CommandLine|contains: '-u'
    condition: 1 of selection*
falsepositives:
    - Legitimate administration activities
level: low

Stages and Predicates

Stage 0: condition

1 of selection*

Stage 1: selection_1

selection_1:
    Image|endswith: '/lastlog'

Stage 2: selection_2

selection_2:
    CommandLine|contains: '''x:0:'''

Stage 3: selection_3

selection_3:
    Image|endswith:
        - '/cat'
        - '/ed'
        - '/head'
        - '/more'
        - '/nano'
        - '/tail'
        - '/vi'
        - '/vim'
        - '/less'
        - '/emacs'
        - '/sqlite3'
        - '/makemap'
    CommandLine|contains:
        - '/etc/passwd'
        - '/etc/shadow'
        - '/etc/sudoers'
        - '/etc/spwd.db'
        - '/etc/pwd.db'
        - '/etc/master.passwd'

Stage 4: selection_4

selection_4:
    Image|endswith: '/id'

Stage 5: selection_5

selection_5:
    Image|endswith: '/lsof'
    CommandLine|contains: '-u'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • 'x:0:'
  • -u
  • /etc/master.passwd
  • /etc/passwd
  • /etc/pwd.db
  • /etc/shadow
  • /etc/spwd.db
  • /etc/sudoers
Imageends_with
  • /cat
  • /ed
  • /emacs
  • /head
  • /id
  • /lastlog
  • /less
  • /lsof
  • /makemap
  • /more
  • /nano
  • /sqlite3
  • /tail
  • /vi
  • /vim