Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nterl0k - T1110.003 [Spray and Pray] or [Boring but Works] #2915

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Detect Password Spray Attack Behavior From Source
id: b6391b15-e913-4c2c-8949-9eecc06efacc
version: 1
date: '2023-10-30'
author: Steven Dick
status: production
type: TTP
description: The following analytic identifies one source failing to authenticate with 10 or more unique users. 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 and works well against any number of data sources ingested into the CIM datamodel.

Environments can be very different depending on the organization. Test and customize this detections thresholds if needed.
ljstella marked this conversation as resolved.
Show resolved Hide resolved
data_source:
- Authentication Events (various)
search: '| tstats `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 where * by Authentication.action,Authentication.src,Authentication.user
| `drop_dm_object_name("Authentication")`
| eval user=case((match(upper(user),"[a-zA-Z0-9]{3}")),upper(user),true(),null), src=upper(src), success=if(action="success",count,0),success_user=if(action="success",user,null),failure=if(action="failure",count,0), failed_user=if(action="failure",user,null)
| `detect_password_spray_attack_behavior_from_source_filter`
| stats count min(firstTime) as firstTime max(lastTime) as lastTime values(app) as app values(src_category) as src_category values(success_user) as user values(failed_user) as failed_user dc(success_user) as success_dc dc(failed_user) as failed_dc dc(user) as user_dc ,sum(failure) as failure,sum(success) as success by src
| fields - _time
| where user_dc >= 10 AND .25 > (success/failure) AND failed_dc > success_dc
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`'
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
tags:
analytic_story:
- Compromised User Account
asset_type: Access
confidence: 75
impact: 80
message: The source [$src$] attempted to access $user_dc$ distinct users a total of $count$ times between [$firstTime$] and [$lastTime$]. $success$ successful logins detected.
mitre_attack_id:
- T1110.003
- T1110
observable:
- name: src
type: Hostname
role:
- Victim
- name: user
type: User
role:
- Victim
- name: falied_user
type: User
role:
- Attacker
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
required_fields:
- _time
- Authentication.user_category
- Authentication.src_category
- Authentication.app
- Authentication.action
- Authentication.src
- Authentication.user
risk_score: 60
security_domain: access
tests:
- name: True Positive Test
attack_data:
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1110.003/generic_password_spray/password_spray_attack.log
source: XmlWinEventLog:Security
sourcetype: XmlWinEventLog
update_timestamp: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Detect Password Spray Attack On User
id: a7539705-7183-4a12-9b6a-b6eef645a6d7
version: 1
date: '2023-10-30'
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:
- Authentication Events (various)
search: '| tstats `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 where * by Authentication.action,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)
| `detect_password_spray_attack_behavior_on_user_filter`
| 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)`'
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
tags:
analytic_story:
- Compromised User Account
asset_type: Access
confidence: 75
impact: 80
message: A total of $src_dc$ distinct sources attempted to access the account [$user$], $count$ times between [$firstTime$] and [$lastTime$]. $success$ successful logins detected.
mitre_attack_id:
- T1110.003
- T1110
observable:
- name: src
type: Hostname
role:
- Victim
- name: user
type: User
role:
- Victim
- name: falied_user
type: User
role:
- Attacker
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
required_fields:
- _time
- Authentication.user_category
- Authentication.src_category
- Authentication.app
- Authentication.action
- Authentication.src
- Authentication.user
risk_score: 60
security_domain: access
tests:
- name: True Positive Test
attack_data:
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1110/003/passwprd_spray_attack/windows_events.log
source: XmlWinEventLog:Security
sourcetype: XmlWinEventLog
update_timestamp: true
Loading