rw_windows_password_spray_T1110_003
Description
Detect repeated authentication failure with multiple users indicative of a password spray attack.
Query · yara_l
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