NEWNightwatch is live. Autonomous hunting and detection engineering. See how it works →
Back

How Nightwatch Caught a Mailbox Takeover Hiding Behind a Hidden Inbox Rule

Tim Peck

Written by Tim Peck · Director of Threat Research

How Nightwatch Caught a Mailbox Takeover Hiding Behind a Hidden Inbox Rule
Share on social
November 24, 20267 minute read

When an attacker gets into a Microsoft 365 mailbox, a common next step is to make the mailbox hide things from its owner. Creating a new inbox rule is one of these methods. This allows the attacker to move incoming mail to a folder nobody opens and marks it read, so replies, security notices and anything else that might give the intruder away never reach the inbox.

This particular threat hunt didn't start from a threat report, rather from a sub-set of rules that were already on Nightwatch's own hunt plan, and three hunts in the previous two weeks had traced the company's forwarding and hiding rules back to their owners. On November 19 it ran the hunt again, looking for:

A mailbox rule that hides mail, made right after a sign-in from somewhere new.

This time, one mailbox fit. Four days after its owner clicked a payroll-themed phishing link, someone signed in from a VPS, then from a never-before-seen address on a US internet provider. Minutes later a rule named "." appeared, moving mail to another hidden folder and then marking them read.

No SIEM or EDR alert triggered on the activity. The intruder didn't add an authenticator or register an app. A working sign-in and one rule were enough in this case.

The figure below shows how the hunt got from a list of inbox rules to the takeover:

The map groups the recorded evidence checks for readability and doesn't claim query order or timing. Customer identifiers are omitted. The footer covers what happened after the report.

Why attackers hide mail

MITRE ATT&CK tracks the technique as Email Hiding Rules (T1564.008). In April, Proofpoint reported that about 10% of the compromised accounts it saw in late 2025 got a malicious mailbox rule shortly after initial access.

Those rules usually carried throwaway names such as "." or ";" and moved mail to “Archive” or “Subscriptions”. Proofpoint also notes that the rules stay active after a password reset.

Payroll lures have a long record behind them. The FBI's IC3 warned about payroll diversion, where phished employee logins are used to redirect direct deposits. The M365 Token Spray and Replay report on the Intel Exchange shows a campaign that hid its activity behind rules named with one to three characters, in one case to cover a payroll fraud attempt.

Defenders have a hard time with both halves. People make inbox rules all the time, and a valid sign-in from a new address is routine for anyone with a phone, VPN or a travel schedule.

Nightwatch looked for the two correlating together.

Search for rules that hide mail

Nightwatch listed every inbox rule created or changed across the company's mailboxes over the past month that deletes mail, marks it read, forwards it or moves it to Deleted, Junk, Archive, Subscriptions or a history folder. The most recent changes were mostly Outlook client syncs with no rule details, so it widened to the full month and read the rules themselves.

The earlier hunts had already shown what normal looks like here: staff forwarding work mail to business partners or personal addresses, each rule made by the mailbox owner from an address they always use.

Join each rule to the sign-ins before it

Next, Nightwatch took every account that had made a hiding, deleting or forwarding rule and looked for sign-in addresses that account had used for the first time in the day before the rule.

The first pass was mostly mobile carrier addresses, which change daily, so Nightwatch regrouped the results by account and kept the new addresses from outside the country. One user had made rules named after an expense tool and a bank right after first signing in from two countries abroad. Nightwatch read that account's month of sign-ins and left it out of the finding.

Read the hiding rule

Another mailbox had no such explanation. Its owner's account had signed in from two addresses it had never used, and minutes later a rule named "." began moving incoming mail to a generic folder name and marking it read.

The mail audit log showed only a Microsoft front-end address for the rule, so Nightwatch read the cloud-app record of that evening's session to tie the rule to the new sign-ins. The two addresses were a VPS and a new address on a US internet provider, and no other account in the company had signed in from either.

The new address also downloaded a PDF attachment from the mailbox. It sent nothing. Everything the account sent afterwards was the owner's usual work mail, sent from the usual office address.

Trace the lure and the spread

Nightwatch then went back a week, when a payroll-themed phishing email reached the same inbox. The owner clicked its link, which led to a page on a third-party site and carried the owner's email address. No one else in the company clicked it making the event more rare.

Nightwatch reported the takeover at high severity with an impact report: contain the account and purge the payroll lure.

Keep watching after the report

The intruder's session kept refreshing for about three hours after the report. An administrator revoked the account's refresh tokens right after the last refresh, and no sign-in from that address followed.

A follow-up hunt the next day found no spread. Neither address had touched any other account, and no other mailbox had a rule shaped like the "." rule. It also flagged that no password reset had been recorded yet.

Determine a hiding rule from an ordinary one

Hiding, deleting and forwarding rules are common. Here, one person made about 14 rules in ten minutes, several forwarding mail to an outside bookkeeper, and staff routinely forward work mail to partners. These signals set the malicious rule apart:

  • The rule's shape. Filing rules name a sender or subject and move mail to a normal folder. This one sent mail to a generic folder, a folder that very few people ever open, and marked it read.
  • What came just before it. Legitimate rules came from the owner's usual address and device. This one followed, by minutes, the account's first-ever sign-in from a new address.
  • What that address was. A phone's carrier address changes daily within a familiar range. This was a VPS, then an internet-provider address no colleague had used.
  • The name. A single character such as "." matches what Proofpoint describes, but on its own it's a weak signal, better for ranking results than for deciding.
  • What followed. The new address downloaded an attachment from the mailbox.

Turn the finding into coverage

This finding came with a detection proposal.

  • Mail-hiding rule within a day of a first sign-in from a new address. It looks for a rule with no sender or subject condition, or one that moves mail to an obscure folder, that deletes, marks read or files the mail away, created up to 24 hours after the account first signed in from an address it hadn't used in the previous month. It keys on the rule's shape and the account's own sign-in history, never on an address or rule name, and leaves out ordinary filing rules. Run against a month of the team's telemetry, it fired once, on this account, and passed a second review.

Evidence scope

The material establishes that:

  • The account's owner clicked a payroll-themed phishing link on November 13.
  • A few days later, sign-ins from a VPS and a new internet-provider address came minutes before a rule named "." that moved mail to a newly-created generic folder and marked it read.
  • The new address downloaded a PDF attachment from the mailbox and sent no mail.
  • No other account used either address, clicked the lure or got a similar rule, and the account gained no new sign-in method or app consent.
  • No SIEM or EDR alert named the activity, and an administrator revoked the session about three hours after the report.

It doesn't establish how the sign-in got past the account's protections, what the intruder read, or what the attachment was. Sign-in records showing the authentication method, mailbox read auditing for the session, and the sender of the attachment would settle those.

Examine inbox rules in your own telemetry

Nightwatch's Adaptive Threat Discovery kept this pattern on its own hunt plan and ran it four times in two weeks. It reported the takeover the first time a hiding rule and a first-seen address lined up.

The free Nightwatch Risk Assessment includes a 30-day backtest of available telemetry. For this behavior, a good first question is which hiding rules in your tenant were created within a day of their account's first sign-in from a new address.

Talk to us about a free Nightwatch Risk Assessment.

Read more

Subscribe

Stay connected

Join the community that moves faster than the threat.

Subscribe to our newsletter