Security

Mirage2FA: The Microsoft 365 Phishing Kit That Bypasses Conventional MFA

OrasecAugust 26, 20264 min read

Written by the OraSec security research team — offensive security engineers and penetration testers.

mirage2fa-microsoft-365-phishing

<span style="white-space: pre-wrap;">Mirage2FA turns a Microsoft 365 phishing page into a live relay, capturing the session cookie after the user has already passed MFA.</span>

Your user got the phishing email and was careful. They checked the login page, entered their password, approved the MFA prompt, and signed in.

The attacker could then reuse the stolen authenticated session.

What Is Mirage2FA?

Mirage2FA is a phishing-as-a-service toolkit built to steal Microsoft 365 credentials and sessions through adversary-in-the-middle (AiTM) attacks. ANY.RUN attributes the Mirage2FA brand/operator to "LinX Coders" based on recurring LINX markers, bot names, and related infrastructure. (ANY.RUN)

An AiTM attack does not guess the password or defeat the MFA code. It sits between the user and Microsoft, relaying everything in real time. The victim genuinely logs in, and the attacker copies the session cookie that login produces.

How Does the Attack Work?

The chain is short and entirely browser-based:

  1. A phishing email delivers an .htm, .xhtml, or .svg attachment, or a QR code
  2. Opening it runs obfuscated script that decodes the recipient's email address
  3. The script fetches harvesting logic from the attacker's infrastructure
  4. A counterfeit Microsoft 365 login page appears, backed by a reverse proxy
  5. The victim enters their username, password, and MFA challenge or code
  6. Credentials relay to real Microsoft services over a WebSocket
  7. Authentication succeeds, and the attacker captures the session cookie
  8. The stolen session may let the attacker access Microsoft 365 without repeating the password and MFA flow until the session is revoked, expires, or is otherwise invalidated

No malware executable is involved. ANY.RUN's samples were dominated by browser-readable files. Obfuscation was especially common in the .htm samples: 453 of 629 were obfuscated. ANY.RUN also observed obfuscated .xhtml and .svg samples.

Why Does It Matter?

MFA remains worth having. It is not sufficient on its own here, because the attack does not target the second factor. It targets what the second factor produces.

ANY.RUN identified 9,426 targeted email addresses, with 4,532 potentially compromised, or about 48%. Its dataset contained 9,332 potential compromise events, including 4,561 cookie-theft events, 3,044 password/2FA events, and 1,339 SSO logins. (ANY.RUN)

63.7% of the identified victims were in the United States. Technology accounted for 19.2% of observed activity, manufacturing 11.1%, and education 9.9%. (ANY.RUN)

Common Mistakes

  • Treating MFA as the finish line. It raises the cost of an attack but does not close this route.
  • Resetting the password and stopping there. A password reset alone may not remove stolen session access. Response teams should revoke active sessions and tokens and investigate activity performed through the account. (ANY.RUN)
  • Trusting attachment type as a safety signal. An .svg is treated as an image but can carry script.
  • Assuming users will spot the page. The proxy serves genuine Microsoft content, so it looks right.
  • Not checking what happened after access. After session theft, review mail-forwarding rules and OAuth grants because they may provide additional or persistent access. ANY.RUN specifically recommends checking both during response. (ANY.RUN)

How to Reduce the Risk

  • Move high-risk accounts to phishing-resistant authentication such as passkeys/FIDO2 security keys, Windows Hello for Business, or certificate-based authentication (Microsoft Learn)
  • Block or quarantine .htm, .xhtml, and .svg email attachments where feasible
  • Use Conditional Access, Continuous Access Evaluation, and Microsoft Entra Token Protection where supported. Do not rely on shorter token lifetimes alone. Microsoft notes that CAE can revoke access near real time after critical events, while Token Protection reduces token replay by binding supported tokens to a device. (Microsoft Learn)
  • Alert on unusual sign-in locations, impossible travel, and new OAuth grants
  • Treat session theft as an identity incident, not a password incident
  • Train staff that a successful login does not prove the page was genuine

What Should Security Testing Cover?

Ask your testers to establish:

  • Whether a proxied login page can capture a working session for your tenant
  • What a stolen session reaches before an alert fires
  • Whether session revocation is part of your response process
  • Which accounts still rely on OTP-based MFA
  • Whether new mail rules or OAuth grants would be noticed

How OraSec Can Help

OraSec tests the identity layer the way attackers approach it. We assess how far a captured session reaches, whether detection catches the sign-in, and whether your response actually invalidates access. You get a demonstrated path, not a policy review.

Conclusion

Mirage2FA is not a new idea, but it is a well-packaged one sold as a service and used at scale.

The lesson is narrow and useful. If your MFA produces a session cookie that can be relayed, MFA alone is not enough. Move critical accounts to phishing-resistant methods and make token revocation part of your standard response.

FAQs

Does MFA still help? Yes. It stops credential stuffing and password reuse. It does not stop a real-time proxy that captures the resulting session.

Would passkeys have prevented this login-relay attack? Phishing-resistant passkeys use origin-bound public-key cryptography, so credentials created for the real Microsoft sign-in origin cannot simply be replayed through an attacker-controlled phishing origin. (Microsoft Learn)

Why are SVG files a problem? SVG is an image format that can also contain active script when opened as a document. Mirage2FA used SVG files as browser-based stagers, so security teams should not automatically treat .svg attachments as harmless. (ANY.RUN)

How do we know if we were affected? Review sign-in logs for unfamiliar locations or devices, and check for mail-forwarding rules and OAuth grants nobody asked for.

Explore related services

Need hands-on help? Our security testing services put this research into practice.

CI/CD Security Best Practices: A Checklist for Your Pipeline

CI/CD Security Best Practices: A Checklist for Your Pipeline

CI/CD security best practices protect the system that builds and ships your code. Your pipeline holds cloud keys, signing certificates, and write access to production, which makes it one of the most valuable targets an attacker can reach. One leaked token or poisoned dependency can push malicious code to every customer. This checklist covers 12 controls to put in place, the real breaches behind them, and how to test whether they hold. What is CI/CD security? The controls that protect your bui

·7 min read
Broken Access Control: 6 Real Examples Found in Pentests

Broken Access Control: 6 Real Examples Found in Pentests

Broken access control happens when an app lets a user do something they shouldn't, like read another customer's invoice or open an admin page. It is the top risk in the OWASP Top 10:2025, and it shows up in almost every web app pentest. Scanners rarely catch it because the requests look normal. Below are 6 real examples testers find again and again, how each one gets found, and how to fix it. What is broken access control? A flaw that lets users act outside their permissions, such as viewing

·7 min read
10 Penetration Testing Myths That Leave Businesses Exposed
Penetration Testing

10 Penetration Testing Myths That Leave Businesses Exposed

Penetration testing myths cost companies real money. Some teams skip testing because they fear downtime. Others think a clean scan or a compliance checkbox means they are safe. Neither is true. A penetration test is a controlled, authorized attack run by a human expert to show how a real attacker could get in. Below are the 10 most common myths, what actually happens during a test, and what a good one should deliver. Is AI taking over pentesting? No. AI speeds up recon and scanning, but human

·7 min read