Privileged Accounts Brute Force
Identifies multiple consecutive logon failures targeting more than one 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 = "2026/09/18"
6[transform]
7[[transform.osquery]]
8label = "Osquery - Retrieve DNS Cache"
9query = "SELECT * FROM dns_cache"
10
11[[transform.osquery]]
12label = "Osquery - Retrieve All Services"
13query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"
14
15[[transform.osquery]]
16label = "Osquery - Retrieve Services Running on User Accounts"
17query = """
18SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
19NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
20user_account == null)
21"""
22
23[[transform.osquery]]
24label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
25query = """
26SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
27services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
28authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
29"""
30
31
32[rule]
33author = ["Elastic"]
34description = """
35Identifies multiple consecutive logon failures targeting more than one Admin account from the same source address and within a
36short time interval. Adversaries will often brute force login attempts across multiple users with a common or known
37password, in an attempt to gain access to accounts.
38"""
39from = "now-9m"
40language = "esql"
41license = "Elastic License v2"
42name = "Privileged Accounts Brute Force"
43note = """## Triage and analysis
44
45### Investigating Privileged Accounts Brute Force
46
47Adversaries 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/).
48
49This rule identifies potential password guessing/brute force activity from a single address against multiple accounts that contains the `admin` pattern on its name, which is likely a highly privileged account.
50
51> **Note**:
52> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
53
54#### Possible investigation steps
55
56- Investigate the logon failure reason code and the targeted user name.
57 - Prioritize the investigation if the account is critical or has administrative privileges over the domain.
58- Investigate the source IP address of the failed Network Logon attempts.
59 - Identify whether these attempts are coming from the internet or are internal.
60- Investigate other alerts associated with the involved users and source host during the past 48 hours.
61- Identify the source and the target computer and their roles in the IT environment.
62- Check whether the involved credentials are used in automation or scheduled tasks.
63- If this activity is suspicious, contact the account owner and confirm whether they are aware of it.
64- Examine the source host for derived artifacts that indicate compromise:
65 - Observe and collect information about the following activities in the alert source host:
66 - Attempts to contact external domains and addresses.
67 - Examine the DNS cache for suspicious or anomalous entries.
68 - $osquery_0
69 - Examine the host services for suspicious or anomalous entries.
70 - $osquery_1
71 - $osquery_2
72 - $osquery_3
73- 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.
74
75### False positive analysis
76
77- Authentication misconfiguration or obsolete credentials.
78- Service account password expired.
79- Domain trust relationship issues.
80- Infrastructure or availability issues.
81
82### Response and remediation
83
84- Initiate the incident response process based on the outcome of the triage.
85- Isolate the source host to prevent further post-compromise behavior.
86- 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.
87- 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.
88- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
89- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
90- 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).
91"""
92
93setup = """## Setup
94
95Audit Logon must be enabled to generate the events used by this rule.
96Setup instructions: https://ela.st/audit-logon
97"""
98
99references = ["https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4625"]
100risk_score = 47
101rule_id = "f9790abf-bd0c-45f9-8b5f-d0b74015e029"
102severity = "medium"
103tags = [
104 "Domain: Endpoint",
105 "OS: Windows",
106 "Use Case: Threat Detection",
107 "Tactic: Credential Access",
108 "Resources: Investigation Guide",
109 "Data Source: Windows Security Event Logs",
110 "Noise: High",
111 "Performance: Normal",
112 "Profile: Aggressive",
113 "Threat: Brute Force",
114 "Rule Type: ES|QL",
115 "Platform: Windows",
116 "Resources: Osquery",
117]
118type = "esql"
119
120query = '''
121from logs-system.security*, logs-windows.forwarded*, winlogbeat-* metadata _id, _version, _index
122| where event.category == "authentication" and host.os.type == "windows" and event.action == "logon-failed" and
123 winlog.logon.type == "Network" and source.ip is not null and winlog.computer_name is not null and
124 not cidr_match(TO_IP(source.ip), "127.0.0.0/8", "::1") and
125 to_lower(winlog.event_data.TargetUserName) like "*admin*" and
126 /*
127 noisy failure status codes often associated to authentication misconfiguration
128 0xC000015B - The user has not been granted the requested logon type (also called the logon right) at this machine.
129 0XC000005E - There are currently no logon servers available to service the logon request.
130 0XC0000133 - Clocks between DC and other computer too far out of sync.
131 0XC0000192 An attempt was made to logon, but the Netlogon service was not started.
132 0xc00000dc - DC is in shutdown phase, it will normally tell current clients to use another DC for authentication.
133 */
134 not winlog.event_data.Status in ("0xc000015b", "0xc000005e", "0xc0000133", "0xc0000192", "0xc00000dc")
135// truncate the timestamp to a 60-second window
136| eval Esql.time_window = date_trunc(60 seconds, @timestamp)
137| stats Esql.failed_auth_count = COUNT(*),
138 Esql.target_user_name_values = VALUES(winlog.event_data.TargetUserName),
139 Esql.count_distinct_user_name = count_distinct(winlog.event_data.TargetUserName),
140 Esql.user_domain_values = VALUES(user.domain),
141 Esql.error_codes = VALUES(winlog.event_data.Status),
142 Esql.data_stream_namespace.values = VALUES(data_stream.namespace) by winlog.computer_name, source.ip, Esql.time_window, winlog.logon.type
143| where Esql.failed_auth_count >= 50 and Esql.count_distinct_user_name >= 2
144| eval user.name = mv_first(Esql.target_user_name_values)
145| KEEP winlog.computer_name, source.ip, user.name, Esql.time_window, winlog.logon.type, Esql.*
146'''
147
148
149[[rule.threat]]
150framework = "MITRE ATT&CK"
151[[rule.threat.technique]]
152id = "T1110"
153name = "Brute Force"
154reference = "https://attack.mitre.org/techniques/T1110/"
155[[rule.threat.technique.subtechnique]]
156id = "T1110.001"
157name = "Password Guessing"
158reference = "https://attack.mitre.org/techniques/T1110/001/"
159
160[[rule.threat.technique.subtechnique]]
161id = "T1110.003"
162name = "Password Spraying"
163reference = "https://attack.mitre.org/techniques/T1110/003/"
164
165
166
167[rule.threat.tactic]
168id = "TA0006"
169name = "Credential Access"
170reference = "https://attack.mitre.org/tactics/TA0006/"
Triage and analysis
Investigating Privileged Accounts 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 multiple accounts 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 DNS cache for suspicious or anomalous entries.
- Examine the host services for suspicious or anomalous entries.
- $osquery_1
- $osquery_2
- $osquery_3
- Attempts to contact external domains and addresses.
- Observe and collect information about the following activities in the alert source host:
- 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
- Multiple Logon Failure from the same Source Address
- Multiple Logon Failure Followed by Logon Success
- Access to a Sensitive LDAP Attribute
- Credential Acquisition via Registry Hive Dumping
- Potential Computer Account NTLM Relay Activity