T1070.008
Clear Mailbox Data
Adversaries may modify mail and mail application data to remove evidence of their activity. Email applications allow users and other programs to export and delete mailbox data via command line tools or use of APIs. Adversaries may use Exchange PowerShell cmdlets (e.g., Remove-MailboxExportRequest, Search-Mailbox with DeleteContent), O365/Graph API calls, or command-line mail utilities on Linux/macOS to delete emails, purge Deleted Items, remove sent items, wipe transport rules, or remove export request logs. This covers tracks from phishing delivery, internal spearphishing, email-based C2, and email exfiltration.
Microsoft Sentinel / Defender
kusto
let SuspiciousMailboxCmdlets = dynamic([
"Remove-MailboxExportRequest",
"Remove-MailboxImportRequest",
"Search-Mailbox",
"New-ComplianceSearchAction",
"Remove-MoveRequest",
"Set-MailboxMessageConfiguration",
"New-TransportRule",
"Remove-TransportRule",
"Set-TransportRule",
"Disable-TransportRule",
"Remove-InboxRule",
"New-InboxRule",
"Set-InboxRule",
"Remove-RecoverableItemsCleanup"
]);
let DeleteContentPatterns = dynamic([
"-DeleteContent",
"-PurgeType HardDelete",
"-PurgeType SoftDelete",
"DeleteContent",
"HardDelete"
]);
// Branch 1: Exchange PowerShell cmdlets for mailbox manipulation
let ExchangePowerShell = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where ProcessCommandLine has_any (SuspiciousMailboxCmdlets)
| extend DetectionType = "ExchangePowerShell_MailboxManipulation"
| extend HasDeleteContent = ProcessCommandLine has_any (DeleteContentPatterns)
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
DetectionType, HasDeleteContent;
// Branch 2: Office 365 Unified Audit Log - mailbox purge/delete operations
let O365MailboxDelete = OfficeActivity
| where TimeGenerated > ago(24h)
| where Operation in (
"HardDelete",
"SoftDelete",
"MoveToDeletedItems",
"FolderBind",
"SendAs",
"MailboxLogin"
)
and Operation in ("HardDelete", "SoftDelete")
| extend DetectionType = "O365_MailboxItemDeletion"
| extend HasDeleteContent = true
| project TimeGenerated, UserId, Operation, ClientIP, MailboxOwnerUPN,
OfficeObjectId, ResultStatus, DetectionType, HasDeleteContent;
// Branch 3: Bulk or suspicious deletions in Exchange audit logs
let ExchangeAuditBulk = OfficeActivity
| where TimeGenerated > ago(24h)
| where RecordType == "ExchangeAdmin"
| where Operation in (
"Remove-MailboxExportRequest",
"Search-Mailbox",
"Remove-TransportRule",
"Disable-TransportRule",
"New-TransportRule",
"Remove-InboxRule",
"Set-InboxRule"
)
| extend DetectionType = "ExchangeAdmin_MailboxCoverage"
| extend HasDeleteContent = Operation has_any (DeleteContentPatterns)
| project TimeGenerated, UserId, Operation, ClientIP, ResultStatus,
Parameters, DetectionType, HasDeleteContent;
ExchangePowerShell
| union kind=outer (
O365MailboxDelete
| project Timestamp=TimeGenerated, DeviceName=UserId, AccountName=UserId,
FileName=Operation, ProcessCommandLine=OfficeObjectId,
InitiatingProcessFileName=ClientIP, InitiatingProcessCommandLine=MailboxOwnerUPN,
DetectionType, HasDeleteContent
)
| union kind=outer (
ExchangeAuditBulk
| project Timestamp=TimeGenerated, DeviceName=UserId, AccountName=UserId,
FileName=Operation, ProcessCommandLine=tostring(Parameters),
InitiatingProcessFileName=ClientIP, InitiatingProcessCommandLine=ResultStatus,
DetectionType, HasDeleteContent
)
| sort by Timestamp desc high severity
medium confidence
Data Sources
Application Log: Application Log Content Microsoft Defender for Endpoint: DeviceProcessEvents Office 365 Unified Audit Log: OfficeActivity Exchange Admin Audit Log
Required Tables
DeviceProcessEvents OfficeActivity
False Positives
- Legitimate Exchange administrators running Remove-MailboxExportRequest to clean up completed export jobs as part of routine mailbox management
- Compliance officers using Search-Mailbox -DeleteContent for approved legal hold or eDiscovery purge operations following documented procedures
- Automated retention policy enforcement systems (MRM/MFA policies) triggering HardDelete or SoftDelete operations in bulk across user mailboxes
- Help desk staff using Remove-InboxRule or Set-InboxRule to clean up spam filter rules or misconfigured user inbox rules
Last updated: 2026-04-13 Research depth: deep
References (13)
- https://attack.mitre.org/techniques/T1070/008/
- https://www.volexity.com/blog/2020/12/14/dark-halo-leverages-solarwinds-compromise-to-breach-organizations/
- https://cdn2.hubspot.net/hubfs/3354902/Cybereason%20Labs%20Analysis%20Operation%20Cobalt%20Kitty.pdf
- https://man7.org/linux/man-pages/man1/mailx.1p.html
- https://docs.microsoft.com/en-us/powershell/module/exchange/?view=exchange-ps#mailboxes
- https://www.microsoft.com/en-us/security/blog/2022/09/22/malicious-oauth-applications-used-to-compromise-email-servers-and-spread-spam/
- https://www.mandiant.com/resources/blog/apt42-charms-cons-and-compromises
- https://www.welivesecurity.com/en/eset-research/to-the-moon-and-back-s-lunar-landing-in-diplomatic-missions/
- https://learn.microsoft.com/en-us/exchange/policy-and-compliance/mail-flow-rules/mail-flow-rules
- https://learn.microsoft.com/en-us/powershell/module/exchange/remove-mailboxexportrequest
- https://learn.microsoft.com/en-us/powershell/module/exchange/search-mailbox
- https://learn.microsoft.com/en-us/microsoft-365/compliance/search-the-audit-log-in-security-and-compliance
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1070.008/T1070.008.md
Unlock Pro Content
Get the full detection package for T1070.008 including response playbook, investigation guide, and atomic red team tests.
Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance