Privileged Account Brute Force

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

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/08/29"
  3integration = ["system", "windows"]
  4maturity = "production"
  5updated_date = "2024/05/21"
  6
  7[transform]
  8[[transform.osquery]]
  9label = "Osquery - Retrieve DNS Cache"
 10query = "SELECT * FROM dns_cache"
 11
 12[[transform.osquery]]
 13label = "Osquery - Retrieve All Services"
 14query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"
 15
 16[[transform.osquery]]
 17label = "Osquery - Retrieve Services Running on User Accounts"
 18query = """
 19SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
 20NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
 21user_account == null)
 22"""
 23
 24[[transform.osquery]]
 25label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
 26query = """
 27SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
 28services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
 29authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
 30"""
 31
 32
 33[rule]
 34author = ["Elastic"]
 35description = """
 36Identifies multiple consecutive logon failures targeting an Admin account from the same source address and within a
 37short time interval. Adversaries will often brute force login attempts across multiple users with a common or known
 38password, in an attempt to gain access to accounts.
 39"""
 40from = "now-9m"
 41index = ["winlogbeat-*", "logs-system.security*", "logs-windows.forwarded*"]
 42language = "eql"
 43license = "Elastic License v2"
 44name = "Privileged Account Brute Force"
 45note = """## Triage and analysis
 46
 47### Investigating Privileged Account Brute Force
 48
 49Adversaries with no prior knowledge of legitimate credentials within the system or environment may guess passwords to attempt access to accounts. Without knowledge of the password for an account, an adversary may opt to guess the password using a repetitive or iterative mechanism systematically. More details can be found [here](https://attack.mitre.org/techniques/T1110/001/).
 50
 51This rule identifies potential password guessing/brute force activity from a single address against an account that contains the `admin` pattern on its name, which is likely a highly privileged account.
 52
 53> **Note**:
 54> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
 55
 56#### Possible investigation steps
 57
 58- Investigate the logon failure reason code and the targeted user name.
 59  - Prioritize the investigation if the account is critical or has administrative privileges over the domain.
 60- Investigate the source IP address of the failed Network Logon attempts.
 61  - Identify whether these attempts are coming from the internet or are internal.
 62- Investigate other alerts associated with the involved users and source host during the past 48 hours.
 63- Identify the source and the target computer and their roles in the IT environment.
 64- Check whether the involved credentials are used in automation or scheduled tasks.
 65- If this activity is suspicious, contact the account owner and confirm whether they are aware of it.
 66- Examine the source host for derived artifacts that indicate compromise:
 67  - Observe and collect information about the following activities in the alert source host:
 68    - Attempts to contact external domains and addresses.
 69      - Examine the DNS cache for suspicious or anomalous entries.
 70        - $osquery_0
 71    - Examine the host services for suspicious or anomalous entries.
 72      - $osquery_1
 73      - $osquery_2
 74      - $osquery_3
 75- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the host which is the source of this activity.
 76
 77### False positive analysis
 78
 79- Authentication misconfiguration or obsolete credentials.
 80- Service account password expired.
 81- Domain trust relationship issues.
 82- Infrastructure or availability issues.
 83
 84### Response and remediation
 85
 86- Initiate the incident response process based on the outcome of the triage.
 87- Isolate the source host to prevent further post-compromise behavior.
 88- If the asset is exposed to the internet with RDP or other remote services available, take the necessary measures to restrict access to the asset. If not possible, limit the access via the firewall to only the needed IP addresses. Also, ensure the system uses robust authentication mechanisms and is patched regularly.
 89- 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.
 90- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 91- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 92- 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).
 93"""
 94references = ["https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4625"]
 95risk_score = 47
 96rule_id = "f9790abf-bd0c-45f9-8b5f-d0b74015e029"
 97setup = """## Setup
 98
 99If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
100events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
101Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
102`event.ingested` to @timestamp.
103For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
104"""
105severity = "medium"
106tags = [
107    "Domain: Endpoint",
108    "OS: Windows",
109    "Use Case: Threat Detection",
110    "Tactic: Credential Access",
111    "Resources: Investigation Guide",
112]
113type = "eql"
114
115query = '''
116sequence by winlog.computer_name, source.ip with maxspan=10s
117  [authentication where event.action == "logon-failed" and winlog.logon.type : "Network" and
118    source.ip != null and source.ip != "127.0.0.1" and source.ip != "::1" and user.name : "*admin*" and
119
120    /* noisy failure status codes often associated to authentication misconfiguration */
121    not winlog.event_data.Status : ("0xC000015B", "0XC000005E", "0XC0000133", "0XC0000192")] with runs=5
122'''
123
124
125[[rule.threat]]
126framework = "MITRE ATT&CK"
127[[rule.threat.technique]]
128id = "T1110"
129name = "Brute Force"
130reference = "https://attack.mitre.org/techniques/T1110/"
131[[rule.threat.technique.subtechnique]]
132id = "T1110.001"
133name = "Password Guessing"
134reference = "https://attack.mitre.org/techniques/T1110/001/"
135
136[[rule.threat.technique.subtechnique]]
137id = "T1110.003"
138name = "Password Spraying"
139reference = "https://attack.mitre.org/techniques/T1110/003/"
140
141
142
143[rule.threat.tactic]
144id = "TA0006"
145name = "Credential Access"
146reference = "https://attack.mitre.org/tactics/TA0006/"

Triage and analysis

Investigating Privileged Account Brute Force

Adversaries with no prior knowledge of legitimate credentials within the system or environment may guess passwords to attempt access to accounts. Without knowledge of the password for an account, an adversary may opt to guess the password using a repetitive or iterative mechanism systematically. More details can be found here.

This rule identifies potential password guessing/brute force activity from a single address against an account that contains the admin pattern on its name, which is likely a highly privileged account.

Note: This investigation guide uses the Osquery Markdown Plugin introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.

Possible investigation steps

  • Investigate the logon failure reason code and the targeted user name.
    • Prioritize the investigation if the account is critical or has administrative privileges over the domain.
  • Investigate the source IP address of the failed Network Logon attempts.
    • Identify whether these attempts are coming from the internet or are internal.
  • Investigate other alerts associated with the involved users and source host during the past 48 hours.
  • Identify the source and the target computer and their roles in the IT environment.
  • Check whether the involved credentials are used in automation or scheduled tasks.
  • If this activity is suspicious, contact the account owner and confirm whether they are aware of it.
  • Examine the source host for derived artifacts that indicate compromise:
    • Observe and collect information about the following activities in the alert source host:
      • Attempts to contact external domains and addresses.
        • Examine the DNS cache for suspicious or anomalous entries.
          • $osquery_0
      • Examine the host services for suspicious or anomalous entries.
        • $osquery_1
        • $osquery_2
        • $osquery_3
  • Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the host which is the source of this activity.

False positive analysis

  • Authentication misconfiguration or obsolete credentials.
  • Service account password expired.
  • Domain trust relationship issues.
  • Infrastructure or availability issues.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the source host to prevent further post-compromise behavior.
  • If the asset is exposed to the internet with RDP or other remote services available, take the necessary measures to restrict access to the asset. If not possible, limit the access via the firewall to only the needed IP addresses. Also, ensure the system uses robust authentication mechanisms and is patched regularly.
  • 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).

References

Related rules

to-top