Detection: O365 Multi-Source Failed Authentications Spike

Description

The following analytic identifies a spike in failed authentication attempts within an Office 365 environment, indicative of a potential distributed password spraying attack. It leverages UserLoginFailed events from O365 Management Activity logs, focusing on ErrorNumber 50126. This detection is significant as it highlights attempts to bypass security controls using multiple IP addresses and user agents. If confirmed malicious, this activity could lead to unauthorized access, data breaches, privilege escalation, and lateral movement within the organization. Early detection is crucial to prevent account takeovers and mitigate subsequent threats.

1 `o365_management_activity` Workload=AzureActiveDirectory Operation=UserLoginFailed ErrorNumber=50126 
2| bucket span=5m _time 
3| eval uniqueIPUserCombo = src_ip . "-" . user 
4| stats dc(uniqueIPUserCombo) as uniqueIpUserCombinations, dc(user) as uniqueUsers, dc(src_ip) as uniqueIPs, values(user) as user, values(src_ip) as ips, values(user_agent) as user_agents by _time 
5| where uniqueIpUserCombinations > 20 AND uniqueUsers > 20 AND uniqueIPs > 20 
6| `o365_multi_source_failed_authentications_spike_filter`

Data Source

Name Platform Sourcetype Source Supported App
O365 UserLoginFailed N/A 'o365:management:activity' 'o365' N/A

Macros Used

Name Value
o365_management_activity sourcetype=o365:management:activity
o365_multi_source_failed_authentications_spike_filter search *
o365_multi_source_failed_authentications_spike_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
T1586 Compromise Accounts Resource Development
T1586.003 Cloud Accounts Resource Development
T1110 Brute Force Credential Access
T1110.003 Password Spraying Credential Access
T1110.004 Credential Stuffing Credential Access
KillChainPhase.EXPLOITAITON
KillChainPhase.WEAPONIZATION
NistCategory.DE_AE
Cis18Value.CIS_10
APT29
APT28
APT38
APT39
DarkVishnya
Dragonfly
FIN5
Fox Kitten
HEXANE
OilRig
Turla
APT28
APT29
APT33
Chimera
HEXANE
Lazarus Group
Leafminer
Silent Librarian
Chimera

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

You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events. The thresholds set within the analytic (such as unique IPs, unique users, etc.) are initial guidelines and should be customized based on the organization's user behavior and risk profile. Security teams are encouraged to adjust these thresholds to optimize the balance between detecting genuine threats and minimizing false positives, ensuring the detection is tailored to their specific environment.

Known False Positives

This detection may yield false positives in scenarios where legitimate bulk sign-in activities occur, such as during company-wide system updates or when users are accessing resources from varying locations in a short time frame, such as in the case of VPNs or cloud services that rotate IP addresses. Filter as needed.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
An anomalous multi source authentication spike ocurred at $_time$ 42 70 60
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 o365 o365:management:activity
Integration ✅ Passing Dataset o365 o365:management:activity

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: 2