|
2 | 2 | creation_date = "2020/08/29" |
3 | 3 | integration = ["system", "windows"] |
4 | 4 | maturity = "production" |
5 | | -updated_date = "2025/11/14" |
| 5 | +updated_date = "2025/12/11" |
6 | 6 |
|
7 | 7 | [transform] |
8 | 8 | [[transform.osquery]] |
@@ -39,7 +39,7 @@ to gain access to accounts. |
39 | 39 | """ |
40 | 40 | from = "now-9m" |
41 | 41 | index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"] |
42 | | -language = "eql" |
| 42 | +language = "esql" |
43 | 43 | license = "Elastic License v2" |
44 | 44 | name = "Multiple Logon Failure from the same Source Address" |
45 | 45 | note = """## Triage and analysis |
@@ -117,24 +117,29 @@ tags = [ |
117 | 117 | "Resources: Investigation Guide", |
118 | 118 | "Data Source: Windows Security Event Logs", |
119 | 119 | ] |
120 | | -type = "eql" |
| 120 | +timestamp_override = "event.ingested" |
| 121 | +type = "esql" |
121 | 122 |
|
122 | 123 | query = ''' |
123 | | -sequence by winlog.computer_name, source.ip with maxspan=10s |
124 | | - [authentication where host.os.type == "windows" and event.action == "logon-failed" and |
125 | | - /* event 4625 need to be logged */ |
126 | | - winlog.logon.type : "Network" and |
127 | | - source.ip != null and source.ip != "127.0.0.1" and source.ip != "::1" and |
128 | | - not user.name : ("ANONYMOUS LOGON", "-", "*$") and not user.domain == "NT AUTHORITY" and |
129 | | -
|
130 | | - /* |
131 | | - noisy failure status codes often associated to authentication misconfiguration : |
| 124 | +from logs-system.security*, logs-windows.forwarded*, winlogbeat-* metadata _id, _version, _index |
| 125 | +| where event.category == "authentication" and host.os.type == "windows" and event.action == "logon-failed" and |
| 126 | + winlog.logon.type == "Network" and source.ip is not null and winlog.computer_name is not null and |
| 127 | + not cidr_match(TO_IP(source.ip), "127.0.0.0/8", "::1") and |
| 128 | + not user.name in ("ANONYMOUS LOGON", "-") and not user.name like "*$" and user.domain != "NT AUTHORITY" and |
| 129 | + /* |
| 130 | + noisy failure status codes often associated to authentication misconfiguration |
132 | 131 | 0xC000015B - The user has not been granted the requested logon type (also called the logon right) at this machine. |
133 | | - 0XC000005E - There are currently no logon servers available to service the logon request. |
134 | | - 0XC0000133 - Clocks between DC and other computer too far out of sync. |
135 | | - 0XC0000192 An attempt was made to logon, but the Netlogon service was not started. |
136 | | - */ |
137 | | - not winlog.event_data.Status : ("0xC000015B", "0XC000005E", "0XC0000133", "0XC0000192")] with runs=10 |
| 132 | + 0XC000005E - There are currently no logon servers available to service the logon request. |
| 133 | + 0XC0000133 - Clocks between DC and other computer too far out of sync. |
| 134 | + 0XC0000192 An attempt was made to logon, but the Netlogon service was not started. |
| 135 | + 0xc00000dc - DC is in shutdown phase, it will normally tell current clients to use another DC for authentication. |
| 136 | + */ |
| 137 | + not winlog.event_data.Status in ("0xc000015b", "0xc000005e", "0xc0000133", "0xc0000192", "0xc00000dc") |
| 138 | +// truncate the timestamp to a 60-second window |
| 139 | +| eval Esql.time_window = date_trunc(60 seconds, @timestamp) |
| 140 | +| 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) by winlog.computer_name, source.ip, Esql.time_window, winlog.logon.type |
| 141 | +| where Esql.failed_auth_count >= 100 |
| 142 | +| KEEP winlog.computer_name, source.ip, Esql.time_window, winlog.logon.type, Esql.* |
138 | 143 | ''' |
139 | 144 |
|
140 | 145 |
|
|
0 commit comments