Skip to content

Commit 9cb3d6c

Browse files
committed
Adding pwd spray detection
1 parent fb7346f commit 9cb3d6c

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Detect Distributed Password Spray Attempts
2+
id: b1a82fc8-8a9f-4344-9ec2-bde5c5331b57
3+
version: 1
4+
date: '2023-11-01'
5+
author: Dean Luxton
6+
status: production
7+
type: Hunting
8+
data_source:
9+
- Authentication Datamodel
10+
description: This analytic uses the 3-sigma approach to detect a distributed password spray attack. Utilising the authentication datamodel this detection is affective for all CIM mapped authication events.
11+
search: '| 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
12+
| `drop_dm_object_name("Authentication")`
13+
```fill out time buckets for 0-count events during entire search length```
14+
| appendpipe [| timechart limit=0 span=5m count | table _time]
15+
| fillnull value=0 unique_accounts, unique_src
16+
``` remove duplicate & empty time buckets```
17+
| sort - total_failures
18+
| dedup _time
19+
``` Create aggregation field & apply to all null events```
20+
| eval counter=sourcetype+"__"+signature_id
21+
| eventstats values(counter) as fnscounter | eval counter=coalesce(counter,fnscounter)
22+
``` 3-sigma detection logic ```
23+
| 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
24+
| eval upperBoundUser=(comp_avg_user+comp_std_user*3), upperBoundsrc=(comp_avg_src+comp_std_src*3)
25+
| eval isOutlier=if((unique_accounts > 30 and unique_accounts >= upperBoundUser) and (unique_src > 30 and unique_accounts >= upperBoundsrc), 1, 0)
26+
| replace "::ffff:*" with * in src
27+
| where isOutlier=1
28+
| foreach *
29+
[ eval <<FIELD>> = if(<<FIELD>>="null",null(),<<FIELD>>)]
30+
| table _time, action, unique_src, unique_accounts, total_failures, sourcetype, signature_id
31+
| sort - total_failures | `detect_distributed_password_spray_attempts_filter`'
32+
how_to_implement: Ensure in-scope authentication data is CIM mapped and the src field is populated with the source device. Also ensure fill_nullvalue is set within the macro security_content_summariesonly.
33+
known_false_positives: It is common to see a spike of legitimate failed authentication events on monday mornings.
34+
references:
35+
- https://attack.mitre.org/techniques/T1110/003/
36+
tags:
37+
analytic_story:
38+
- Compromised User Account
39+
- Active Directory Password Spraying
40+
asset_type: Endpoint
41+
atomic_guid:
42+
- 90bc2e54-6c84-47a5-9439-0a2a92b4b175
43+
confidence: 70
44+
impact: 70
45+
message: Distributed Password Spray Attempt Detected
46+
mitre_attack_id:
47+
- T1110.003
48+
- T1110
49+
observable:
50+
- name: src
51+
type: Endpoint
52+
role:
53+
- Attacker
54+
product:
55+
- Splunk Enterprise
56+
- Splunk Enterprise Security
57+
- Splunk Cloud
58+
risk_score: 49
59+
required_fields:
60+
- Authentication.action
61+
- Authentication.user
62+
- Authentication.src
63+
security_domain: access
64+
tests:
65+
- name: True Positive Test
66+
attack_data:
67+
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techni[…]ure_ad_distributed_spray/azure_ad_distributed_spray.log
68+
source: azure:monitor:aad
69+
sourcetype: azure:monitor:aad

0 commit comments

Comments
 (0)