The Inbox Rule Was Created At 2:13AM
The login itself did not trigger panic.
MFA succeeded. The account was not immediately disabled. No malware alert fired.
But at 2:13AM, a new inbox rule quietly appeared inside the mailbox.
The rule forwarded messages externally, moved replies into hidden folders and reduced the chance the user would notice suspicious activity.
This Agent Foskett investigation looks at how Microsoft 365 telemetry, OfficeActivity logs, AuditLogs and KQL can expose hidden mailbox persistence and post-authentication compromise behaviour.
The attacker did not need to stay logged in. The inbox rule continued doing the work for them.
Briefing summary
Inbox rules can become a hidden persistence mechanism after account compromise. GEMXIT investigates suspicious mailbox forwarding behaviour, hidden rules and post-authentication activity across Microsoft 365 environments.
What happened
Why SpoofedDomain and EmailEvents matter
First hunt: find spoofed or mismatched sender domains
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
OfficeActivity | where TimeGenerated > ago(14d) | where Operation in ("New-InboxRule", "Set-InboxRule") | project TimeGenerated, UserId, Operation, Parameters, ClientIP, UserAgent, ResultStatus | order by TimeGenerated desc
Second hunt: investigate suspicious forwarding behaviour
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
OfficeActivity | where TimeGenerated > ago(30d) | where Operation in ("Set-Mailbox", "New-InboxRule") | where Parameters has "Forward" | project TimeGenerated, UserId, Operation, Parameters, ClientIP, ResultStatus | order by TimeGenerated desc
Third hunt: correlate mailbox activity with suspicious sign-ins
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
SigninLogs | where TimeGenerated > ago(14d) | join kind=inner ( OfficeActivity | where Operation == "New-InboxRule" | project UserId, RuleCreated = TimeGenerated, ClientIP ) on $left.UserPrincipalName == $right.UserId | project TimeGenerated, RuleCreated, UserPrincipalName, IPAddress, Location, ConditionalAccessStatus, ClientIP | order by RuleCreated desc
What this kind of activity can indicate
How GEMXIT approaches spoofed email investigations
Final thought
“Was the login successful?”
It is:
“What changed afterwards?”
Continue the investigation with The Session Token Never Expired, The User Passed MFA But It Wasn't Really Them, The Login Came Through A Trusted Device, MFA Session Hijacking and The After-Hours Download.
Develop IT. Protect IT. GEMXIT PTY LTD | GEMXIT UK LTD