Detect Microsoft Entra ID Session Token Theft and Replay in Elastic Security
Session token theft (also called token replay or pass-the-cookie) is one of the most prevalent identity attacks targeting Microsoft 365 and Entra ID in 2025-2026. Adversaries use adversary-in-the-middle (AiTM) proxy frameworks (Evilginx2, Modlishka, Muraena, Tycoon 2FA, EvilProxy) to intercept valid session cookies from M365 sign-in flows, then replay those cookies to authenticate as the victim without needing their credentials or MFA code. The attack works because Microsoft's authentication cookies are bound to the browser session but not to the originating IP — replaying the cookie from a different IP is detected by Entra ID's risk engine but is not blocked by default. Scattered Spider and Storm-0539 are documented using this technique at scale against SMBs and mid-market organisations, primarily targeting financial fraud (payment diversion, payroll fraud) and IT admin compromise to then facilitate SIM swapping.
MITRE ATT&CK
- Tactic
- Credential Access Defense Evasion
Elastic Detection Query
sequence by user.name with maxspan=1h
[authentication where event.dataset == "azure.signinlogs" and
event.outcome == "success" and
azure.signinlogs.properties.authentication_requirement != "multiFactorAuthentication"] as e1
[authentication where event.dataset == "azure.signinlogs" and
event.outcome == "success" and
source.ip != e1.source.ip and
geo.country_name != e1.geo.country_name] EQL sequence detecting session token replay: two successful sign-ins within 1 hour where (a) first lacks MFA and (b) second is from a different IP and country — signature of AiTM proxy token theft.
Data Sources
Required Tables
False Positives & Tuning
- Multi-location users
- VPN users
Other platforms for THREAT-EntraID-TokenTheft
Testing Methodology
Validate this detection against 1 adversary technique from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Session Cookie Replay using Evilginx2 Captured Cookie
Expected signal: Azure AD Sign-in logs record a session established from the test IP without MFA, using the replayed cookie. Entra ID Identity Protection may generate an 'Unfamiliar sign-in properties' risk event.
References (5)
- https://www.microsoft.com/en-us/security/blog/2022/07/12/from-cookie-theft-to-bec-attackers-use-aitm-phishing-sites-as-entry-point-to-further-financial-fraud/
- https://www.ncsc.gov.uk/blog-post/phishing-attacks-mitm-proxies
- https://www.crowdstrike.com/blog/scattered-spider-aitm-phishing/
- https://attack.mitre.org/techniques/T1539/
- https://github.com/kgretzky/evilginx2
Unlock Pro Content
Get the full detection package for THREAT-EntraID-TokenTheft including response playbook, investigation guide, and atomic red team tests.