Detection rules › YARA-L

MITRE ATT&CK T1110.003 RW Windows Password Spray

Severity
medium
Type
alert
Time window
30m
Match by
hostname
Author
Google Cloud Security
Source
github.com/chronicle/detection-rules

Detect repeated authentication failure with multiple users indicative of a password spray attack.

MITRE ATT&CK coverage

TacticTechniques
Credential AccessT1110.003 Brute Force: Password Spraying

Event coverage

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 USER_LOGIN (4624, 4625, 4648)

  • security_result.action = "BLOCK"

Correlation

Match key
$hostname (principal.hostname)
Within
30m

Outcome

Fields the detection emits on a match. $risk_score drives alerting; Chronicle surfaces the rest on the detection.

FieldExpression
risk_score65
event_countcount_distinct($login.metadata.id)
user_login_threshold10
target_user_distinct_countcount_distinct($user)
target_user_countcount($user)
tlparray_distinct("amber")
principal_iparray_distinct($login.principal.ip)
target_hostnamearray_distinct($login.target.hostname)
src_hostnamearray_distinct($login.src.hostname)
target_iparray_distinct($login.target.ip)
principal_user_useridarray_distinct($login.principal.user.userid)
target_user_useridarray_distinct($login.target.user.userid)
principal_resource_namearray_distinct($login.principal.resource.name)
target_resource_namearray_distinct($login.target.resource.name)
target_urlarray_distinct($login.target.url)