Steal Web Session Cookie
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.
What is T1539 Steal Web Session Cookie?
Steal Web Session Cookie (T1539) maps to the Credential Access tactic — the adversary is trying to steal account names and passwords in MITRE ATT&CK.
This page provides production-ready detection logic for Steal Web Session Cookie, covering the data sources and telemetry it touches: File: File Access, Microsoft Defender for Endpoint. The queries below are rated high severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Credential Access
- Technique
- T1539 Steal Web Session Cookie
- Canonical reference
- https://attack.mitre.org/techniques/T1539/
let LegitBrowserProcesses = dynamic([
"chrome.exe", "msedge.exe", "firefox.exe", "brave.exe",
"opera.exe", "vivaldi.exe", "chromium.exe", "msedgewebview2.exe",
"whale.exe", "iexplore.exe"
]);
let SystemAllowList = dynamic([
"SearchIndexer.exe", "MsMpEng.exe", "SgrmBroker.exe",
"backgroundTaskHost.exe", "WerFault.exe", "svchost.exe",
"TiWorker.exe", "TrustedInstaller.exe"
]);
// Primary: Non-browser process accessing browser cookie stores on disk
DeviceFileEvents
| where Timestamp > ago(24h)
| where (
FolderPath contains "Chrome\User Data"
or FolderPath contains "Edge\User Data"
or FolderPath contains "Firefox\Profiles"
or FolderPath contains "BraveSoftware\Brave-Browser"
or FolderPath contains "Opera Software\Opera Stable"
or FolderPath contains "Vivaldi\User Data"
)
| where FileName =~ "Cookies"
or FileName =~ "cookies.sqlite"
or FileName =~ "cookies.sqlite-wal"
or (FileName =~ "Local State" and FolderPath contains "User Data")
or FileName =~ "Login Data"
| where not (InitiatingProcessFileName in~ (LegitBrowserProcesses))
| where not (InitiatingProcessFileName in~ (SystemAllowList))
| extend AccountName = coalesce(RequestAccountName, InitiatingProcessAccountName)
| extend SuspicionReason = case(
FileName =~ "Local State",
"Chrome/Edge master encryption key (DPAPI-wrapped AES) accessed by non-browser process",
FileName =~ "Login Data",
"Browser saved credentials database accessed alongside cookie store — bulk stealer pattern",
FileName =~ "cookies.sqlite" or FileName =~ "cookies.sqlite-wal",
"Firefox cookie SQLite database accessed by non-browser process",
"Browser Cookies file accessed by non-browser process"
)
| extend IsScriptHost = InitiatingProcessFileName in~ ("powershell.exe", "pwsh.exe", "cmd.exe", "wscript.exe", "cscript.exe", "mshta.exe")
| extend IsCommonStealer = InitiatingProcessFileName in~ ("python.exe", "python3.exe", "node.exe", "ruby.exe", "perl.exe", "sqlite3.exe")
| project Timestamp, DeviceName, AccountName,
FileName, FolderPath, ActionType,
InitiatingProcessFileName, InitiatingProcessCommandLine,
InitiatingProcessParentFileName, SuspicionReason,
IsScriptHost, IsCommonStealer
| sort by Timestamp desc Detects non-browser processes accessing browser cookie stores on Windows using Microsoft Defender for Endpoint DeviceFileEvents. Monitors Chrome, Edge, Firefox, Brave, Opera, and Vivaldi cookie files and the Chrome/Edge Local State file (which contains the DPAPI-wrapped AES master key required to decrypt modern cookie values). Also flags access to Login Data, which infostealers typically harvest alongside cookies. Excludes known legitimate browser executables and Windows system processes. Annotates detections with suspicion context and flags script interpreters and common stealer tooling as higher-confidence hits.
Data Sources
Required Tables
False Positives
- Enterprise backup agents (Acronis, Commvault, Veeam) reading browser profile directories as part of user data backup — typically run under service accounts from known backup process names
- IT asset management or software inventory agents (SCCM, Tanium) enumerating browser profile directories to report installed browser versions
- Endpoint DLP solutions that monitor file access patterns for sensitive data leaving the browser profile directory
- Browser profile migration or sync utilities (e.g., migration tools used during workstation refresh) that legitimately copy cookie stores between profiles
- Anti-malware scanners performing scheduled or on-demand scans of browser profile directories for known malware signatures
- Developer tooling performing automated browser testing (Selenium WebDriver, Playwright) that may read or write browser profile data
Sigma rule & cross-platform mapping
The detection logic for Steal Web Session Cookie (T1539) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for T1539
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
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.
Response Playbook
Triage
- Identify the initiating process in full detail — absolute path, parent process, digital signature status, and whether it is a known application. Use DeviceImageLoadEvents to inspect loaded DLLs and look for unsigned modules or unexpected injection artifacts.
- Check the user account context — was the cookie file accessed by the same user account that owns the browser profile, or by a different account? Cross-account access is a high-confidence lateral movement indicator.
- Review the 10–30 minute window preceding the alert for a precursor event: phishing email opened, suspicious download from browser, malicious script execution, or unusual process creation chain leading to the flagged process.
- Examine outbound network connections from the initiating process (DeviceNetworkEvents where InitiatingProcessId matches) — look for connections to public IPs, especially to unusual ports or ASNs. Cookie exfiltration typically follows within minutes of theft.
- Identify which browser and which cookies were targeted — cloud management console cookies (AWS Console, Azure Portal, Okta, Google Workspace admin) carry significantly higher risk than generic browsing cookies and require immediate escalation.
- Check identity provider sign-in logs (SigninLogs for Azure AD, OfficeActivity for M365) for authentication events from new IP addresses or device fingerprints in the same time window — this confirms whether stolen cookies have already been replayed.
- Determine if the Local State file (Chrome/Edge DPAPI master key) was also accessed alongside the Cookies file — this is the modern infostealer pattern that enables offline cookie decryption.
Containment
- If infostealer confirmed: immediately isolate the endpoint from the network via EDR isolation or VLAN quarantine to stop ongoing exfiltration and prevent lateral movement.
- Force immediate session invalidation across all potentially compromised web services — for Microsoft 365 run: Revoke-AzureADUserAllRefreshToken -ObjectId <UPN>; for Google Workspace use Admin SDK or Admin Console to sign out all sessions; for Okta use Sessions API to terminate all active sessions.
- Reset all passwords for the affected user accounts and revoke all OAuth tokens and application passwords in each identity provider — stolen cookies often accompany stored credential theft.
- If Evilginx2 or proxy-based phishing is suspected as the vector: block the phishing domain at DNS and proxy levels immediately, and submit for domain takedown via your registrar abuse contact or threat intelligence platform.
- Enforce conditional access re-evaluation requiring MFA step-up from any new IP address or unrecognized device to prevent immediate cookie replay after the session is invalidated.
- If cloud service sessions were compromised: rotate any API keys, service principal credentials, or OAuth client secrets that were accessible during the active session to prevent post-compromise resource abuse.
Evidence Collection
- Browser cookie databases: Chrome/Edge at %LOCALAPPDATA%\Google\Chrome\User Data\Default\Network\Cookies (or \Microsoft\Edge\User Data\Default\Network\Cookies) — SQLite format; Firefox at %APPDATA%\Mozilla\Firefox\Profiles\*.default-release\cookies.sqlite
- Chrome Local State file: %LOCALAPPDATA%\Google\Chrome\User Data\Local State — the 'encrypted_key' JSON field (base64-encoded) contains the DPAPI-wrapped AES-256 master key used to decrypt cookie values with the 'v10' prefix
- Process memory dump of the suspicious process — capture with Task Manager, ProcDump, or EDR tooling for offline analysis; infostealer memory often contains raw cookie strings and C2 destination addresses
- Sysmon Event ID 11 (FileCreate) logs: precise timestamps when cookie files were accessed or copied, correlate with subsequent network activity
- Sysmon Event ID 3 (NetworkConnection) from the suspicious process: destination IP, port, and protocol for C2 or exfiltration connections
- Windows Prefetch: C:\Windows\Prefetch\<malware>.exe-*.pf — execution timestamps and list of files accessed by the process, confirming browser profile directory access
- Browser history and download records: determine if the initial access vector was a phishing page or malicious download; Chrome history at %LOCALAPPDATA%\Google\Chrome\User Data\Default\History
- Identity provider audit logs: Azure AD SigninLogs, Google Workspace Admin audit, Okta System Log — filter for the compromised UPN in the 30-minute window following the cookie access event to detect replay attempts
Escalation Criteria
- ! Cookie theft targeting cloud management console sessions (AWS Console, Azure Portal, GCP Console) — single compromised session can enable broad infrastructure access and persistence via IAM manipulation
- ! Stolen sessions for identity provider dashboards (Okta, Azure AD, Google Workspace Admin) — cookie replay in these contexts enables lateral movement to every application integrated with the IdP
- ! Evidence of impossible travel: successful sign-in from geographically distant IP within 60 minutes of the local endpoint cookie access event
- ! Multiple accounts on the same endpoint affected — indicates an automated credential stealer rather than targeted access, suggesting broader compromise scope
- ! Cookie access co-occurring with Login Data file access — the malware is performing bulk credential harvesting, not just session token theft; password reset scope must expand
- ! Financial, healthcare, or regulated-data service sessions compromised (banking portals, EHR systems, payment platforms) — may require regulatory incident notification under GDPR, HIPAA, or PCI-DSS
Investigation Guide
Forensic Artifacts
- >
Chrome/Edge cookie SQLite schema: columns host_key, name, encrypted_value, path, expires_utc, is_secure, is_httponly — encrypted_value bytes starting with 'v10' prefix indicate DPAPI+AES-GCM encryption used since Chrome 80 - >
Chrome Local State JSON: 'os_crypt.encrypted_key' field contains base64(DPAPI(AES-256 key)) — DPAPI decryption requires the user's Windows login credentials or DPAPI master key from LSASS - >
Firefox cookies.sqlite: table moz_cookies with columns host, name, value (plaintext in Firefox), expiry, isSecure, isHttpOnly — Firefox does not encrypt cookie values in the SQLite file - >
Windows Prefetch files: C:\Windows\Prefetch\<stealer>.exe-*.pf — lists all files opened by the process on first 10 runs, confirming browser profile directory access without requiring process memory - >
Windows Security Event ID 4663 (Object Access Auditing): if SACL auditing is configured on browser profile directories, records every file access with process name, PID, and timestamp - >
DNS cache artifacts: ipconfig /displaydns — may contain C2 hostnames resolved by the stealer during exfiltration; correlate with known stealer C2 infrastructure IOCs - >
Browser network traffic: if a network capture was running, cookies appear in HTTP Cookie and Set-Cookie headers in cleartext over HTTP, or can be extracted from TLS sessions using browser key logs (SSLKEYLOGFILE environment variable) - >
Windows DPAPI master keys: %APPDATA%\Microsoft\Protect\<SID>\<GUID> — if the attacker also obtained DPAPI master keys (e.g., via LSASS access), they can decrypt cookie values offline
Tuning Guidance
Start with the file access detection and baseline which non-browser processes legitimately touch browser profile directories in your environment. The most common false positive sources are enterprise backup agents (Acronis, Commvault — identify by service account name and known executable paths) and endpoint DLP tools. Build allowlists using InitiatingProcessFolderPath (full path to the binary, not just filename) to prevent masquerading bypass — do not allowlist by process name alone. For the process injection detection (Sysmon Event ID 10), the false positive rate will be higher due to anti-malware agents; use a vendor-specific exclusion list rather than broad pattern exclusions. For the impossible travel hunt, calibrate the time window to your organization's geographic spread — a 60-minute window is appropriate for single-country deployments but may generate false positives for remote workers using split tunneling or VPNs. Consider enriching SigninLogs impossible travel results with your corporate VPN egress IP ranges to suppress legitimate VPN-based sign-ins that appear geographically distant. Environments with heavy use of cloud browser profiles (Chrome Enterprise with profile sync) should validate that the sync process is excluded, as it may transiently write cookie data through a non-browser intermediary.
Hunting Queries
Hunt for processes accessing three or more distinct files in browser profile directories in a single session — a strong infostealer signature. Real infostealers (Raccoon, RedLine, Vidar) systematically harvest Cookies, Login Data, Web Data, History, and Local State in a single run. A high file count with short time span (BulkAccessRate) and access across multiple browser families indicates automated harvesting rather than incidental access.
// Hunt for bulk browser profile access — infostealer pattern of harvesting multiple databases
DeviceFileEvents
| where Timestamp > ago(7d)
| where FolderPath contains "Chrome\User Data"
or FolderPath contains "Edge\User Data"
or FolderPath contains "Firefox\Profiles"
or FolderPath contains "BraveSoftware\Brave-Browser"
| where not (InitiatingProcessFileName in~ ("chrome.exe", "msedge.exe", "firefox.exe", "brave.exe", "MsMpEng.exe", "SearchIndexer.exe", "svchost.exe"))
| summarize FileCount=count(),
UniqueFiles=dcount(FileName),
FileNames=make_set(FileName, 20),
Browsers=dcount(FolderPath),
EarliestAccess=min(Timestamp),
LatestAccess=max(Timestamp),
TimeSpanSeconds=datetime_diff('second', max(Timestamp), min(Timestamp))
by DeviceName, AccountName=coalesce(RequestAccountName, InitiatingProcessAccountName),
InitiatingProcessFileName, InitiatingProcessCommandLine
| where FileCount >= 3 or UniqueFiles >= 2
| extend BulkAccessRate = toreal(FileCount) / iff(TimeSpanSeconds < 1, 1.0, toreal(TimeSpanSeconds))
| sort by FileCount desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11
(TargetFilename="*Chrome*User Data*" OR TargetFilename="*Edge*User Data*" OR TargetFilename="*Firefox*Profiles*" OR TargetFilename="*BraveSoftware*Brave-Browser*")
NOT (Image="*\chrome.exe" OR Image="*\msedge.exe" OR Image="*\firefox.exe" OR Image="*\brave.exe" OR Image="*\MsMpEng.exe" OR Image="*\SearchIndexer.exe")
| stats count as FileCount, dc(TargetFilename) as UniqueFiles, values(TargetFilename) as FileNames,
earliest(_time) as EarliestAccess, latest(_time) as LatestAccess
by host, User, Image, CommandLine
| where FileCount >= 3 OR UniqueFiles >= 2
| eval AccessDuration=LatestAccess - EarliestAccess
| sort - FileCount Hunt for processes that both accessed browser cookie files and made outbound network connections within a 5-minute window. This temporal correlation is the most reliable indicator of successful exfiltration — the process read the cookie store then transmitted data to attacker infrastructure. Filters for non-standard ports and paste/messaging service domains known to be used as cookie exfiltration channels (Telegram bot API, Discord webhooks, Pastebin-style services).
// Hunt for cookie file access followed by outbound network connection — exfiltration correlation
let CookieAccess = DeviceFileEvents
| where Timestamp > ago(7d)
| where FolderPath contains "Chrome\User Data" or FolderPath contains "Firefox\Profiles" or FolderPath contains "Edge\User Data"
| where FileName =~ "Cookies" or FileName =~ "cookies.sqlite" or FileName =~ "Local State"
| where not (InitiatingProcessFileName in~ ("chrome.exe", "msedge.exe", "firefox.exe", "MsMpEng.exe"))
| project CookieTime=Timestamp, DeviceName, AccountName=coalesce(RequestAccountName, InitiatingProcessAccountName),
InitiatingProcessFileName, InitiatingProcessId;
let OutboundConns = DeviceNetworkEvents
| where Timestamp > ago(7d)
| where RemoteIPType == "Public"
| where not (RemotePort in (80, 443))
or RemoteUrl has_any ("paste", "cdn", "discord", "telegram")
| project NetTime=Timestamp, DeviceName, RemoteIP, RemotePort, RemoteUrl,
InitiatingProcessFileName, InitiatingProcessId;
CookieAccess
| join kind=inner OutboundConns
on DeviceName, InitiatingProcessId, InitiatingProcessFileName
| where NetTime between (CookieTime .. (CookieTime + 5m))
| project CookieTime, NetTime, DeviceName, AccountName,
InitiatingProcessFileName, RemoteIP, RemotePort, RemoteUrl,
SecondsBetween=datetime_diff('second', NetTime, CookieTime)
| sort by CookieTime desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" (EventCode=11 OR EventCode=3)
| eval isCookieFile=if(EventCode="11" AND (match(TargetFilename, "(?i)(Chrome|Edge).User.Data") OR match(TargetFilename, "(?i)Firefox.Profiles")) AND match(TargetFilename, "(?i)(Cookies|cookies\.sqlite|Local State)"), 1, 0)
| eval isNetworkConn=if(EventCode="3" AND NOT match(DestinationIp, "^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.|127\.0\.)"), 1, 0)
| where isCookieFile=1 OR isNetworkConn=1
| eval ProcKey=mvindex(split(Image, "\\"), -1).":".ProcessId
| stats sum(isCookieFile) as CookieReads, sum(isNetworkConn) as ExternalConns,
values(TargetFilename) as CookieFiles, values(DestinationIp) as DestinationIPs,
values(DestinationPort) as Ports
by host, User, Image
| where CookieReads > 0 AND ExternalConns > 0
| sort - CookieReads Hunt for impossible travel patterns in Azure AD sign-in logs — a high-confidence indicator of Evilginx2 or proxy-based session cookie replay. When a stolen session cookie is replayed from attacker infrastructure, it appears as a successful sign-in from a geographically distinct IP address within a physically impossible travel window. This query detects the same user successfully authenticating from two different countries/regions within 60 minutes. This vector is specific to adversary-in-the-middle cookie theft where the victim's endpoint never runs malware.
// Hunt for impossible travel in Azure AD — indicator of Evilginx2/cookie replay attacks
let window = 60min;
SigninLogs
| where TimeGenerated > ago(7d)
| where ResultType == 0
| where isnotempty(IPAddress)
| project TimeGenerated, UserPrincipalName, IPAddress, Location,
AppDisplayName, DeviceDetail, AuthenticationDetails,
RiskLevelDuringSignIn, ConditionalAccessStatus
| join kind=inner (
SigninLogs
| where TimeGenerated > ago(7d)
| where ResultType == 0
| project Time2=TimeGenerated, UserPrincipalName,
IP2=IPAddress, Location2=Location, App2=AppDisplayName
) on UserPrincipalName
| where Time2 > TimeGenerated
| where Time2 < TimeGenerated + window
| where IPAddress != IP2
| where Location != Location2
| extend MinutesBetween = datetime_diff('minute', Time2, TimeGenerated)
| where MinutesBetween < toint(window / 1m)
| project FirstSignin=TimeGenerated, UserPrincipalName,
FirstIP=IPAddress, FirstLocation=Location, FirstApp=AppDisplayName,
SecondSignin=Time2, SecondIP=IP2, SecondLocation=Location2, SecondApp=App2,
MinutesBetween
| sort by MinutesBetween asc index=azure sourcetype="azure:aad:signin" ResultType=0 IPAddress=*
| eval LoginTime=_time
| sort 0 UserPrincipalName, LoginTime
| streamstats current=f last(LoginTime) as PrevLoginTime last(IPAddress) as PrevIP last(Location) as PrevLocation last(AppDisplayName) as PrevApp by UserPrincipalName
| eval MinutesSincePrev=round((LoginTime - PrevLoginTime) / 60, 1)
| where isnotnull(PrevLoginTime) AND PrevIP!=IPAddress AND PrevLocation!=Location
| where MinutesSincePrev > 0 AND MinutesSincePrev < 60
| table _time, UserPrincipalName, PrevIP, PrevLocation, PrevApp, IPAddress, Location, AppDisplayName, MinutesSincePrev
| sort MinutesSincePrev Atomic Red Team Tests
Copies the Chrome cookie SQLite database to a temp directory using cmd.exe — a non-browser process — simulating the disk-based cookie theft pattern used by infostealers such as Raccoon Stealer, RedLine, and Vidar. The Chrome browser must be closed for the file to be unlocked. This is the most common infostealer approach: copy the file, then decrypt offline using the Local State master key.
Command
cmd.exe /c copy "%LOCALAPPDATA%\Google\Chrome\User Data\Default\Network\Cookies" "%TEMP%\df00tech_test_cookies.db" 2>&1 Cleanup
cmd.exe /c del "%TEMP%\df00tech_test_cookies.db" 2>nul Expected Telemetry
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.
Expected Detection
KQL: DeviceFileEvents fires — FileName=Cookies, FolderPath contains Chrome\User Data, InitiatingProcessFileName=cmd.exe (not in LegitBrowserProcesses list). SPL: EventCode=11, TargetFilename matches Chrome.User.Data and Cookies pattern, Image=cmd.exe. SuspicionReason field set to 'Browser Cookies file accessed by non-browser process'.
Uses PowerShell to copy both the Chrome Cookies database and Local State file (containing the DPAPI-wrapped AES-256 master key) to a temp directory. This simulates the complete modern infostealer pattern — both files are required to decrypt cookie values encrypted with the 'v10' prefix (Chrome 80+). Seen in Raccoon Stealer v2, Redline, and Lumma Stealer behavior.
Command
powershell.exe -NoProfile -Command "$dest = Join-Path $env:TEMP 'df00tech_chrome'; New-Item -ItemType Directory -Force -Path $dest | Out-Null; $profile = Join-Path $env:LOCALAPPDATA 'Google\Chrome\User Data'; Copy-Item (Join-Path $profile 'Local State') -Destination (Join-Path $dest 'LocalState') -ErrorAction SilentlyContinue; Copy-Item (Join-Path $profile 'Default\Network\Cookies') -Destination (Join-Path $dest 'Cookies') -ErrorAction SilentlyContinue; Write-Host 'Done:' (Get-ChildItem $dest | Select-Object -ExpandProperty Name)" Cleanup
powershell.exe -NoProfile -Command "Remove-Item -Path (Join-Path $env:TEMP 'df00tech_chrome') -Recurse -Force -ErrorAction SilentlyContinue" Expected Telemetry
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.
Expected Detection
KQL: Two DeviceFileEvents alerts fire — one for Local State access (SuspicionReason='Chrome master encryption key accessed'), one for Cookies access. InitiatingProcessFileName=powershell.exe, IsScriptHost=true. SPL: EventCode=11 matches both files, IsScriptHost eval=1. Both files accessed by same non-browser process in rapid succession is the bulk-stealer pattern.
Uses the sqlite3 command-line tool to directly query the Firefox cookies.sqlite database and output cookie data, simulating how infostealers like Spica and QakBot read Firefox cookie values (which are stored in plaintext, unlike Chrome). Requires sqlite3.exe to be present; download from sqlite.org if needed.
Command
for /f "tokens=*" %p in ('dir /b "%APPDATA%\Mozilla\Firefox\Profiles" 2^>nul ^| findstr /i "default-release"') do @sqlite3.exe "%APPDATA%\Mozilla\Firefox\Profiles\%p\cookies.sqlite" "SELECT host, name, value FROM moz_cookies LIMIT 5" > "%TEMP%\df00tech_ff_cookies.txt" 2>&1 Cleanup
del "%TEMP%\df00tech_ff_cookies.txt" 2>nul Expected Telemetry
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.
Expected Detection
KQL: DeviceFileEvents fires — FileName=cookies.sqlite, FolderPath contains Firefox\Profiles, InitiatingProcessFileName=sqlite3.exe (flagged as IsCommonStealer=true). SPL: EventCode=11 matches Firefox.Profiles and cookies.sqlite pattern with Image=sqlite3.exe. Process creation alert also fires on sqlite3.exe CommandLine containing browser profile path.
Copies the Firefox cookie SQLite database to /tmp on Linux, simulating cookie theft by malware running as the current user. Firefox on Linux stores cookies in plaintext SQLite format, making them immediately readable without any decryption. Used in Linux-targeting infostealers and post-exploitation frameworks.
Command
cp ~/.mozilla/firefox/*.default-release/cookies.sqlite /tmp/df00tech_ff_linux_cookies.sqlite 2>/dev/null || cp ~/.mozilla/firefox/*.default/cookies.sqlite /tmp/df00tech_ff_linux_cookies.sqlite 2>/dev/null; ls -la /tmp/df00tech_ff_linux_cookies.sqlite Cleanup
rm -f /tmp/df00tech_ff_linux_cookies.sqlite Expected Telemetry
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.
Expected Detection
Linux detection requires auditd rules configured to watch Firefox profile directories: auditctl -w ~/.mozilla/firefox -p r -k browser_cookie_access. Alerts fire on file reads of cookies.sqlite by non-firefox processes. Correlate with subsequent network connection from the parent script to identify exfiltration.
Related Detections
Tactic Hub
Detection Variants (1)
Different telemetry and tradecraft for the same technique — pick the one that matches the data you collect.