O365 Email Password and Payroll Compromise Behavior

 Original Source: [splunk source]
Name:O365 Email Password and Payroll Compromise Behavior
id:e36de71a-6bdc-4002-98ff-e3e51b0d8f96
version:8
date:None
author:Steven Dick
status:production
type:TTP
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.
Data_source:
  • -Office 365 Universal Audit Log
  • -Office 365 Reporting Message Trace
search:`o365_messagetrace` subject IN ("*banking*","*direct deposit*","*pay-to*","*password *","*passcode *","*OTP *","*MFA *","*Account Recovery*")
| eval mailtime = _time
| bin _time span=4hr
| eval user = lower(recipient)
| eval InternetMessageId = lower(message_id)
| join InternetMessageId, user max=0
[

| search `o365_management_activity` Workload=Exchange Operation IN ("SoftDelete","HardDelete")

| spath path=AffectedItems{} output=AffectedItemSplit

| fields _time,ClientIP,ClientInfoString,UserId,Operation,ResultStatus,MailboxOwnerUPN,AffectedItemSplit

| mvexpand AffectedItemSplit
| spath input=AffectedItemSplit

| search Subject IN ("*banking*","*direct deposit*","*pay-to*","*password *","*passcode *","*OTP *","*MFA *","*Account Recovery*")

| eval deltime = _time

| bin _time span=4hr

| eval InternetMessageId = lower(InternetMessageId), user = lower(UserId)
]
| 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
| search subject IN ("*banking*","*direct deposit*","*pay-to*") AND subject IN ("*password *","*passcode *","*OTP *","*MFA *","*Account Recovery*")
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `o365_email_password_and_payroll_compromise_behavior_filter`


how_to_implement: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.
References:
  -https://attack.mitre.org/techniques/T1114/
  -https://www.hhs.gov/sites/default/files/help-desk-social-engineering-sector-alert-tlpclear.pdf
  -https://intelligence.abnormalsecurity.com/attack-library/threat-actor-convincingly-impersonates-employee-requesting-direct-deposit-update-in-likely-ai-generated-attack
drilldown_searches:
 name:'View the detection results for - "$user$"'
 search:'%original_detection_search% | search user = "$user$"'
 earliest_offset:'$info_min_time$'
 latest_offset:'$info_max_time$'
 name:'View risk events for the last 7 days for - "$user$"'
 search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
 earliest_offset:'7d'
 latest_offset:'0'
 name:'Investigate Email for $user$'
 search:'`o365_messagetrace` subject IN ("*banking*","*direct deposit*","*password*","*passcode*") recipient = "$user$"'
 earliest_offset:'$info_min_time$'
 latest_offset:'$info_max_time$'
analytic_story:['Office 365 Account Takeover', 'Office 365 Collection Techniques', 'Suspicious Emails', 'Data Destruction']

asset_type:O365 Tenant

mitre_attack_id:['T1070.008', 'T1485', 'T1114.001']

product:['Splunk Enterprise', 'Splunk Enterprise Security', 'Splunk Cloud']

category:cloud

security_domain:threat

tags:

tests:
 name:'True Positive Test'
 attack_data:
  data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1114/o365_suspect_email_actions/o365_exchange_suspect_events.log
  source: o365
  sourcetype: o365:management:activity
  data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1114/o365_suspect_email_actions/o365_messagetrace_suspect_events.log
  source: o365_messagetrace
  sourcetype: o365:reporting:messagetrace
 test_type:'unit'
 name:'True Positive Test - Graph message trace'
 attack_data:
  data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1114/o365_suspect_email_actions/o365_exchange_suspect_events.log
  source: o365
  sourcetype: o365:management:activity
  data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1114/o365_suspect_email_actions/o365_graph_messagetrace_suspect_events.log
  source: o365_messagetrace
  sourcetype: o365:graph:messagetrace
 test_type:'unit'
manual_test:None