Attacker-in-the-middle phishing proxy
A reverse proxy sits between the user and the real login page, relays every step of authentication including MFA, and keeps the session cookie the successful login produces.
How it works
The victim clicks a link to a page the attacker controls. That page is not a copy of the login screen, it is a reverse proxy in front of the real one. An adversary-in-the-middle kit such as Evilginx, published in 2017, terminates TLS on a lookalike domain, opens its own TLS connection to the genuine identity provider, and rewrites hostnames in every request and response so the two halves stay in step. The victim sees the authentic login flow, including their own tenant branding and their own MFA prompt, because the HTML really did come from the identity provider a few milliseconds earlier.
Every field the victim submits is forwarded upstream: username, password, the one-time code, the push approval, the "stay signed in" answer. When authentication succeeds, the identity provider sets its session cookies on the response. In Microsoft Entra ID those are the ESTSAUTH family of cookies on login.microsoftonline.com; in other providers they are whatever cookie marks the session as authenticated. The proxy copies them before passing the response along, then usually redirects the victim to a harmless page or the real application so nothing looks wrong.
The attacker imports the cookies into their own browser and is signed in as the victim. They never need the password again and never face another MFA challenge, because the cookie records that MFA was already satisfied. From there the usual next steps are mailbox access, inbox rules to hide replies, payment fraud, and registering a new MFA method or device so access survives a password reset.
This is sold as a service. ANY.RUN traced the Mirage2FA toolkit across 4,532 unique organization email domains between 2024 and 2026. The Kratos kit, taken down by German, US and Indonesian authorities in July 2026, used a Node.js reverse proxy and had about 1,800 paying customers. CloudSEK found that the Evilginx-based BigBear 2.0 service went a step further and injected JavaScript that disabled WebAuthn in the victim's browser, so the victim fell back to a factor the proxy could relay.
Why it works
Every authentication factor except an origin-bound credential produces something that can be forwarded. A one-time code, a push approval, and a password are all values the victim hands over, and a relay does not care what the value is. The victim's own judgment is the only origin check in the loop, and a lookalike domain on a page with correct branding defeats it routinely.
The control assumption that fails is that completing authentication proves presence at the legitimate service. It does not. It proves the user completed a challenge, and the challenge never verified who was asking. Phishing-resistant MFA closes this because a FIDO2 or WebAuthn authenticator signs a challenge that includes the origin the browser actually loaded, so the proxy receives a signature scoped to the lookalike domain, which the real service rejects. The BigBear downgrade shows the corollary: phishing resistance only holds if the weaker methods are switched off for that account, not merely available beside it.
The second assumption that fails is that a session cookie is only ever presented by the browser that earned it. Most session cookies are bearer tokens, so once copied, they work from the attacker's machine exactly as they did from the victim's.
How to detect it
- Identity provider risk detections. Entra ID Protection raises an "Attacker in the Middle" detection (
attackerinTheMiddle) when an authentication session is linked to a malicious reverse proxy, and "Anomalous token" (anomalousToken) when a session token is replayed from an unfamiliar location. Both appear in theRiskEventTypes_V2column of theSigninLogstable. - Session issued in one place, used in another. In Entra sign-in logs, group by
SessionIdand look for the same session appearing from a differentIPAddressorAutonomousSystemNumberwithin minutes of the interactive sign-in, especially where the second ASN is a hosting provider. Huntress hunted the 2026 replay campaign by looking forOAuth2:Tokenrequests from hosting infrastructure with barenodeorMozilla/5.0user agents. - Okta. The System Log event
security.session.detect_client_roamingfires when Okta sees a roaming session, anduser.session.context.changerecords a significant change in device or network context on an active session. - Persistence right after sign-in. A new MFA method (
user.mfa.factor.activatein Okta, "User registered security info" in Entra audit logs), a new device registration, or a new inbox rule within an hour of a sign-in from an unfamiliar ASN is the follow-on pattern in most AiTM incident reports. - Lookalike domains. Newly registered domains resembling your tenant or IdP name in mail gateway and DNS telemetry.
Be honest about the limits: a legitimate user on a corporate VPN, a mobile network or a split-tunnel setup can produce the same IP change between sign-in and use, so session roaming needs correlation rather than a blocking rule. The "Attacker in the Middle" detection is calculated offline, so it tends to fire after the cookie has already been used. Detection here is mostly about shortening attacker dwell time, not preventing the first sign-in. See what is ITDR.
How to stop it
- Make origin-bound credentials the only allowed method. Passkeys and FIDO2 security keys defeat the relay outright. Enforce them with an authentication strength policy in conditional access so no phishable fallback remains, which is what the BigBear downgrade exploited. Check which of your SaaS apps can actually require them in the MFA matrix.
- Require a compliant or managed device for token issuance. A proxy cannot present the victim's device state from the attacker's machine.
- Bind sessions to the device. Entra Token Protection, device-bound session credentials in the browser, and DPoP for API tokens make a lifted cookie fail elsewhere.
- Require step-up for persistence actions. Registering a new MFA method or device should demand a fresh, phishing-resistant authentication, since that is how attackers turn one stolen session into durable access.
- Rehearse full session revocation. A password reset leaves the stolen session alive. Revoke sessions and refresh tokens, then remove unrecognized devices and MFA methods separately. See token theft and the identity incident response runbook.
Seen in the wild
- AiTM phishing campaign against more than 10,000 Microsoft 365 organizations (2022): Microsoft reported proxy sites capturing passwords and session cookies, then business email compromise from the stolen mailboxes.
- Dropbox GitHub repositories stolen via CircleCI-themed phishing (2022): staff passed one-time codes from hardware tokens to a fake login page, and 130 repositories were copied. Dropbox moved to WebAuthn afterward.
- Stolen Microsoft 365 session tokens replayed into 79 organizations (2026): Huntress tied the tokens to AiTM and device-code phishing, followed by rogue Entra device registration and MFA method swaps.
- Mirage2FA reached 4,500 organizations by stealing sessions instead of breaking MFA
- Kratos phishing-as-a-service dismantled after relaying Microsoft 365 logins
- BigBear disabled WebAuthn in the browser to force a phishable fallback
Adversary-in-the-middle proxies account for 3 of the 25 MFA bypasses in the Identity Breach Report 2026, part of the 13 bypasses in which a person handed over or approved access, the pattern the report calls a talk-past attack.
Sources
- MITRE ATT&CK T1557: Adversary-in-the-Middle
- MITRE ATT&CK T1539: Steal Web Session Cookie
- MITRE ATT&CK T1550.004: Use Alternate Authentication Material: Web Session Cookie
- Microsoft Security: From cookie theft to BEC, attackers use AiTM phishing sites (July 2022)
- Microsoft Entra ID Protection: risk detection types
- Microsoft Entra: Token Protection in Conditional Access
- Huntress: token replay into 79 Microsoft 365 organizations
- Evilginx 2 (Kuba Gretzky)
- CISA: Implementing Phishing-Resistant MFA
In the Identity Breach Database
Real incidents in our sourced breach database where this technique was used.
- Stolen Microsoft 365 session tokens replayed into 79 organizations 2026 · Phishing (adversary-in-the-middle)
- Dropbox GitHub repositories stolen via CircleCI-themed phishing 2022 · Phishing (adversary-in-the-middle)
- AiTM phishing campaign against more than 10,000 Microsoft 365 organizations 2022 · Phishing (adversary-in-the-middle)
Related on Start with Identity
- Blog39% of identity CVEs are on CISA KEV, and edge appliances hold 62% of the exploited ones
SWI's Identity Vulnerability Report 2026 checked 137 identity CVEs against CISA's Known Exploited Vulnerabilities catalog and NVD. 53 are exploited, most of the
- PodcastAuth0
The late Vittorio Bertocci's interviews with the authors of OAuth, OpenID Connect, FIDO, and SAML. Ended in 2022, and still the best audio archive on identity s
- CVECisco SAML 2.0 mixes authorization domains
Cisco's SAML 2.0 implementation did not keep authorization domains apart. A token or assertion meant for one domain could authorize in another. May 2024. The pr
- BlogExploited NetScaler SAML zero-day forces a second upgrade after the September patch
CVE-2026-88779 crashes NetScaler ADC and Gateway appliances configured as a SAML service provider or identity provider. Exploited before the fix, on CISA KEV si
- CVEFortiCloud SSO SAML bypass on FortiOS, FortiProxy, FortiSwitchManager
A crafted SAML message bypasses FortiCloud SSO (CWE-347). Arctic Wolf saw malicious logins three days after disclosure. CISA added it to KEV on 16 December 2025
- BlogFortinet's January SSO bypass hit boxes already patched for December's SAML bug
CVE-2026-24858 is the follow-on FortiCloud SSO SAML bypass. Devices patched for CVE-2025-59718 and 59719 were still exploitable. Actively exploited. CISA guidan