Mailbox forwarding and inbox rules: the quiet sign of a compromised mailbox
After taking over a mailbox, attackers add rules that forward mail outside or hide replies in obscure folders. How to find these rules in Exchange Online and Google Workspace, block external forwarding, and respond.
Diagram
Rules an attacker leaves behind
Step 1 of 4
Rule
A new inbox rule moves messages and marks them read.
Name: "." Conditions: SubjectOrBodyContainsWords: invoice, payment, wire Actions: MoveToFolder: RSS Subscriptions; MarkAsRead: true
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
Odd rule names
- What fails
- Rules named with a dot or a single character are hard to notice.
- Who is affected
- The mailbox owner and their correspondents.
- What you would notice
- Rules with one-character names that move or delete mail.
- What you change
- Alert on New-InboxRule and Set-InboxRule with move or delete actions.
External forwarding
- What fails
- Mail forwarded to personal addresses leaks every message.
- Who is affected
- Everyone who emails the account.
- What you would notice
- ForwardingSmtpAddress to an external domain.
- What you change
- Block automatic external forwarding in the outbound policy.
Business email compromise
- What fails
- Rules hiding payment replies support invoice fraud.
- Who is affected
- Finance and vendors.
- What you would notice
- Rules matching invoice or payment keywords.
- What you change
- Train finance to confirm bank changes by phone.
Google Workspace
Admin console > Reporting > Audit and investigation > Gmail log events shows filter and forwarding changes. Disable automatic forwarding for organizational units that do not need it.
Check yourself
Recognition and the fix. Nothing here is a procedure.
A rule named "." moves mail containing "payment" to RSS Subscriptions. What is it for?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.
This page stands on its own. The lab and the glossary card are the next reading.