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 |
Telemetry coverage
Rule body
// Copyright 2023 Google LLC. Licensed under Apache-2.0.
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
}
YARA-L rule structure
Condition
Fires when $user occurs more than 10 times in the 30m window.
Events
$login
security_result.action = "BLOCK"
Match and correlation
Outcome
Outcome variables add context to a detection. When the rule generates an alert, $risk_score is displayed with it.
| 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) |