Detection: Detect Distributed Password Spray Attempts

Description

This analytic employs the 3-sigma approach to identify distributed password spray attacks. A distributed password spray attack is a type of brute force attack where the attacker attempts a few common passwords against many different accounts, connecting from multiple IP addresses to avoid detection. By utilizing the Authentication Data Model, this detection is effective for all CIM-mapped authentication events, providing comprehensive coverage and enhancing security against these attacks.

 1
 2| tstats `security_content_summariesonly` dc(Authentication.user) AS unique_accounts dc(Authentication.src) as unique_src count(Authentication.user) as total_failures from datamodel=Authentication.Authentication where Authentication.action="failure" by Authentication.action, Authentication.signature_id, sourcetype, _time  span=2m 
 3| `drop_dm_object_name("Authentication")` ```fill out time buckets for 0-count events during entire search length``` 
 4| appendpipe [
 5| timechart limit=0 span=5m count 
 6| table _time] 
 7| fillnull value=0 unique_accounts, unique_src ``` remove duplicate & empty time buckets``` 
 8| sort - total_failures 
 9| dedup _time ``` Create aggregation field & apply to all null events``` 
10| eval counter=sourcetype+"__"+signature_id 
11| eventstats values(counter) as fnscounter 
12| eval counter=coalesce(counter,fnscounter) ``` 3-sigma detection logic ``` 
13| eventstats avg(unique_accounts) as comp_avg_user , stdev(unique_accounts) as comp_std_user avg(unique_src) as comp_avg_src , stdev(unique_src) as comp_std_src by counter 
14| eval upperBoundUser=(comp_avg_user+comp_std_user*3), upperBoundsrc=(comp_avg_src+comp_std_src*3) 
15| eval isOutlier=if((unique_accounts > 30 and unique_accounts >= upperBoundUser) and (unique_src > 30 and unique_accounts >= upperBoundsrc), 1, 0) 
16| replace "::ffff:*" with * in src 
17| where isOutlier=1 
18| foreach * [ eval <<FIELD>> = if(<<FIELD>>="null",null(),<<FIELD>>)] 
19| table _time, action, unique_src, unique_accounts, total_failures, sourcetype, signature_id 
20| sort - total_failures 
21| `detect_distributed_password_spray_attempts_filter`

Data Source

Name Platform Sourcetype Source Supported App
Azure Active Directory Sign-in activity Azure icon Azure 'azure:monitor:aad' 'Azure AD' N/A

Macros Used

Name Value
security_content_summariesonly summariesonly=summariesonly_config allow_old_summaries=oldsummaries_config fillnull_value=fillnull_config``
detect_distributed_password_spray_attempts_filter search *
detect_distributed_password_spray_attempts_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1110.003 Password Spraying Credential Access
T1110 Brute Force Credential Access
KillChainPhase.EXPLOITAITON
NistCategory.DE_AE
Cis18Value.CIS_10
APT28
APT29
APT33
Chimera
HEXANE
Lazarus Group
Leafminer
Silent Librarian
APT28
APT38
APT39
DarkVishnya
Dragonfly
FIN5
Fox Kitten
HEXANE
OilRig
Turla

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Risk Event False
This configuration file applies to all detections of type hunting.

Implementation

Ensure that all relevant authentication data is mapped to the Common Information Model (CIM) and that the src field is populated with the source device information. Additionally, ensure that fill_nullvalue is set within the security_content_summariesonly macro to include authentication events from log sources that do not feature the signature_id field in the results.

Known False Positives

It is common to see a spike of legitimate failed authentication events on monday mornings.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
Distributed Password Spray Attempt Detected from $src$ 49 70 70
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset azure:monitor:aad azure:monitor:aad
Integration ✅ Passing Dataset azure:monitor:aad azure:monitor:aad

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 1