The Inbox Rule Hid The Evidence
The email was gone.
No deletion alert.
No warning.
No sign of the message in the inbox.
After a suspicious sign-in, a new inbox rule appeared.
Messages were quietly moved out of sight before anyone knew to investigate.
The evidence was not deleted. It was hidden.
This Agent Foskett investigation explores how defenders can use Microsoft Defender XDR, Exchange telemetry and KQL to uncover inbox rules used to conceal suspicious email activity after account compromise.

Briefing summary
Inbox rules can be used to quietly move, delete, forward or hide messages after a mailbox is compromised. The investigation should not stop because the email is no longer visible.
Why hidden inbox rules matter
First hunt: find inbox rule activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
CloudAppEvents | where Timestamp > ago(30d) | where ActionType has_any ("New-InboxRule", "Set-InboxRule", "UpdateInboxRules", "Create") | project Timestamp, AccountDisplayName, AccountObjectId, ActionType, IPAddress, Application, RawEventData | order by Timestamp desc
Second hunt: search for suspicious rule keywords
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
CloudAppEvents | where Timestamp > ago(30d) | where ActionType has_any ("InboxRule", "New-InboxRule", "Set-InboxRule") | extend RuleData = tostring(RawEventData) | where RuleData has_any ("invoice", "payment", "password", "mfa", "security", "bank", "payroll", "verification") | project Timestamp, AccountDisplayName, ActionType, IPAddress, Application, RuleData | order by Timestamp desc
When an inbox rule deserves deeper investigation
Third hunt: correlate inbox rules with suspicious sign-ins
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
let RuleEvents = CloudAppEvents | where Timestamp > ago(30d) | where ActionType has "InboxRule" | project RuleTime = Timestamp, AccountDisplayName, RuleAction = ActionType, RuleIP = IPAddress, RawEventData; RuleEvents | join kind=leftouter ( AADSignInEventsBeta | where Timestamp > ago(30d) | project SignInTime = Timestamp, AccountDisplayName, IPAddress, City, Country, DeviceTrustType ) on AccountDisplayName | where SignInTime between ((RuleTime - 2h) .. (RuleTime + 2h)) | order by RuleTime desc
Fourth hunt: pivot back to delivered email and clicks
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
EmailEvents | where Timestamp > ago(30d) | where RecipientEmailAddress has "user@contoso.com" | project EmailTime = Timestamp, NetworkMessageId, SenderFromAddress, RecipientEmailAddress, Subject, DeliveryAction, ThreatTypes | join kind=leftouter ( UrlClickEvents | project ClickTime = Timestamp, NetworkMessageId, Url, ActionType ) on NetworkMessageId | order by EmailTime desc
What a hidden inbox rule can prove
The Agent Foskett investigator mindset
How GEMXIT approaches mailbox investigations
Final thought
The suspicious email was not where anyone expected it to be.
The user thought it had disappeared.
But the rule told the story.
A mailbox rule had moved the evidence before the investigation started.
The evidence was not missing. It had been redirected.
It is: “What moved it, when, and who created the rule?”
Continue the investigation with The Inbox Rule Was Created At 2:13AM, The Link Was Clicked After The Email Was Delivered, The User Clicked Accept And Gave Away The Entire Mailbox, EmailEvents KQL Guide, Investigating EmailEvents in Microsoft Defender XDR, Microsoft Defender KQL Threat Hunting Complete Guide, Microsoft Defender and the GEMXIT Security Review.
Develop IT. Protect IT.GEMXIT PTY LTD | GEMXIT UK LTD
