What is SharpChrome?
SharpChrome is a Chromium-based browser credential extraction tool built as a subproject of SharpDPAPI. It specializes in decrypting saved passwords, cookies, and state keys from Chrome, Edge, Brave, and Slack applications that use Chromium’s credential storage system.Supported Applications
Google Chrome
Original Chromium browser - cookies and login data
Microsoft Edge
Chromium-based Edge browser credentials
Brave Browser
Privacy-focused Chromium browser data
Slack
Slack desktop application credentials
Key Features
- Logins
- State Keys
- Domain Operations
Extract Browser Cookies:
- Decrypt saved session cookies
- Filter by cookie name or URL with regex
- Export in EditThisCookie JSON format
- Set cookies to never expire for persistence
Chrome 80+ Architecture Changes
Starting with Chrome 80, Google changed how credentials are encrypted:SharpChrome automatically detects Chrome versions and uses the appropriate decryption method. For Chrome 80+, it first decrypts the AES state key, then uses it to decrypt cookies and logins.
Command Overview
logins
Extract and decrypt saved login credentials from Chromium-based browsers.cookies
Extract and decrypt browser cookies for session hijacking or analysis.statekeys
Extract and decrypt AES state keys required for Chrome 80+ decryption.backupkey
Retrieve the domain DPAPI backup key from a domain controller (same as SharpDPAPI).Decryption Methods
- Automatic (CryptUnprotectData)
- Domain Backup Key
- User Credentials
- Masterkey Mappings
When run from an unelevated context, SharpChrome automatically uses CryptUnprotectData() to decrypt the current user’s data:Requirements:
- Running in target user’s context
- No elevation needed
- Only decrypts current user’s data
Common Arguments
- Decryption
- Targeting
- Output
| Argument | Description |
|---|---|
/unprotect | Force CryptUnprotectData() (default when unprivileged) |
/pvk:BASE64... | Use base64-encoded domain backup key |
/pvk:key.pvk | Use domain backup key file |
/password:X | Decrypt using plaintext password |
/ntlm:X | Decrypt using NTLM hash |
/prekey:X | Use DPAPI prekey (from Mimikatz) |
/rpc | Decrypt by asking domain controller |
{GUID}:SHA1 ... | Use explicit masterkey mappings |
/statekey:X | Use pre-decrypted AES state key |
Cookie Hijacking Workflow
1
Extract Target Cookies
2
Import into Browser
- Install EditThisCookie extension
- Navigate to target site (e.g., github.com)
- Click EditThisCookie icon
- Click import button
- Paste JSON output from SharpChrome
3
Access Target Account
Refresh the page - you’re now authenticated as the target user
Typical Workflows
Scenario 1: Current User Context
Scenario 1: Current User Context
Scenario 2: Local Admin on Workstation
Scenario 2: Local Admin on Workstation
Scenario 3: Domain Admin - Mass Triage
Scenario 3: Domain Admin - Mass Triage
Scenario 4: Chrome 80+ Offline Analysis
Scenario 4: Chrome 80+ Offline Analysis
Lockless Database Access
SharpChrome uses a modified C# SQLite library that supports lockless opening of databases. This means Chrome/Edge does not need to be closed, and database files don’t need to be copied to another location before analysis.
- No need to close browser before extraction
- Direct access to live databases
- Reduced forensic footprint
- Faster operations
- Uses WAL (Write-Ahead Logging) mode
- Read-only access to database
- No interference with running browser
Detection Considerations
Host-Based Detection
Host-Based Detection
File Access Indicators:
- Reading Chrome/Edge/Brave user data directories
- Accessing Login Data and Cookies SQLite databases
- Reading Local State files
- Accessing user DPAPI masterkey folders
- SharpChrome.exe execution
- Unusual SQLite database access patterns
- Non-browser processes accessing browser data
Network Detection
Network Detection
- SMB access to browser data on remote systems
- MS-BKRP protocol for backup key retrieval
- DC RPC calls for domain backup key
Behavioral Detection
Behavioral Detection
- Bulk access to multiple users’ browser data
- Accessing browser databases while browser is running
- Reading Local State files for state key extraction
- Simultaneous access to DPAPI and browser data
Defensive Measures
Defensive Measures
Detection:
- Monitor access to browser data directories
- Alert on non-browser processes accessing SQLite databases
- Track DPAPI masterkey folder access
- Detect domain backup key retrieval
- Use hardware tokens for critical accounts
- Implement browser extensions that require re-authentication
- Monitor for cookie theft/session hijacking
- Regular credential rotation
SQLite Library
SharpChrome uses a minimized, modified version of a C# SQLite library that supports:- Lockless database opening
- Read-only access mode
- WAL mode support
- Direct file access without copying
SharpChrome is built as a separate project in the SharpDPAPI solution due to the size of the SQLite library.
BCrypt Implementation
SharpChrome includes a minimized version of @AArnott’s BCrypt P/Invoke code released under the MIT License for AES state key decryption.Prerequisites
Build Requirements
Build Requirements
- Visual Studio 2019 Community Edition or later
- .NET Framework 3.5 (default target)
- Can be retargeted to .NET 4.0 or 4.5
- Larger binary size due to SQLite library
Execution Requirements
Execution Requirements
- Windows operating system
- .NET Framework on target
- Chromium-based browser installed (Chrome, Edge, Brave, or Slack)
Privilege Requirements
Privilege Requirements
Current User Context:
- No elevation required
- Can only decrypt current user’s data
- Local Admin: Can decrypt all users on system
- Domain Admin: Can decrypt any domain user with backup key
Operational Security
OPSEC Considerations
OPSEC Considerations
Minimize Detection:
- Use from current user context when possible
- Avoid dumping all cookies/logins unnecessarily
- Target specific high-value accounts with filtering
- Use
/consoleoutfileto minimize screen artifacts
- Delete temporary files
- Clear command history
- Consider in-memory execution
- Exfiltrate data securely
Weaponization Tips
Weaponization Tips
- Embed in post-exploitation frameworks
- Automate with PowerShell wrappers
- Combine with credential spraying
- Use for lateral movement via cookie hijacking
Output Formats
- CSV (Default)
- Table
Additional Resources
Original SharpChrome
@djhohnstein’s original SharpChrome project
Chrome Encryption Changes
Details on Chrome 80+ encryption changes
EditThisCookie Extension
Cookie import extension for Chrome
SharpDPAPI Repository
Main SharpDPAPI repository containing SharpChrome
Next Steps
Extract Logins
Start extracting saved passwords
Hijack Cookies
Learn cookie extraction and hijacking
State Keys
Extract AES state keys for offline analysis
Build SharpChrome
Compile SharpChrome from source
License
SharpChrome is part of SharpDPAPI and is licensed under the BSD 3-Clause license.SharpChrome is adapted from @djhohnstein’s work and incorporates DPAPI functionality from Benjamin Delpy’s Mimikatz project.