Detection rules › Splunk

Potential SSH with System User

Group by
_time, host
Source
github.com/anvilogic-forge/armory

NIX System users, typically 1…999 are users that do not map to actual “human” users, but are used as security identities for system daemons, in order to implement privilege separation and run system daemons with minimal privileges. This use case looks for attempts to ssh into and user account with a "Default" user id for most NIX distributions.

MITRE ATT&CK coverage

References

Telemetry coverage

Rule body

id: '8620.11045'
title: Potential SSH with System User
description: 'NIX System users, typically 1…999 are users that do not map to actual
  “human” users, but are used as security identities for system daemons, in order
  to implement privilege separation and run system daemons with minimal privileges.
  This use case looks for attempts to ssh into and user account with a "Default" user
  id for most NIX distributions. '
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_unix` type=USER_START | regex auid=^\d+|
  regex auid!="0|\d{4,}"| regex exe="(?i)ssh" | eval src_ip=addr, user=coalesce(acct,
  id, ID) | table _time, host, user src_ip, process_*, user `group_events(host, 1)`
  | lookup dnslookup clientip as src_ip OUTPUT clienthost as src_dns | iplocation
  prefix="src_" src_ip | rename src_Country as src_country '
techniques:
- privilege-escalation:valid accounts:default accounts
- defense-evasion:valid accounts:default accounts
- persistence:valid accounts:default accounts
technique_id:
- T1078.001
data_category:
- Linux audit logs
references:
- https://systemd.io/UIDS-GIDS/

Stages and Predicates

Stage 1: search

search source="*" source IN ("*auditd*", "Syslog:Linux-Sysmon/Operational") type="USER_START"

Stage 2: regex

regex match(auid, "^\d+")

Stage 3: regex

regex NOT match(auid, "0|\d{4,}")

Stage 4: regex

regex match(exe, "(?i)ssh")

Stage 5: eval

eval src_ip=addr, user=coalesce(...)

Stage 6: table

table _time, host, process_*, src_ip, user

Stage 7: bucket

bucket _time

Stage 8: stats

stats BY host, _time

Stage 9: lookup

lookup <lookup> clienthost, clientip, src_dns, src_ip
Lookup table
dnslookup
Key field
clientip as src_ip
Output columns
['clienthost', 'src_dns']

Stage 10: search

search prefix="src_"

Stage 11: rename

rename

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
auidregex_match"0, \d{4,}"excludes:auid

Indicators

These rows show field, operator, and value matches.

Search terms

These SPL tokens match against raw event text.

StageTerm
10iplocation
10src_ip