Potential SSH Brute Force Detected on Privileged Account

Identifies multiple consecutive login failures targeting a root user account from the same source address and within a short time interval. Adversaries will often brute force login attempts on privileged accounts with a common or known password, in an attempt to gain privileged access to systems.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2022/09/14"
  3deprecation_date = "2023/06/22"
  4integration = ["system"]
  5maturity = "deprecated"
  6min_stack_comments = "New fields added: required_fields, related_integrations, setup"
  7min_stack_version = "8.3.0"
  8updated_date = "2023/06/22"
  9
 10[rule]
 11author = ["Elastic"]
 12description = """
 13Identifies multiple consecutive login failures targeting a root user account from the same source address and within a
 14short time interval. Adversaries will often brute force login attempts on privileged accounts with a common or known
 15password, in an attempt to gain privileged access to systems.
 16"""
 17from = "now-9m"
 18index = ["auditbeat-*", "logs-system.auth-*"]
 19language = "eql"
 20license = "Elastic License v2"
 21name = "Potential SSH Brute Force Detected on Privileged Account"
 22note = """## Triage and analysis
 23
 24### Investigating Potential SSH Brute Force Attack on Privileged Account
 25
 26The rule identifies consecutive SSH login failures targeting a privileged (root) account from the same source IP address to the same target host indicating brute force login attempts.
 27
 28#### Possible investigation steps
 29
 30- Investigate the login failure on privileged account(s).
 31- Investigate the source IP address of the failed ssh login attempt(s).
 32- Investigate other alerts associated with the user/host during the past 48 hours.
 33- Identify the source and the target computer and their roles in the IT environment.
 34
 35### False positive analysis
 36
 37- Authentication misconfiguration or obsolete credentials.
 38- Service account password expired.
 39- Infrastructure or availability issue.
 40
 41### Response and remediation
 42
 43- Initiate the incident response process based on the outcome of the triage.
 44- Isolate the involved hosts to prevent further post-compromise behavior.
 45- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
 46- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 47- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 48- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
 49
 50"""
 51risk_score = 73
 52rule_id = "a5f0d057-d540-44f5-924d-c6a2ae92f045"
 53severity = "high"
 54tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Lateral Movement", "Tactic: Credential Access"]
 55type = "eql"
 56
 57query = '''
 58sequence by host.id, source.ip with maxspan=10s
 59  [authentication where host.os.type == "linux" and event.action  in ("ssh_login", "user_login") and
 60   event.outcome == "failure" and source.ip != null and source.ip != "0.0.0.0" and
 61   source.ip != "::" and  user.name : ("*root*" , "*admin*")] with runs=3
 62'''
 63
 64
 65[[rule.threat]]
 66framework = "MITRE ATT&CK"
 67[[rule.threat.technique]]
 68id = "T1110"
 69name = "Brute Force"
 70reference = "https://attack.mitre.org/techniques/T1110/"
 71[[rule.threat.technique.subtechnique]]
 72id = "T1110.001"
 73name = "Password Guessing"
 74reference = "https://attack.mitre.org/techniques/T1110/001/"
 75
 76[[rule.threat.technique.subtechnique]]
 77id = "T1110.003"
 78name = "Password Spraying"
 79reference = "https://attack.mitre.org/techniques/T1110/003/"
 80
 81
 82
 83[rule.threat.tactic]
 84id = "TA0006"
 85name = "Credential Access"
 86reference = "https://attack.mitre.org/tactics/TA0006/"
 87[[rule.threat]]
 88framework = "MITRE ATT&CK"
 89[[rule.threat.technique]]
 90id = "T1021"
 91name = "Remote Services"
 92reference = "https://attack.mitre.org/techniques/T1021/"
 93[[rule.threat.technique.subtechnique]]
 94id = "T1021.004"
 95name = "SSH"
 96reference = "https://attack.mitre.org/techniques/T1021/004/"
 97
 98
 99
100[rule.threat.tactic]
101id = "TA0008"
102name = "Lateral Movement"
103reference = "https://attack.mitre.org/tactics/TA0008/"

Triage and analysis

Investigating Potential SSH Brute Force Attack on Privileged Account

The rule identifies consecutive SSH login failures targeting a privileged (root) account from the same source IP address to the same target host indicating brute force login attempts.

Possible investigation steps

  • Investigate the login failure on privileged account(s).
  • Investigate the source IP address of the failed ssh login attempt(s).
  • Investigate other alerts associated with the user/host during the past 48 hours.
  • Identify the source and the target computer and their roles in the IT environment.

False positive analysis

  • Authentication misconfiguration or obsolete credentials.
  • Service account password expired.
  • Infrastructure or availability issue.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved hosts to prevent further post-compromise behavior.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

Related rules

to-top