Detect Steal Web Session Cookie in Splunk
An adversary may steal web application or service session cookies and use them to gain access to web applications or Internet services as an authenticated user without needing credentials. Web applications and services often use session cookies as an authentication token after a user has authenticated to a website. Cookies are often valid for an extended period of time, even if the web application is not actively used. Session cookies can be found on disk in browser profile directories (SQLite databases), in the process memory of the browser, and in network traffic to remote systems. Tools such as Evilginx2 and Muraena act as adversary-in-the-middle proxies to capture session cookies from victims directed to phishing domains without the victim's endpoint ever being directly compromised. Malware families including Raccoon Stealer, QakBot, Spica, CookieMiner, Grandoreiro, and EVILNUM specifically target browser cookie stores for theft. Stolen session cookies can bypass multi-factor authentication by reusing authenticated sessions, enabling account takeover without requiring credentials.
MITRE ATT&CK
- Tactic
- Credential Access
- Technique
- T1539 Steal Web Session Cookie
- Canonical reference
- https://attack.mitre.org/techniques/T1539/
SPL Detection Query
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational"
(EventCode=11 OR EventCode=10)
| eval isCookieFileAccess=if(
EventCode="11" AND
(match(TargetFilename, "(?i)(Chrome.User.Data|Edge.User.Data|Firefox.Profiles|BraveSoftware.Brave-Browser|Opera.Software)")) AND
(match(TargetFilename, "(?i)(^|[\\/])Cookies$") OR match(TargetFilename, "(?i)cookies\.sqlite") OR match(TargetFilename, "(?i)Local State$") OR match(TargetFilename, "(?i)Login Data$")) AND
NOT match(Image, "(?i)(\\\\chrome\.exe|\\\\msedge\.exe|\\\\firefox\.exe|\\\\brave\.exe|\\\\opera\.exe|\\\\vivaldi\.exe|\\\\chromium\.exe|\\\\msedgewebview2\.exe|\\\\MsMpEng\.exe|\\\\SearchIndexer\.exe|\\\\svchost\.exe)"),
1, 0)
| eval isBrowserProcessInjection=if(
EventCode="10" AND
match(TargetImage, "(?i)(\\\\chrome\.exe|\\\\msedge\.exe|\\\\firefox\.exe|\\\\brave\.exe)") AND
NOT match(SourceImage, "(?i)(\\\\chrome\.exe|\\\\msedge\.exe|\\\\firefox\.exe|\\\\brave\.exe|\\\\MsMpEng\.exe|\\\\SgrmBroker\.exe|\\\\vmtoolsd\.exe|\\\\csrss\.exe)"),
1, 0)
| where isCookieFileAccess=1 OR isBrowserProcessInjection=1
| eval DetectionType=case(
isCookieFileAccess=1 AND isBrowserProcessInjection=1, "CookieFileAccess+BrowserInjection",
isCookieFileAccess=1, "BrowserCookieFileAccess",
isBrowserProcessInjection=1, "BrowserProcessInjection",
"Unknown")
| eval SuspicionScore=isCookieFileAccess + isBrowserProcessInjection
| eval SuspiciousProcess=coalesce(Image, SourceImage)
| eval TargetDetail=coalesce(TargetFilename, TargetImage)
| eval IsScriptHost=if(match(SuspiciousProcess, "(?i)(powershell|pwsh|cmd\.exe|wscript|cscript|mshta|python|node\.exe)"), 1, 0)
| table _time, host, User, DetectionType, SuspiciousProcess, TargetDetail, CommandLine, IsScriptHost, SuspicionScore
| sort - _time Detects browser cookie theft using Sysmon logs across two event types: Event ID 11 (FileCreate) to identify when non-browser processes write or access browser cookie files (Chrome/Edge Cookies, Local State, Login Data; Firefox cookies.sqlite), and Event ID 10 (ProcessAccess) to identify non-browser processes opening a handle to browser processes for memory-based cookie extraction. Both vectors are used by real infostealers — disk-based theft (QakBot, Raccoon, Spica) and memory-based injection (LuminousMoth, advanced stealers). The SuspicionScore field prioritizes alerts where both indicators fire simultaneously.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Enterprise backup agents performing scheduled user data backups that include browser profile directories — build allowlist by SourceImage/Image for known backup process paths
- Anti-malware and EDR agents performing in-memory process scanning that generate Event ID 10 against browser processes — exclude known vendor process paths
- IT management agents (SCCM, Tanium, CrowdStrike Sensor) that may open browser process handles during inventory or telemetry collection
- Browser profile migration tools used during device refresh or onboarding that copy cookie databases between profiles
- Security awareness testing platforms running authorized simulated phishing exercises that may trigger the detection
Other platforms for T1539
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 1Copy Chrome Cookie Database via CMD
Expected signal: Sysmon Event ID 11 (FileCreate): TargetFilename=%TEMP%\df00tech_test_cookies.db, Image=cmd.exe. DeviceFileEvents: ActionType=FileCreated, FileName=df00tech_test_cookies.db, FolderPath containing Chrome\User Data, InitiatingProcessFileName=cmd.exe. The source Cookies file read will appear as a separate FileAccess event for the Cookies file initiated by cmd.exe.
- Test 2Extract Chrome Cookies and Local State via PowerShell
Expected signal: Sysmon Event ID 1: powershell.exe Process Create with CommandLine containing Chrome\User Data and Copy-Item. Sysmon Event ID 11: Two FileCreate events — TargetFilename containing df00tech_chrome\LocalState and df00tech_chrome\Cookies, Image=powershell.exe. DeviceFileEvents: Two file access events for Local State and Cookies files, InitiatingProcessFileName=powershell.exe.
- Test 3Read Firefox Cookie Database via sqlite3
Expected signal: Sysmon Event ID 1: sqlite3.exe Process Create with CommandLine containing Firefox\Profiles, cookies.sqlite, and SELECT. Sysmon Event ID 11: TargetFilename=%TEMP%\df00tech_ff_cookies.txt, Image=sqlite3.exe. DeviceProcessEvents: FileName=sqlite3.exe, ProcessCommandLine contains moz_cookies. DeviceFileEvents: sqlite3.exe accessing cookies.sqlite within Firefox Profiles path.
- Test 4Linux Firefox Cookie Theft via File Copy
Expected signal: Linux auditd: syscall=openat with path containing .mozilla/firefox and cookies.sqlite, and syscall=open/write for /tmp/df00tech_ff_linux_cookies.sqlite. Syslog/auditd: process cp accessing Firefox profile path. Linux EDR agents: file access event for cookies.sqlite initiated by cp process.
References (10)
- https://attack.mitre.org/techniques/T1539/
- https://wunderwuzzi23.github.io/blog/passthecookie.html
- https://github.com/kgretzky/evilginx2
- https://github.com/muraenateam/muraena
- https://unit42.paloaltonetworks.com/mac-malware-steals-cryptocurrency-exchanges-cookies/
- https://securelist.com/project-tajmahal/90240/
- https://krebsonsecurity.com/2023/05/discord-admins-hacked-by-malicious-bookmarks/
- https://blog.talosintelligence.com/roblox-scam-overview/
- https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/advanced-hunting-devicefileevents-table
- https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/signinlogs
Unlock Pro Content
Get the full detection package for T1539 including response playbook, investigation guide, and atomic red team tests.