T1550.004 Elastic Security · Elastic

Detect Web Session Cookie in Elastic Security

Adversaries steal and reuse valid web session cookies to authenticate to web applications and cloud services, effectively bypassing multi-factor authentication. Because session cookies represent a completed authentication event, they allow adversaries to impersonate users without knowing credentials or possessing their MFA device. Cookies are commonly obtained via adversary-in-the-middle (AiTM) phishing frameworks such as Evilginx2, Modlishka, or Muraena, which proxy the legitimate login flow and capture the post-MFA session token in real time. Once imported into an attacker-controlled browser or HTTP client, the stolen cookie grants full access to the victim's SaaS applications, cloud consoles, and email for the lifetime of the session. Star Blizzard (APT29 affiliate) has used this technique via EvilGinx to compromise email accounts protected by MFA.

MITRE ATT&CK

Tactic
Defense Evasion Lateral Movement
Technique
T1550 Use Alternate Authentication Material
Sub-technique
T1550.004 Web Session Cookie
Canonical reference
https://attack.mitre.org/techniques/T1550/004/

Elastic Detection Query

Elastic Security (Elastic)
eql
sequence by user.name with maxspan=60m
  [authentication where event.outcome == "success"
   and source.geo.country_name != null
   | fork
     (where true | as first_signin)
  ]
  [authentication where event.outcome == "success"
   and source.geo.country_name != null
   and source.geo.country_name != first_signin.source.geo.country_name
   | where source.ip != first_signin.source.ip
  ]
---
// Alternative: MFA bypass via cookie reuse detection
any where event.dataset == "azure.signinlogs"
  and event.outcome == "success"
  and azure.signinlogs.properties.authentication_requirement == "singleFactorAuthentication"
  and (
    azure.signinlogs.properties.authentication_details.authentication_step_result_detail : ("Previously satisfied", "Token broker", "existing token")
    or azure.signinlogs.properties.token_issuer_type == "AzureAD"
  )
  and azure.signinlogs.properties.app_display_name : ("Microsoft 365", "Office 365", "Azure Portal", "Microsoft Teams", "SharePoint", "OneDrive", "Exchange Online", "Outlook")
high severity medium confidence

Detects web session cookie theft and reuse via two complementary detection paths: (1) impossible travel where the same user authenticates successfully from two different countries within 60 minutes, indicating a stolen session cookie was replayed from an attacker-controlled location; (2) MFA bypass where authentication completes with single-factor authentication on a Microsoft 365/Azure application with a cookie-satisfaction result, indicating the attacker bypassed MFA by importing a stolen post-authentication session cookie. Covers AiTM phishing frameworks such as Evilginx2, Modlishka, and Muraena used by Star Blizzard/APT29.

Data Sources

Azure Active Directory Sign-in LogsElastic Security Azure IntegrationIdentity Provider Logs

Required Tables

logs-azure.signinlogs-*logs-azure.auditlogs-*

False Positives & Tuning

  • Legitimate business travelers or remote workers using VPNs with exit nodes in different countries than their physical location, creating false impossible travel alerts
  • Shared accounts or service accounts accessed by team members in different geographic regions within short windows during handoff periods
  • Conditional Access policies that explicitly allow single-factor authentication for certain applications or trusted named locations, which would generate MFA bypass signals that are authorized
Download portable Sigma rule (.yml)

Other platforms for T1550.004


Testing Methodology

Validate this detection against 4 adversary techniques 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 1Extract Chrome Session Cookies Using SQLite (Windows)

    Expected signal: Sysmon Event ID 11 (File Create): Target image %TEMP%\stolen_cookies.db created by cmd.exe or powershell.exe. Sysmon Event ID 1 (Process Create): powershell.exe with CommandLine referencing 'SQLiteConnection' and 'Cookies'. Sysmon Event ID 10 (Process Access): If Chrome is running, file access conflict may be logged. Security Event ID 4663 if file auditing is enabled on Chrome profile directories.

  2. Test 2Replay Stolen Session Cookie via Python Requests

    Expected signal: Network connection from python3 to httpbin.org on port 443. Linux audit log (auditd): SYSCALL record for socket/connect from python3 process. Syslog/EDR network telemetry showing python3 making outbound HTTPS connections with cookie headers in the User-Agent matching Windows browser patterns (OS mismatch indicator).

  3. Test 3Import Cookie to Browser via EditThisCookie and Access Authenticated Session

    Expected signal: Sysmon Event ID 1: python3.exe or playwright process spawned with CDP flags. Sysmon Event ID 3: Network connection from chromium subprocess to httpbin.org on port 443. Sysmon Event ID 23 (File Delete) or 11 (File Create) for Playwright browser cache. Security Event ID 4688 if process creation auditing enabled.

  4. Test 4Simulate AiTM Cookie Theft Detection via Impossible Travel Pattern

    Expected signal: Azure AD Sign-in Logs (SigninLogs): Two non-interactive token use events for the authenticated user against Microsoft Graph within seconds. OfficeActivity or CloudAppEvents: MailItemsAccessed or ListMessages operation from the Graph API call. Azure AD audit logs: Token issued and used for mail access.

Unlock Pro Content

Get the full detection package for T1550.004 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections