Detection rules › Splunk

Detect Password Spray Attack Behavior On User

Status
production
Severity
medium
Group by
app, authentication_method, dest, event_action, signature, signature_id, src, user
Author
Steven Dick
Source
github.com/splunk/security_content

The following analytic identifies any user failing to authenticate from 10 or more unique sources. This behavior could represent an adversary performing a Password Spraying attack to obtain initial access or elevate privileges. This logic can be used for real time security monitoring as well as threat hunting exercises. Environments can be very different depending on the organization. Test and customize this detections thresholds as needed

Known false positives

  • Domain controllers, authentication chokepoints, and vulnerability scanners.

MITRE ATT&CK coverage

TacticTechniques
Credential Access

Telemetry coverage

Rule body

name: Detect Password Spray Attack Behavior On User
id: a7539705-7183-4a12-9b6a-b6eef645a6d7
version: 12
creation_date: '2023-11-11'
modification_date: '2026-05-13'
author: Steven Dick
status: production
type: TTP
description: The following analytic identifies any user failing to authenticate from 10 or more unique sources. This behavior could represent an adversary performing a Password Spraying attack to obtain initial access or elevate privileges. This logic can be used for real time security monitoring as well as threat hunting exercises. Environments can be very different depending on the organization. Test and customize this detections thresholds as needed
data_source:
    - Windows Event Log Security 4624
    - Windows Event Log Security 4625
search: |-
    | tstats `security_content_summariesonly` max(_time) as lastTime, min(_time) as firstTime, values(Authentication.user_category) as user_category values(Authentication.src_category) as src_category values(Authentication.app) as app count FROM datamodel=Authentication.Authentication
      BY Authentication.action Authentication.app Authentication.authentication_method
         Authentication.dest Authentication.signature Authentication.signature_id
         Authentication.src Authentication.user
    | `drop_dm_object_name("Authentication")`
    | eval user=case((match(upper(user),"[a-zA-Z0-9]{3}")),upper(user),true(),null), success=if(action="success",count,0), src=upper(src), success_src=if(action="success",src,null), failure=if(action="failure",count,0), failed_src=if(action="failure",src,null)
    | stats count min(firstTime) as firstTime max(lastTime) as lastTime values(app) as app values(src_category) as src_category values(success_src) as src values(failed_src) as failed_src dc(success_src) as success_dc dc(failed_src) as failed_dc dc(src) as src_dc, sum(failure) as failure, sum(success) as success
      BY user
    | fields - _time
    | where src_dc >= 10 AND .25 > (success/failure) AND failed_dc > success_dc
    | `security_content_ctime(firstTime)`
    | `security_content_ctime(lastTime)`
    | `detect_password_spray_attack_behavior_on_user_filter`
how_to_implement: This detection requires ingesting authentication data to the appropriate accelerated datamodel. Recommend adjusting the search time window for this correlation to match the number of unique users (user_dc) in hours. i.e. 10 users over 10hrs
known_false_positives: Domain controllers, authentication chokepoints, and vulnerability scanners.
references:
    - https://attack.mitre.org/techniques/T1110/003/
    - https://www.microsoft.com/en-us/security/blog/2020/04/23/protecting-organization-password-spray-attacks/
    - https://github.com/MarkoH17/Spray365
finding:
    title: A total of $src_dc$ distinct sources attempted to access the account [$user$], $count$ times between [$firstTime$] and [$lastTime$]. $success$ successful logins detected.
    entity:
        field: user
        type: user
        score: 50
intermediate_findings:
    entities:
        - field: src
          type: system
          score: 50
          message: A total of $src_dc$ distinct sources attempted to access the account [$user$], $count$ times between [$firstTime$] and [$lastTime$]. $success$ successful logins detected.
analytic_story:
    - Compromised User Account
    - Crypto Stealer
asset_type: Account
mitre_attack_id:
    - T1110.003
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: access

Stages and Predicates

Stage 1: tstats

| tstats `security_content_summariesonly` max(_time) as lastTime, min(_time) as firstTime, values(Authentication.user_category) as user_category values(Authentication.src_category) as src_category values(Authentication.app) as app count FROM datamodel=Authentication.Authentication
  BY Authentication.action Authentication.app Authentication.authentication_method
     Authentication.dest Authentication.signature Authentication.signature_id
     Authentication.src Authentication.user

Stage 2: search

| `drop_dm_object_name("Authentication")`

Stage 3: eval

| eval user=case((match(upper(user),"[a-zA-Z0-9]{3}")),upper(user),true(),null), success=if(action="success",count,0), src=upper(src), success_src=if(action="success",src,null), failure=if(action="failure",count,0), failed_src=if(action="failure",src,null)
failed_src =
ifaction = "failure"src
elsenull
failure =
ifaction = "failure"count
else0
success =
ifaction = "success"count
else0
success_src =
ifaction = "success"src
elsenull
user =
ifmatch(upper(user), "[a-zA-Z0-9]{3}")upper(user)
elsenull

Stage 4: stats

| stats count min(firstTime) as firstTime max(lastTime) as lastTime values(app) as app values(src_category) as src_category values(success_src) as src values(failed_src) as failed_src dc(success_src) as success_dc dc(failed_src) as failed_dc dc(src) as src_dc, sum(failure) as failure, sum(success) as success
  BY user

Stage 5: fields

| fields - _time

Stage 6: where

| where src_dc >= 10 AND .25 > (success/failure) AND failed_dc > success_dc

Stage 7: search

| `security_content_ctime(firstTime)`

Stage 8: search

| `security_content_ctime(lastTime)`

Stage 9: search

| `detect_password_spray_attack_behavior_on_user_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
failed_dccross_field_compare
  • success_dc transforms: op:gt corpus 2 (splunk 2)
field:"failed_dc" kind:cross_field_compare value:"success_dc"
src_dcge
  • 10
field:"src_dc" kind:ge value:"10"