win_repeatedAuthFailure_thenSuccess_T1110_001


Description

Detect Multiple Failed Login Attempts followed by Successful Login

Query · yara_l

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
Raw source win_repeatedAuthFailure_thenSuccess_T1110_001 · YARA-L
Esc
Published by chronicle/detection-rules ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
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
}

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.