An infostealer hunt asks two linked questions: did malware on any of our endpoints harvest browser credentials and session cookies, and is anyone replaying what it took against our identity provider and cloud services? This guide turns those questions into a hunt you can run. It covers the hypotheses, the endpoint and identity data you need, illustrative query logic, a triage path and the containment steps that matter when a session, not just a password, has been stolen.
Infostealers sit at the start of many modern intrusions. They take saved passwords, cookies, tokens and sometimes API keys and cloud credentials from browsers and developer tools, then ship them to an operator who sells or uses them. MITRE ATT&CK describes the theft side as Credentials from Web Browsers (T1555.003) and Steal Web Session Cookie (T1539), and the replay side as Web Session Cookie (T1550.004). A replayed session cookie can skip both the password and multi-factor authentication, which is why this hunt has to cover both the endpoint and the identity layer.
The threat itself, its families and its economics are covered in the Infostealer Threat Guide. How stolen logs are used against sessions is covered in the Infostealer Logs and Session Token Abuse Guide. Programme-level hunting is in the Threat Hunting Guide. This page is the hunt itself.
Key takeaways
- Run two hunts that meet in the middle: an endpoint hunt for signs of infection and an identity hunt for signs of session and credential replay. Each one confirms or clears the other.
- On Windows endpoints, Sysmon process creation (event 1), network connection (3), file create (11), DNS query (22) and executable detected (29) give a free baseline of the telemetry an infection leaves behind, if you have configured them.
- On the identity side, Microsoft Entra ID Protection names detections that match stolen session use directly, including Anomalous token, Unfamiliar sign-in properties, Attacker in the Middle and Leaked credentials.
- A confirmed infection means every credential, cookie and token on that machine is compromised. Revoking sessions is as important as resetting passwords, and non-human secrets on developer machines must be rotated too.
- Hardware-bound sessions, such as Microsoft Entra token protection and Chrome Device Bound Session Credentials, reduce the value of stolen cookies and make replay easier to spot.
The hunt hypotheses
Write the hypotheses down first. Two work well together:
Hypothesis A (endpoint): "A process with no business reason has run from a user-writable location on one or more endpoints, read browser or application credential stores, packaged data and sent it to an external destination."
Hypothesis B (identity): "Session tokens or credentials belonging to our users or workloads are being used from devices, networks or locations that do not match the legitimate owner."
Break them into questions you can answer with data:
- Which endpoints ran new, rare or unsigned executables from Downloads, Temp or AppData folders in the window?
- Did any of those processes reach out to rare domains or IP addresses shortly after starting?
- Did any of them create archives or staging files in temporary folders?
- Which users show identity risk detections that point to token replay or credential leaks?
- Do any of those users map back to a suspicious endpoint from questions 1 to 3?
Set the window (start with 30 days), the scope (all managed Windows, macOS and developer endpoints, plus your identity provider and major SaaS tenants) and the success criteria. Record them in the Threat Hunt Hypothesis Backlog Template.
Data sources and readiness checks
Endpoint telemetry
Your endpoint detection and response (EDR) platform is usually the richest source, but its field names vary by vendor, so this guide uses Microsoft Sysmon event types as a neutral reference. Microsoft documents Sysmon as writing to Applications and Services Logs/Microsoft/Windows/Sysmon/Operational. The events that matter here are:
| Sysmon event | What it shows in this hunt |
|---|---|
| 1, Process creation | New executables, their paths, parents and command lines. |
| 3, Network connection | Outbound connections by process. Microsoft notes this is disabled by default, so check your configuration. |
| 11, FileCreate | Files created or overwritten, such as staging archives. |
| 22, DNSEvent | DNS queries by process, successful or failed. |
| 29, FileExecutableDetected | Creation of new executable files, useful for downloads that later run. |
| 15, FileCreateStreamHash | Named stream creation with hashes, which can capture download origin markers on files. |
Sysmon does not record ordinary file reads, so it will not show a process opening a browser cookie database. If your EDR records file access, add a query for non-browser processes reading browser profile stores. If it does not, rely on the surrounding signals: an odd process, odd network traffic and odd staging.
Identity telemetry
Interactive and non-interactive sign-in logs, risk detections and audit logs from your identity provider. For Microsoft Entra ID, the ID Protection risk detections table is the place to start. Retain non-interactive sign-ins: Microsoft notes in its detection descriptions that non-interactive sign-ins warrant more scrutiny because of token replay risk.
Readiness checklist
- Endpoint process, network and DNS telemetry present for the full window, including developer and contractor machines.
- Sysmon or EDR network connection logging confirmed enabled.
- Interactive and non-interactive sign-in logs retained and searchable.
- Risk detections exported to your SIEM, not only visible in a portal.
- A mapping from device to primary user, so endpoint and identity hits can be joined.
Endpoint hunt: signs of infection
All query logic below is illustrative pseudocode. Translate it to your EDR or SIEM schema.
Query 1: rare executables from user-writable paths
process_creation | where image_path in (Downloads, Temp, AppData, Public) | where signer is empty or untrusted | summarise device_count by image_hash | where device_count <= 3
Infostealers usually arrive as fake installers, cracked software, malicious advertisements or lure documents. They tend to be rare in your estate. Low prevalence plus a user-writable path is a strong starting filter.
Query 2: new process, fast outbound connection
join process_creation (from Query 1) with network_connection and dns_query on process_id and device | where connection_time within 5 minutes of process_start | where destination_domain is rare across estate
Stealers usually exfiltrate within minutes of running. Look for rare domains, newly registered domains, direct IP connections and messaging or paste services used from a process that is not a browser or the expected client.
Query 3: staging archives
file_create | where path in (Temp, AppData) | where extension in (zip, 7z, rar) | where creating_process is not a known archiver or backup agent
Many stealers bundle loot into an archive before upload. An archive created by an unknown process in a temporary folder, followed by an outbound connection, is a strong lead.
Query 4: browser processes spawned or terminated unusually
process_creation | where parent_image is not explorer or the browser itself | where image in (browser executables) | where command_line contains remote debugging or headless flags
Some stealers start browsers with debugging options to extract decrypted cookies. Any browser launched with remote debugging arguments by an unexpected parent deserves review.
Query 5: developer and cloud credential stores
If your EDR records file access, look for unexpected processes reading cloud CLI credential files, SSH keys, password manager vaults and source control token stores on developer machines. These are non-human identity secrets: one infected laptop can expose deployment keys and cloud access for whole environments.
Identity hunt: signs of stolen session use
Microsoft Entra ID Protection documents the following detections, which map closely to infostealer outcomes. Names and API values are as Microsoft lists them; licence requirements vary by detection.
| Detection | riskEventType | Why it matters here |
|---|---|---|
| Anomalous token | anomalousToken | Abnormal token characteristics such as unusual lifetime or use from an unfamiliar location; Microsoft notes it may indicate token replay. |
| Unfamiliar sign-in properties | unfamiliarFeatures | IP, ASN, location, device or browser unfamiliar for the user. |
| Attacker in the Middle | attackerinTheMiddle | Session linked to a malicious reverse proxy that can capture tokens. |
| Leaked credentials | leakedCredentials | Valid credentials found in a known leak and matched to current password hashes. |
| Atypical travel | unlikelyTravel | Two sign-ins from distant locations, at least one atypical. |
| Suspicious browser | suspiciousBrowser | Suspicious activity across multiple tenants from one browser. |
| Possible attempt to access PRT | attemptedPrtAccess | Possible attempt to access a Primary Refresh Token; Microsoft notes it requires Defender for Endpoint. |
| Suspicious credential addition | suspiciousCredentialAddition | A new authentication method added in suspicious circumstances, a common persistence step after session theft. |
Query 6: replay-pattern risk detections
risk_detections | where riskEventType in (anomalousToken, unfamiliarFeatures, attackerinTheMiddle, suspiciousBrowser, attemptedPrtAccess) | summarise by user, first_seen, source_ip, country
Query 7: same session, two places
sign_ins (interactive and non-interactive) | group by user and session identifier | where distinct device or distinct ASN > 1 within session lifetime
A session that appears on a managed device and then on an unmanaged device or hosting provider network is the clearest replay pattern. Pay special attention to non-interactive sign-ins, because replayed refresh tokens often appear there and nowhere else.
Query 8: post-replay persistence
audit_logs | where activity in (authentication method added, inbox rule created, OAuth consent granted, app credential added) | where actor in users from Queries 6 and 7
After replaying a session, attackers often add their own MFA method, create mail rules or grant an OAuth app access, so that they keep access after the cookie expires.
Joining the two hunts
The strongest findings come from correlation. Build a simple join: endpoint hits from Queries 1 to 5 mapped to the primary user of the device, matched against identity hits from Queries 6 to 8.
- Endpoint hit and identity hit for the same user: treat as a confirmed incident until proven otherwise.
- Identity hit only: the infection may be on an unmanaged or personal device where the user also signed in. Ask the user, and check whether the session originated from a managed device at all.
- Endpoint hit only: the stolen material may not have been used yet, or it may be used against services outside your logging. Treat the machine as compromised regardless.
Leaked credential detections and external infostealer log monitoring often surface infections on personal devices that you will never see in endpoint telemetry. The Infostealer Logs Monitoring and Response Guide covers that external feed.
Triage and containment
Step 1: scope the device
Identify the executable, how it arrived, when it ran and what it connected to. Find every other device where the same hash or domain appears.
Step 2: list what was exposed
Assume everything stored in browsers and local tools on the device is gone: saved passwords, cookies for every signed-in service, password manager sessions, cloud CLI credentials, SSH keys, API keys in configuration files and source control tokens. Build the list from the device's installed tools and the user's role.
Step 3: revoke sessions, then reset
Resetting a password does not by itself end an active session that was stolen as a cookie or refresh token. Revoke sessions and refresh tokens for the user in the identity provider and in major SaaS applications, then reset passwords, then review and remove any authentication methods, mail rules or OAuth grants added in the window.
Step 4: rotate non-human secrets
Rotate every API key, access key, deployment token and SSH key found on the machine. These rarely expire on their own and are often overlooked in user-centred incident response. Check provider logs for use of those secrets from new locations.
Step 5: rebuild and close
Reimage the device rather than cleaning it. Close the incident only when sessions are revoked, secrets rotated, persistence removed and the delivery vector blocked. Follow your incident process, aligned with NIST SP 800-61 Rev. 3.
Hardening that reduces the value of stolen sessions
- Token protection. Microsoft describes Conditional Access token protection as accepting only device-bound sign-in session tokens, such as Primary Refresh Tokens, so a stolen token cannot be used from another device. Microsoft lists native app support as generally available on Windows and preview support for some browser-based apps, and recommends starting in report-only mode with a pilot group.
- Device Bound Session Credentials. Google describes Chrome DBSC as binding sessions to a device key held in secure hardware such as a TPM where available, with short-lived cookies that are renewed only when the browser proves possession of the private key. Google notes it falls back to standard behaviour where secure key storage is not available, so coverage depends on hardware and on sites adopting it.
- Shorter sessions and continuous evaluation for high-value applications, so a stolen cookie has a short useful life.
- Managed devices only for access to sensitive applications, which narrows where replay can succeed and makes unmanaged-device sessions an alert in themselves.
- Keep secrets out of browsers and dotfiles. Use a secrets manager and short-lived workload credentials for developers instead of long-lived keys in local files.
- Block common delivery routes: software installs from unapproved sources, malicious advertising and cracked software.
Turning the hunt into detection
Promote the best queries once tuned:
- Rare unsigned executable from a user-writable path followed by a rare outbound connection within minutes.
- Browser launched with remote debugging arguments by an unexpected parent.
- Anomalous token or unfamiliar sign-in properties for a user whose device had an endpoint alert in the previous 14 days.
- Same session identifier seen from two different ASNs or devices.
- Authentication method added within 24 hours of a replay-pattern risk detection.
Rerun the hunt quarterly and after any major phishing or malvertising campaign against your sector. The Identity Threat Hunting Guide covers scheduling identity hunts as a programme.
Common failure patterns
- Password reset without session revocation. The attacker keeps the stolen session and carries on.
- Ignoring non-interactive sign-ins. Replayed refresh tokens often appear only there.
- Forgetting machine secrets. User passwords are reset but cloud keys, deployment tokens and SSH keys on the infected developer laptop stay valid.
- Cleaning instead of reimaging. Stealers often drop loaders or other payloads that outlive the stealer.
- Looking only at managed devices. Many infections happen on personal machines used to sign in to work services.
- Risk detections left in the portal. Detections that never reach the SIEM cannot be joined to endpoint data.
- Network logging assumed but not enabled. Sysmon network connection logging is off by default and gets missed.
Practitioner checklist
- Endpoint and identity hypotheses written down with window, scope and success criteria.
- Endpoint process, network, DNS and file creation telemetry confirmed for the full window.
- Interactive and non-interactive sign-ins and risk detections in the SIEM.
- Endpoint queries for rare executables, fast exfiltration, staging archives and browser debugging run and labelled illustrative.
- Identity queries for replay-pattern detections, split sessions and post-replay persistence run.
- Endpoint and identity results joined by device owner.
- Every confirmed case contained with session revocation, password reset, secret rotation and reimage.
- Token protection or device-bound sessions piloted for high-value applications.
- Best queries promoted to detection rules and the hunt scheduled to repeat.
Standards and references
- Microsoft Learn: What are risk detections? (Microsoft Entra ID Protection)
- Microsoft Learn: Token protection in Conditional Access
- Microsoft Learn: Sysmon
- Chrome for Developers: Device Bound Session Credentials
- MITRE ATT&CK: Credentials from Web Browsers (T1555.003)
- MITRE ATT&CK: T1539 Steal Web Session Cookie
- MITRE ATT&CK: Use Alternate Authentication Material: Web Session Cookie (T1550.004)
- NIST: SP 800-61 Rev. 3, Incident Response Recommendations and Considerations for Cybersecurity Risk Management
Related NHI Mgmt Group resources: Infostealer Logs and Session Token Abuse Guide · Infostealer Threat Guide · Session Hijacking and Cookie Theft Guide · Threat Hunting Guide