Name:Linux Possible SSH Bypass for Non-User Account id:89a99108-8b70-4d05-ad3e-25a2e6a87d6f version:1 date:None author:Raven Tait, Splunk status:production type:Anomaly Description:The following analytic detects a failed SSH password authentication followed by a successful password authentication
for the same common non-user Linux account, source address, and endpoint within five seconds. This may indicate abuse
of an authentication bypass or another weakness that allowed access to an account whose shadow entry is typically
locked or passwordless. The account list is a cross-distribution heuristic; verify the account's shadow status for each image. Data_source:
-Linux Messages Syslog
search:`linux_syslog` ("Failed password for" OR "Accepted password for")
| rex field=_raw "^(?<event_timestamp>\\w{3}\\s+\\d+\\s+\\d{2}:\\d{2}:\\d{2})\\s+(?<dest>\\S+)\\s+(?:\\S+\\s+)?sshd(?:-session)?(?:\\.pam)?\\[\\d+\\]:\\s+(?<auth_result>Failed|Accepted) password for (?:invalid user )?(?<user>\\S+) from (?<src_ip>\\S+) port (?<src_port>\\d+) ssh2"
how_to_implement:To successfully implement this search, you need to ingest Linux syslog logs. These logs should be collected with the Splunk Add-on for Unix and Linux (https://splunkbase.splunk.com/app/833). known_false_positives:A user may mistype a password before a legitimate login. Common account names may be unlocked or configured with a
password on a particular image. Validate the account's shadow state and expected SSH access before escalating. References: -https://attack.mitre.org/techniques/T1078/003/ -https://attack.mitre.org/techniques/T1021/004/ -https://sshhole.com/ drilldown_searches: name:'View the detection results for - "$dest$"' search:'%original_detection_search% | search dest = "$dest$"' earliest_offset:'$info_min_time$' latest_offset:'$info_max_time$' name:'View risk events for the last 7 days for - "$dest$"' search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`' earliest_offset:'7d' latest_offset:'0' analytic_story:['Linux Privilege Escalation', 'SSHHole']