Detect Web Session Cookie in IBM QRadar
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
- Sub-technique
- T1550.004 Web Session Cookie
- Canonical reference
- https://attack.mitre.org/techniques/T1550/004/
QRadar Detection Query
-- Impossible Travel Detection
SELECT
DATEFORMAT(MIN(starttime), 'YYYY-MM-dd HH:mm:ss') AS firstSeen,
DATEFORMAT(MAX(starttime), 'YYYY-MM-dd HH:mm:ss') AS lastSeen,
username,
'ImpossibleTravel' AS detectionType,
COUNT(*) AS signinCount,
LONG(MAX(starttime) - MIN(starttime)) / 60 AS windowMinutes
FROM events
WHERE
LOGSOURCETYPENAME(devicetype) ILIKE '%Azure%'
AND CATEGORYNAME(category) ILIKE '%Authentication%'
AND username IS NOT NULL
AND username != ''
AND "IBM QRadar Field" = 'Success'
GROUP BY username, DATEFORMAT(starttime, 'YYYY-MM-dd HH')
HAVING
COUNT(DISTINCT sourcegeographiccountry) > 1
AND LONG(MAX(starttime) - MIN(starttime)) < 3600
UNION ALL
-- MFA Bypass via Cookie Reuse Detection
SELECT
DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS firstSeen,
DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS lastSeen,
username,
'MFABypassViaCookie' AS detectionType,
1 AS signinCount,
0 AS windowMinutes
FROM events
WHERE
LOGSOURCETYPENAME(devicetype) ILIKE '%Azure%'
AND CATEGORYNAME(category) ILIKE '%Authentication%'
AND LOGSOURCETYPENAME(devicetype) ILIKE '%Active Directory%'
AND QIDNAME(qid) ILIKE '%sign%'
AND ("authenticationRequirement" = 'singleFactorAuthentication' OR "AuthenticationRequirement" = 'singleFactorAuthentication')
AND (
LOWER("authStepResultDetail") LIKE '%previously satisfied%'
OR LOWER("authStepResultDetail") LIKE '%token broker%'
OR LOWER("authStepResultDetail") LIKE '%existing token%'
)
AND (
LOWER("appDisplayName") LIKE '%microsoft 365%'
OR LOWER("appDisplayName") LIKE '%office 365%'
OR LOWER("appDisplayName") LIKE '%azure portal%'
OR LOWER("appDisplayName") LIKE '%microsoft teams%'
OR LOWER("appDisplayName") LIKE '%sharepoint%'
OR LOWER("appDisplayName") LIKE '%onedrive%'
OR LOWER("appDisplayName") LIKE '%exchange%'
OR LOWER("appDisplayName") LIKE '%outlook%'
)
ORDER BY firstSeen DESC
LAST 24 HOURS QRadar AQL detection for T1550.004 web session cookie theft using two approaches: impossible travel detection aggregating Azure AD sign-in events by user per hour and flagging when multiple distinct countries appear within a 60-minute window, and MFA bypass detection identifying successful authentications where the authentication requirement was single-factor but the session was satisfied by an existing token/cookie on Microsoft 365 or Azure workloads. Targets AiTM phishing kit activity from threat actors including Star Blizzard.
Data Sources
Required Tables
False Positives & Tuning
- VPN users whose traffic egresses from a different country than their physical location, particularly corporate split-tunnel VPNs or proxy configurations that shift apparent geolocation
- Automated service principals or application accounts performing programmatic authentication across multiple Azure regions, which may satisfy authentication via existing delegated tokens
- Conditional Access policies configured to allow passwordless or certificate-based single-factor authentication for privileged users, legitimately producing single-factor authentication events
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.
- 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.
- 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).
- 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.
- 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.
References (10)
- https://attack.mitre.org/techniques/T1550/004/
- https://wunderwuzzi23.github.io/blog/passthecookie.html
- https://unit42.paloaltonetworks.com/mac-malware-steals-cryptocurrency-exchanges-cookies/
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-347a
- https://learn.microsoft.com/en-us/azure/active-directory/reports-monitoring/concept-sign-ins
- https://learn.microsoft.com/en-us/microsoft-365/security/defender/advanced-hunting-cloudappevents-table
- https://learn.microsoft.com/en-us/microsoft-365/compliance/audit-mailitemsaccessed
- https://github.com/kgretzky/evilginx2
- 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://techcommunity.microsoft.com/t5/microsoft-entra-blog/how-to-break-the-aitm-phishing-chain/ba-p/3557300
Unlock Pro Content
Get the full detection package for T1550.004 including response playbook, investigation guide, and atomic red team tests.