Investigation · Cloud
What did the attacker read, send and change in this mailbox?
Scope a Microsoft 365 business email compromise: the attacker's sessions, what mail they read or synced, what they sent, and the rules and forwarding they left behind.
When you would ask thisA Microsoft 365 account is confirmed or strongly suspected compromised and you need a defensible account of mailbox read, send and configuration activity for notification and eviction.
Steps
- 1
Pin the attacker's sessions from the sign-in logs
Start in Entra sign-in logs and separate the attacker from the user by IP address, ASN, user agent and device. Record the SessionId (also called the session identifier) for each malicious sign-in; you will use it to tie later mailbox activity back to the intruder. In the Unified Audit Log (UAL), mailbox records carry an AppAccessContext that can include a session-like identifier. The correlation between that UAL context and the Entra sign-in SessionId is not always one-to-one and depends on the auth path, so treat a match as supporting evidence and confirm the join in your tenant rather than assuming it.
Entra interactive sign-ins for the user, with session and device detail (Sentinel KQL)SigninLogs | where TimeGenerated > ago(30d) | where UserPrincipalName =~ "[email protected]" | project TimeGenerated, IPAddress, AutonomousSystemNumber, UserAgent, AppDisplayName, ResultType, SessionId, CorrelationId | order by TimeGenerated asc - 2
Determine what mail was read with MailItemsAccessed
MailItemsAccessed (an Exchange item in the UAL, part of the mailbox auditing baseline on supported licenses) is your read record. The key field is MailAccessType: Bind means specific messages were opened and the records list the affected InternetMessageId values; Sync means an entire folder was synchronized to a client, so you must assume every item in that folder was obtained, not just what is itemized. Watch the throttle: once a mailbox generates more than ~1,000 MailItemsAccessed records in 24 hours, logging for it is throttled and stops for 24 hours, and affected records are marked IsThrottled true. A throttled window means you cannot bound reads from the log alone.
- 3
Check for mailbox search activity
Attackers often search a mailbox for terms like 'wire', 'invoice', 'password' or 'MFA' before acting. SearchQueryInitiatedExchange records the search terms run against a mailbox, which is high-value for intent. This operation generally requires Microsoft 365 / Microsoft Purview Audit (Premium) rather than the standard tier, so it may be absent on standard licensing; confirm your audit tier in the tenant before concluding the attacker did not search. The equivalent for SharePoint/OneDrive is SearchQueryInitiatedSharePoint.
- 4
Enumerate what was sent from the mailbox
Pivot to send activity in the UAL. The Send operation records mail sent as the mailbox owner; SendAs records mail sent as the mailbox by another principal; SendOnBehalf records delegated sending. For each, capture the timestamp, the sending client/IP where present and, where available, the message subject and recipients. Sent items that do not appear in the user's Sent Items folder (the attacker deleted them) are a strong indicator, so reconcile UAL Send events against the actual folder contents rather than trusting the folder alone.
- 5
Hunt inbox rules and mailbox forwarding
Inbox rules are the classic BEC foothold. In the UAL look for New-InboxRule, Set-InboxRule and UpdateInboxRules. Flag rules that move mail to low-attention folders (RSS Feeds, Conversation History, Archive, or Deleted Items), that set DeleteMessage or MarkAsRead, that forward or redirect externally, or that filter on keywords such as a vendor name or 'invoice'. Separately, Set-Mailbox can enable mailbox-level forwarding via ForwardingSmtpAddress with DeliverToMailboxAndForward; this is independent of inbox rules and is easy to miss. Pull current rules live with hidden rules included, because attacker rules are frequently created hidden.
List inbox rules including hidden rules (Exchange Online PowerShell)# Connect-ExchangeOnline first Get-InboxRule -Mailbox [email protected] -IncludeHidden | Select-Object Name, Enabled, Priority, MoveToFolder, DeleteMessage, MarkAsRead, ForwardTo, RedirectTo, ForwardAsAttachmentTo, From, SubjectContainsWords # Mailbox-level forwarding (separate from inbox rules): Get-Mailbox [email protected] | Select-Object ForwardingSmtpAddress, ForwardingAddress, DeliverToMailboxAndForward - 6
Check for OAuth consent grants and new MFA methods
An attacker who wants durable access beyond a password often consents a malicious application or registers their own authentication method. In the UAL / Entra audit logs look for 'Consent to application' and 'Add app role assignment grant to user' (OAuth grants), and for new MFA/security-info registration on the account during the incident window. A newly consented app with mail read/send scopes keeps access after a password reset, and a new MFA method lets the attacker back in after you revoke sessions, so both must be removed as part of eviction, not just the password.
- 7
Scope file access in SharePoint and OneDrive
BEC frequently extends to the files the account could reach. In the UAL (OfficeActivity / exposed as CloudAppEvents in Defender) look for FileDownloaded and FileSyncDownloadedFull, which indicate bulk retrieval or a full OneDrive sync by the attacker's client. FileAccessed shows opens without download. Join these to the attacker's IP, user agent and (where it correlates) session so you report only the files the intruder touched, and so a legitimate client sync by the real user is not misattributed to the attacker.
Attacker file downloads from OfficeActivity (Sentinel KQL)OfficeActivity | where TimeGenerated > ago(30d) | where UserId =~ "[email protected]" | where Operation in ("FileDownloaded", "FileSyncDownloadedFull") | where ClientIP in ("<attacker-ip-1>", "<attacker-ip-2>") | project TimeGenerated, Operation, OfficeObjectId, SourceFileName, ClientIP, UserAgent | order by TimeGenerated asc
Where it goes wrong
- MailItemsAccessed with MailAccessType Sync means a whole folder was synchronized, so treat every item in that folder as read; do not report only the itemized messages.
- The MailItemsAccessed throttle stops recording for a mailbox for 24 hours after it exceeds ~1,000 records in 24 hours (records are flagged IsThrottled), so a quiet period can be throttling, not inactivity.
- SearchQueryInitiatedExchange generally requires Purview Audit (Premium); on standard licensing it is absent, and absence is not evidence the attacker did not search. Confirm your audit tier.
- Correlating the UAL AppAccessContext to the Entra sign-in SessionId is not guaranteed one-to-one across all auth paths; verify the join in your tenant before relying on it to attribute activity.
- Default mailbox audit retention is commonly 90 days (longer only with Audit Premium / retention policies or E5), so an incident discovered late may have lost the earliest activity; check the tenant's retention before concluding nothing happened.
- Attacker inbox rules are often created hidden and sent mail is often deleted, so use Get-InboxRule -IncludeHidden and reconcile UAL Send events against Sent Items rather than trusting the folder views.
Beyond event logs
Message trace
Exchange Online message trace (Get-MessageTrace / Get-MessageTraceDetail; the admin center for > 10 days)
Independent record of mail flow in and out of the mailbox, including externally forwarded copies. Useful to confirm what a forwarding rule actually delivered and to whom, when sent items were deleted.
eDiscovery / Content Search
Microsoft Purview eDiscovery (Content Search over the mailbox)
Lets you retrieve the actual messages the attacker read or sent by InternetMessageId, and to search for the sensitive terms found in SearchQueryInitiatedExchange, for impact assessment and notification.
Enterprise application consent
Entra admin center: Enterprise applications and App registrations (and the account's registered authentication methods)
Shows applications the user consented and their granted scopes, and the MFA methods registered on the account. Both are persistence that survive a password reset and must be removed during eviction.