Detection rules › Splunk

O365 Email Receive and Hard Delete Takeover Behavior

Status
production
Severity
low
Group by
m365::InternetMessageId, subject, user
Author
Steven Dick
Source
github.com/splunk/security_content

The following analytic identifies when an O365 email recipient receives and then deletes emails related to password or 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.

Known false positives

  • Possible new user/account onboarding processes.

MITRE ATT&CK coverage

Telemetry coverage

Rules detecting the same action

These rules filter on the same operation.

Rule body

name: O365 Email Receive and Hard Delete Takeover Behavior
id: b66aeaa4-586f-428b-8a2b-c4fd3039d8d3
version: 6
creation_date: '2025-01-23'
modification_date: '2026-05-13'
author: Steven Dick
status: production
type: Anomaly
description: The following analytic identifies when an O365 email recipient receives and then deletes emails related to password or 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(RecipientAddress)
    | eval InternetMessageId = lower(MessageId)
    | join InternetMessageId, user max=0
      [
      | search `o365_management_activity` Workload=Exchange Operation IN ("HardDelete") AND Folder.Path IN ("\\Sent Items","\\Recoverable Items\\Deletions")
      | spath path=AffectedItems{}  output=AffectedItemSplit
      | fields _time,ClientProcessName,ClientIPAddress,ClientInfoString,UserId,Operation,ResultStatus,MailboxOwnerUPN,AffectedItemSplit,Folder.Path
      | 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), subject = Subject
      ]
    | stats values(ClientIPAddress) as src, values(ClientInfoString) as http_user_agent, values(Folder.Path) as file_path, values(Operation) as signature, values(ResultStatus) as result, values(InternetMessageId) as signature_id, count, min(mailtime) as firstTime, max(deltime) as lastTime by user,subject
    | `security_content_ctime(firstTime)`
    | `security_content_ctime(lastTime)`
    | `o365_email_receive_and_hard_delete_takeover_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: Possible new user/account onboarding processes.
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
intermediate_findings:
    entities:
        - field: user
          type: user
          score: 20
          message: The user $user$ received and deleted an email within a short timeframe titled [$subject$] which may contain password or banking information
threat_objects:
    - field: src
      type: ip_address
    - field: subject
      type: email_subject
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

Stages and Predicates

Stage 1: search

`o365_messagetrace` subject IN ("*banking*","*direct deposit*","*pay-to*","*password *","*passcode *","*OTP *","*MFA *","*Account Recovery*")

Stage 2: eval

| eval mailtime = _time

Stage 3: bucket

| bin _time span=4hr

Stage 4: eval

| eval user = lower(RecipientAddress)

Stage 5: eval

| eval InternetMessageId = lower(MessageId)

Stage 6: join

| join InternetMessageId, user max=0
  [
  | search `o365_management_activity` Workload=Exchange Operation IN ("HardDelete") AND Folder.Path IN ("\\Sent Items","\\Recoverable Items\\Deletions")
  | spath path=AffectedItems{}  output=AffectedItemSplit
  | fields _time,ClientProcessName,ClientIPAddress,ClientInfoString,UserId,Operation,ResultStatus,MailboxOwnerUPN,AffectedItemSplit,Folder.Path
  | 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), subject = Subject
  ]

Stage 7: stats

| stats values(ClientIPAddress) as src, values(ClientInfoString) as http_user_agent, values(Folder.Path) as file_path, values(Operation) as signature, values(ResultStatus) as result, values(InternetMessageId) as signature_id, count, min(mailtime) as firstTime, max(deltime) as lastTime by user,subject

Stage 8: search

| `security_content_ctime(firstTime)`

Stage 9: search

| `security_content_ctime(lastTime)`

Stage 10: search

| `o365_email_receive_and_hard_delete_takeover_behavior_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Folder.Pathin
  • "\\Recoverable Items\\Deletions"
  • "\\Sent Items"
field:"m365::Folder.Path" kind:in
Operationin
  • "HardDelete"
field:"Operation" kind:in
Workloadeq
  • Exchange
field:"Workload" kind:eq value:"Exchange"
sourcetypeeq
  • o365:management:activity
field:"sourcetype" kind:eq value:"o365:management:activity"
sourcetypein
  • "ms:o365:reporting:messagetrace"
  • "o365:reporting:messagetrace"
field:"sourcetype" kind:in
subjectin
  • "*Account Recovery*"
  • "*MFA *"
  • "*OTP *"
  • "*banking*"
  • "*direct deposit*"
  • "*passcode *"
  • "*password *"
  • "*pay-to*"
field:"subject" kind:in