THREAT-EntraID-TokenTheft Elastic Security · Elastic

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

Elastic Security (Elastic)
eql
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]
critical severity high confidence

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

Elastic Azure AD integration

Required Tables

logs-azure.signinlogs-*

False Positives & Tuning

  • Multi-location users
  • VPN users
Download portable Sigma rule (.yml)

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.

  1. 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.

Unlock Pro Content

Get the full detection package for THREAT-EntraID-TokenTheft including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections