The Rule That Read the Invoices First: Hunting BEC Inbox Rules
The challenge
Halden paid a supplier invoice to a fraudster. Hunt the mailbox rules the attacker left. Name the address the invoices went to.
What you'll learn
- Explain how business email compromise uses inbox rules to hide and forward mail
- Read New-InboxRule parameters: From, ForwardTo, MoveToFolder, MarkAsRead
- Pivot on a suspicious session's IP to line up everything it created
- Tell legitimate forwarding rules from a malicious one, and spot a lookalike domain
- List the controls: forwarding policy, rule alerts, phishing-resistant MFA, call-back checks
Skills tested
Prerequisites
- What an inbox rule is
- Reading tabular log events
How it works
In business email compromise (BEC) the attacker does not steal money directly: they take over a mailbox that talks to suppliers or customers, wait for a real invoice, and then ask for payment to a new bank account. To do that unseen, they create inbox rules (MITRE ATT&CK T1114.003 and T1564.008).
Often there are two. One forwards the conversation they want to hijack (-From the supplier, -ForwardTo an address they control), named to blend in with the victim's own rules. The other hides it: -MoveToFolder into a folder nobody opens such as RSS Subscriptions, Archive or Conversation History, -MarkAsRead, with a name chosen to vanish in the list: ., .., a comma.
The Microsoft 365 unified audit log records each rule (New-InboxRule and Set-InboxRule from Outlook on the web or PowerShell, UpdateInboxRules from Outlook desktop) with its parameters, client and IP. Forwarding rules are common, so the useful move is to pivot: find the session that does not belong (a new IP and client right after an adversary-in-the-middle sign-in, as in Microsoft's 2022 and 2023 AiTM-to-BEC reports) and filter on it, so everything that session did lines up.
Common mistakes
- Answering [email protected]. That is the rules'
-Fromcondition: the real supplier whose mail is intercepted. The copies go to-ForwardTo. - Missing the lookalike. lindholrnsteel uses
rnwhere the real domain hasm. Read domains letter by letter, and give the exact mailbox, not just the domain. - Answering [email protected]. The DocuFlow capture rule was created by the IT admin over Exchange PowerShell from the office, for the shared ap@ mailbox, and announced by email two minutes later.
- Answering [email protected] or [email protected]. k.lund's personal copy breaks policy and the CFO's board-pack forward stays inside the company, but both come from the office and carry no supplier mail.
- Judging by the rule name. The forwarding rule is called "Supplier invoices", just like o.karlsson's legitimate one. Only the session it came from gives it away.
How to defend against it
- Keep external automatic forwarding off (outbound spam policy AutoForwardingMode Off). When a vendor really needs it, create a separate policy scoped to that one mailbox instead of changing the default for everyone.
- Alert on
New-InboxRule,Set-InboxRuleandUpdateInboxRulesthat forward or redirect outside, mark as read, delete, or move mail to RSS Subscriptions, Archive or Conversation History, especially from a new IP or client. - Use phishing-resistant MFA (FIDO2 keys, passkeys) and token protection so a relayed sign-in cannot be replayed.
- On a hit: delete every rule the session created, revoke sessions, reset the password, check every mailbox the same IP touched, and warn the supplier.
- Verify any change of bank details by calling a number you already had, never one from the email.