Detection rules › YARA-L
MITRE ATT&CK T1110.001 Windows Repeated Authentication Failures Before Successful One
Detect Multiple Failed Login Attempts followed by Successful Login
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Credential Access |
Telemetry coverage
Rule body
// Copyright 2023 Google LLC. Licensed under Apache-2.0.
rule win_repeatedAuthFailure_thenSuccess_T1110_001 {
meta:
author = "Google Cloud Security"
description = "Detect Multiple Failed Login Attempts followed by Successful Login"
rule_id = "mr_16893c0e-2563-44ed-84c9-57ab326eb1c2"
rule_name = "MITRE ATT&CK T1110.001 Windows Repeated Authentication Failures Before Successful One"
type = "alert"
data_source = "microsoft windows events"
platform = "Windows"
severity = "Medium"
priority = "Medium"
tactic = "TA0006"
technique = "T1110.001"
events:
$fail.metadata.event_type = "USER_LOGIN"
$fail.metadata.vendor_name = "Microsoft"
$fail.principal.hostname = $hostname
$fail.target.user.userid = $user
$fail.security_result.action = "BLOCK"
$fail.metadata.product_event_type = "4625"
$fail.metadata.event_timestamp.seconds < $success.metadata.event_timestamp.seconds
$success.metadata.event_type = "USER_LOGIN"
$success.metadata.vendor_name = "Microsoft"
$success.target.user.userid = $user
$success.principal.hostname = $hostname
$success.security_result.action = "ALLOW"
$success.metadata.product_event_type = "4624"
match:
$user, $hostname over 15m
outcome:
// increment risk score if the system targeted is active directory server, can modify as you see fit, using this as an example
$risk_score = max(if($hostname = /activedir/, 75, 50))
$failed_login_threshold = 5
$impacted_systems = array_distinct($hostname)
$impacted_users = array_distinct($user)
$alert_type = "Successful Brute Force Attack"
$tlp = "red"
// 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($success.principal.hostname)
$principal_ip = array_distinct($success.principal.ip)
$target_hostname = array_distinct($success.target.hostname)
$src_hostname = array_distinct($success.src.hostname)
$target_ip = array_distinct($success.target.ip)
$principal_user_userid = array_distinct($success.principal.user.userid)
// Commented out target.user.userid because it is already represented in graph as match variable. If match changes, can uncomment to add to results
//$target_user_userid = array_distinct($success.target.user.userid)
$principal_resource_name = array_distinct($success.principal.resource.name)
$target_resource_name = array_distinct($success.target.resource.name)
$target_url = array_distinct($success.target.url)
condition:
#fail > 4 and $success
}
YARA-L rule structure
Condition
Fires when $fail occurs more than 4 times in the 15m window and at least one $success event in the 15m window.
Events
$fail
security_result.action = "BLOCK"metadata.product_event_type = "4625"
$success
security_result.action = "ALLOW"metadata.product_event_type = "4624"
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 | max(if($hostname = /activedir/, 75, 50)) |
failed_login_threshold | 5 |
impacted_systems | array_distinct($hostname) |
impacted_users | array_distinct($user) |
principal_ip | array_distinct($success.principal.ip) |
target_hostname | array_distinct($success.target.hostname) |
src_hostname | array_distinct($success.src.hostname) |
target_ip | array_distinct($success.target.ip) |
principal_user_userid | array_distinct($success.principal.user.userid) |
principal_resource_name | array_distinct($success.principal.resource.name) |
target_resource_name | array_distinct($success.target.resource.name) |
target_url | array_distinct($success.target.url) |