| ID | Technique | Tactic |
|---|---|---|
| T1070.008 | Clear Mailbox Data | Stealth |
| T1114.001 | Local Email Collection | Collection |
| T1485 | Data Destruction | Impact |
Detection: O365 Email Password and Payroll Compromise Behavior
Description
The following analytic identifies when an O365 email recipient receives and then deletes emails for the combination of both password and banking/payroll changes within a short period. This behavior may indicate a compromised account where the threat actor is attempting to redirect the victims payroll to an attacker controlled bank account.
Search
1`o365_messagetrace` subject IN ("*banking*","*direct deposit*","*pay-to*","*password *","*passcode *","*OTP *","*MFA *","*Account Recovery*")
2
3| eval mailtime = _time
4
5| bin _time span=4hr
6
7| eval user = lower(RecipientAddress)
8
9| eval InternetMessageId = lower(MessageId)
10
11| join InternetMessageId, user max=0
12 [
13
14| search `o365_management_activity` Workload=Exchange Operation IN ("SoftDelete","HardDelete")
15
16| spath path=AffectedItems{} output=AffectedItemSplit
17
18| fields _time,ClientIP,ClientInfoString,UserId,Operation,ResultStatus,MailboxOwnerUPN,AffectedItemSplit
19
20| mvexpand AffectedItemSplit
21| spath input=AffectedItemSplit
22
23| search Subject IN ("*banking*","*direct deposit*","*pay-to*","*password *","*passcode *","*OTP *","*MFA *","*Account Recovery*")
24
25| eval deltime = _time
26
27| bin _time span=4hr
28
29| eval InternetMessageId = lower(InternetMessageId), user = lower(UserId)
30 ]
31
32| stats values(ClientInfoString) as http_user_agent, values(ClientIP) as src, values(Subject) as subject, dc(Subject) as subject_count, values(Operation) as action, values(ResultStatus) as result, count, min(mailtime) as firstTime, max(deltime) as lastTime by user,_time
33
34| search subject IN ("*banking*","*direct deposit*","*pay-to*") AND subject IN ("*password *","*passcode *","*OTP *","*MFA *","*Account Recovery*")
35
36| `security_content_ctime(firstTime)`
37
38| `security_content_ctime(lastTime)`
39
40| `o365_email_password_and_payroll_compromise_behavior_filter`
Data Source
| Name | Platform | Sourcetype | Source |
|---|---|---|---|
| Office 365 Universal Audit Log | Other | 'o365:management:activity' |
'o365' |
| Office 365 Reporting Message Trace | Other | 'o365:reporting:messagetrace' |
'o365' |
Macros Used
| Name | Value |
|---|---|
| o365_management_activity | sourcetype=o365:management:activity |
| o365_email_password_and_payroll_compromise_behavior_filter | search * |
o365_email_password_and_payroll_compromise_behavior_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
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 Finding (Notable) | Yes |
| Rule Title | %name% |
| Rule Description | %description% |
| Notable Event Fields | user, dest |
| Creates Intermediate Finding (Risk Event) | No |
Implementation
You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events AND Message Trace events.
Known False Positives
No false positives have been identified at this time.
Associated Analytic Story
Finding
| Title | Entity Field | Entity Type | Risk Score |
|---|---|---|---|
| The user $user$ received and deleted password and payroll change emails within a short timeframe | user | user | 50 |
Threat Objects
| Field | Type |
|---|---|
| src | ip_address |
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: 7