Detection rules › YARA-L
MITRE ATT&CK T1110.003 RW Windows Password Spray
Detect repeated authentication failure with multiple users indicative of a password spray attack.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Credential Access | T1110.003 Brute Force: Password Spraying |
Event coverage
| Provider | Event | Title |
|---|---|---|
| Security-Auditing | Event ID 4624 | An account was successfully logged on. |
| Security-Auditing | Event ID 4625 | An account failed to log on. |
| Security-Auditing | Event ID 4648 | A logon was attempted using explicit credentials. |
Rule body yaral
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
rule rw_windows_password_spray_T1110_003 {
meta:
author = "Google Cloud Security"
description = "Detect repeated authentication failure with multiple users indicative of a password spray attack."
rule_id = "mr_5d6c9686-992f-4caf-bf1b-2fec05925c49"
rule_name = "MITRE ATT&CK T1110.003 RW Windows Password Spray"
type = "alert"
data_source = "microsoft windows events"
tactic = "TA0006"
technique = "T1110.003"
platform = "Windows"
severity = "Medium"
priority = "Medium"
events:
$login.metadata.event_type = "USER_LOGIN"
$login.metadata.vendor_name = "Microsoft"
$login.principal.hostname = $hostname
$login.target.user.userid = $user
$login.security_result.action = "BLOCK"
match:
$hostname over 30m
outcome:
$risk_score = 65
$event_count = count_distinct($login.metadata.id)
$user_login_threshold = 10
$target_user_distinct_count = count_distinct($user)
$target_user_count = count($user)
$tlp = array_distinct("amber")
// added to populate alert graph with additional context
// Commented out principal.hostname because it is already represented in graph as match variable. If match changes, can uncomment to add to results
//$principal_hostname = array_distinct($login.principal.hostname)
$principal_ip = array_distinct($login.principal.ip)
$target_hostname = array_distinct($login.target.hostname)
$src_hostname = array_distinct($login.src.hostname)
$target_ip = array_distinct($login.target.ip)
$principal_user_userid = array_distinct($login.principal.user.userid)
$target_user_userid = array_distinct($login.target.user.userid)
$principal_resource_name = array_distinct($login.principal.resource.name)
$target_resource_name = array_distinct($login.target.resource.name)
$target_url = array_distinct($login.target.url)
condition:
#user > 10
}
Detection logic
Fires when $user occurs more than 10 times in the 30m window.
Events
$login
security_result.action = "BLOCK"
Correlation
Outcome
Fields the detection emits on a match. $risk_score drives alerting; Chronicle surfaces the rest on the detection.
| Field | Expression |
|---|---|
risk_score | 65 |
event_count | count_distinct($login.metadata.id) |
user_login_threshold | 10 |
target_user_distinct_count | count_distinct($user) |
target_user_count | count($user) |
tlp | array_distinct("amber") |
principal_ip | array_distinct($login.principal.ip) |
target_hostname | array_distinct($login.target.hostname) |
src_hostname | array_distinct($login.src.hostname) |
target_ip | array_distinct($login.target.ip) |
principal_user_userid | array_distinct($login.principal.user.userid) |
target_user_userid | array_distinct($login.target.user.userid) |
principal_resource_name | array_distinct($login.principal.resource.name) |
target_resource_name | array_distinct($login.target.resource.name) |
target_url | array_distinct($login.target.url) |