Having MFA on Microsoft 365 is no longer enough on its own. Phishing-as-a-service kits such as Mirage2FA, described by several security vendors in 2026, sit between the user and the real Microsoft sign-in page, let the user complete MFA, and keep the session cookie that comes back. The attacker then signs in as that user without ever seeing another prompt. Device code phishing and consent phishing reach the same result by other routes. This guide explains how each attack works and which Microsoft 365 and Entra ID settings stop it.
How adversary-in-the-middle kits get past MFA
An adversary-in-the-middle (AiTM) kit runs a proxy that shows the real Microsoft sign-in page through the attacker's server. The user types their password and approves the push or enters the code, Microsoft issues a session token, and the proxy keeps a copy. From then on the attacker holds a signed-in session to the user's mailbox, OneDrive and SharePoint.
Vendor reports on Mirage2FA describe the usual delivery tricks: HTML or SVG attachments that build the phishing page in the browser to slip past email filters, QR codes that move the victim to a phone, and messages sent from other organisations' compromised Microsoft 365 accounts, which pass sender checks. Codes by text, app codes and push approvals can all be relayed this way. Phishing-resistant methods cannot, because the key checks which website is asking.
Device code and consent phishing
Device code phishing abuses the sign-in flow built for TVs and command-line tools. The attacker starts a sign-in, gets a short code, and sends it to the victim with a believable reason to enter it at the genuine microsoft.com/devicelogin page. The victim signs in with full MFA on a real Microsoft page, and the attacker's device receives the tokens. Because the page is genuine, link-checking and user training do little.
Consent phishing asks the user to approve an app that requests access to their mail or files. Once approved, the app keeps that access through its own token, even after a password reset, until someone removes the grant.
The settings that stop these attacks
Most of these controls need Microsoft Entra ID P1, which is included in Microsoft 365 Business Premium. Risk-based policies need Entra ID P2.
- Phishing-resistant MFA: FIDO2 security keys, passkeys in Microsoft Authenticator or Windows Hello for Business. Enforce them with a Conditional Access authentication strength policy, starting with admins and finance staff.
- Require a compliant or hybrid-joined device for access, so a stolen session replayed from the attacker's machine is refused.
- Block the device code flow with Conditional Access for everyone except the few accounts and devices that genuinely need it.
- Restrict user consent to apps from verified publishers with low-risk permissions, and turn on the admin consent workflow for everything else.
- Block legacy authentication tenant-wide. Old protocols cannot do modern MFA and are still used in password spraying.
- Use sign-in risk and user risk policies to force reauthentication or block access when Entra ID flags a sign-in as risky.
- Keep session lifetimes reasonable for high-value roles and revoke sessions as part of every account recovery.
Email and endpoint layers
Turn on Defender for Office 365 Safe Links and Safe Attachments if your plan includes them, and quarantine HTML and SVG attachments from external senders, since few businesses need to receive them. Publish SPF, DKIM and DMARC for your own domains so attackers cannot send as you, and move DMARC towards quarantine or reject once your legitimate senders pass.
EDR on every laptop matters too. Some campaigns end with malware rather than a stolen session, and a compromised endpoint can steal tokens directly from the browser.
Detecting a hijacked Microsoft 365 session
Assume a session will be stolen eventually and watch for the signs. Most of them show up in Entra ID sign-in logs and the unified audit log.
- Sign-ins from a new country, hosting provider or anonymising network straight after a normal sign-in by the same user.
- New inbox rules that forward, delete or hide mail, especially rules matching words like invoice, payment or wire.
- New MFA methods registered on the account, or a new device code sign-in.
- New OAuth app consents or app registrations.
- Bulk downloads from OneDrive or SharePoint.
Responding to a compromised account
Speed matters, because attackers move to payment fraud within hours. Disable sign-in, revoke all sessions and refresh tokens, and reset the password. Then remove attacker inbox rules, MFA methods and app consents, check for mail sent from the account, and warn any customers or suppliers who received it.
If the account had admin rights, or you find more than one compromised user, treat it as an incident rather than a password reset and bring in help. Our incident response team handles Microsoft 365 account takeovers, and a 24x7 SOC can watch these signals continuously. For a review of your tenant's settings against the list above, see our managed security services.
Frequently asked questions
What is Mirage2FA?
Doesn't MFA stop it?
Do FIDO2 keys stop device code phishing?
Does a small business need Entra ID P1 for this?
Get your Microsoft 365 tenant reviewed
We check your tenant against these attacks, close the gaps in Conditional Access, consent and email settings, and set up the alerts that catch a stolen session early.

