Multiple Logon Failure from the same Source Address

Identifies multiple consecutive logon failures 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 = "2025/12/11"
  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 from the same source address and within a short time interval.
 37Adversaries will often brute force login attempts across multiple users with a common or known password, in an attempt
 38to gain access to accounts.
 39"""
 40from = "now-9m"
 41language = "esql"
 42license = "Elastic License v2"
 43name = "Multiple Logon Failure from the same Source Address"
 44note = """## Triage and analysis
 45
 46### Investigating Multiple Logon Failure from the same Source Address
 47
 48Adversaries 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/).
 49
 50This rule identifies potential password guessing/brute force activity from a single address.
 51
 52> **Note**:
 53> 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.
 54
 55#### Possible investigation steps
 56
 57- Investigate the logon failure reason code and the targeted user names.
 58  - Prioritize the investigation if the account is critical or has administrative privileges over the domain.
 59- Investigate the source IP address of the failed Network Logon attempts.
 60  - Identify whether these attempts are coming from the internet or are internal.
 61- Investigate other alerts associated with the involved users and source host during the past 48 hours.
 62- Identify the source and the target computer and their roles in the IT environment.
 63- Check whether the involved credentials are used in automation or scheduled tasks.
 64- If this activity is suspicious, contact the account owner and confirm whether they are aware of it.
 65- Examine the source host for derived artifacts that indicate compromise:
 66  - Observe and collect information about the following activities in the alert source host:
 67    - Attempts to contact external domains and addresses.
 68      - Examine the DNS cache for suspicious or anomalous entries.
 69        - $osquery_0
 70    - Examine the host services for suspicious or anomalous entries.
 71      - $osquery_1
 72      - $osquery_2
 73      - $osquery_3
 74- 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
 75
 76### False positive analysis
 77
 78- Understand the context of the authentications by contacting the asset owners. This activity can be related to a new or existing automation or business process that is in a failing state.
 79- Authentication misconfiguration or obsolete credentials.
 80- Service account password expired.
 81- Domain trust relationship issues.
 82- Infrastructure or availability issues.
 83
 84### Related rules
 85
 86- Multiple Logon Failure Followed by Logon Success - 4e85dc8a-3e41-40d8-bc28-91af7ac6cf60
 87
 88### Response and remediation
 89
 90- Initiate the incident response process based on the outcome of the triage.
 91- Isolate the source host to prevent further post-compromise behavior.
 92- 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.
 93- 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.
 94- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 95- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 96- 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).
 97"""
 98references = [
 99    "https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4625",
100    "https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=4624",
101    "https://social.technet.microsoft.com/Forums/ie/en-US/c82ac4f3-a235-472c-9fd3-53aa646cfcfd/network-information-missing-in-event-id-4624?forum=winserversecurity",
102    "https://serverfault.com/questions/379092/remote-desktop-failed-logon-event-4625-not-logging-ip-address-on-2008-terminal-s/403638#403638",
103]
104risk_score = 47
105rule_id = "48b6edfc-079d-4907-b43c-baffa243270d"
106setup = """## Setup
107
108- In some cases the source network address in Windows events 4625/4624 is not populated due to Microsoft logging limitations (examples in the references links). This edge case will break the rule condition and it won't trigger an alert.
109"""
110severity = "medium"
111tags = [
112    "Domain: Endpoint",
113    "OS: Windows",
114    "Use Case: Threat Detection",
115    "Tactic: Credential Access",
116    "Resources: Investigation Guide",
117    "Data Source: Windows Security Event Logs",
118]
119timestamp_override = "event.ingested"
120type = "esql"
121
122query = '''
123from logs-system.security*, logs-windows.forwarded*, winlogbeat-* metadata _id, _version, _index
124| where event.category == "authentication" and host.os.type == "windows" and event.action == "logon-failed" and
125  winlog.logon.type == "Network" and source.ip is not null and winlog.computer_name is not null and
126  not cidr_match(TO_IP(source.ip), "127.0.0.0/8", "::1") and
127  not user.name in ("ANONYMOUS LOGON", "-") and not user.name like "*$" and user.domain != "NT AUTHORITY" and
128  /*
129    noisy failure status codes often associated to authentication misconfiguration
130     0xC000015B - The user has not been granted the requested logon type (also called the logon right) at this machine.
131     0XC000005E - There are currently no logon servers available to service the logon request.
132     0XC0000133 - Clocks between DC and other computer too far out of sync.
133     0XC0000192 An attempt was made to logon, but the Netlogon service was not started.
134     0xc00000dc - DC is in shutdown phase, it will normally tell current clients to use another DC for authentication.
135  */
136  not winlog.event_data.Status in ("0xc000015b", "0xc000005e", "0xc0000133", "0xc0000192", "0xc00000dc")
137// truncate the timestamp to a 60-second window
138| eval Esql.time_window = date_trunc(60 seconds, @timestamp)
139| stats Esql.failed_auth_count = COUNT(*), Esql.target_user_name_values = VALUES(winlog.event_data.TargetUserName), Esql.user_domain_values = VALUES(user.domain), Esql.error_codes = VALUES(winlog.event_data.Status), Esql.data_stream_namespace.values = VALUES(data_stream.namespace) by winlog.computer_name, source.ip, Esql.time_window, winlog.logon.type
140| where Esql.failed_auth_count >= 100
141| KEEP winlog.computer_name, source.ip, Esql.time_window, winlog.logon.type, Esql.*
142'''
143
144
145[[rule.threat]]
146framework = "MITRE ATT&CK"
147[[rule.threat.technique]]
148id = "T1110"
149name = "Brute Force"
150reference = "https://attack.mitre.org/techniques/T1110/"
151[[rule.threat.technique.subtechnique]]
152id = "T1110.001"
153name = "Password Guessing"
154reference = "https://attack.mitre.org/techniques/T1110/001/"
155
156[[rule.threat.technique.subtechnique]]
157id = "T1110.003"
158name = "Password Spraying"
159reference = "https://attack.mitre.org/techniques/T1110/003/"
160
161
162
163[rule.threat.tactic]
164id = "TA0006"
165name = "Credential Access"
166reference = "https://attack.mitre.org/tactics/TA0006/"

Triage and analysis

Investigating Multiple Logon Failure from the same Source Address

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.

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 names.
    • 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

  • Understand the context of the authentications by contacting the asset owners. This activity can be related to a new or existing automation or business process that is in a failing state.
  • Authentication misconfiguration or obsolete credentials.
  • Service account password expired.
  • Domain trust relationship issues.
  • Infrastructure or availability issues.
  • Multiple Logon Failure Followed by Logon Success - 4e85dc8a-3e41-40d8-bc28-91af7ac6cf60

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