mirror of
https://github.com/tiennm99/export-chrome-cookies.git
synced 2026-05-19 19:26:30 +00:00
main
export-chrome-cookies
Python script to export Google Chrome cookies on Windows.
Quick start
pip install -r requirements.txt
python main.py
Note: Run on Windows with Chrome fully closed. Chrome locks its SQLite cookie database while running.
Output format
Cookies are written to cookies.json in the current directory. Each entry follows the WebExtension cookie schema:
{
"domain": ".example.com",
"name": "session_id",
"value": "abc123",
"path": "/",
"secure": true,
"httpOnly": false,
"sameSite": "lax",
"expirationDate": 1735689600,
"session": false
}
Chrome v10+ encryption
Chrome 80+ on Windows encrypts cookie values using AES-256-GCM with a key stored in Local State (protected by DPAPI). The script:
- Reads the base64-encoded encrypted key from
AppData\Local\Google\Chrome\User Data\Local State. - Decrypts it with
win32crypt.CryptUnprotectData. - Uses the key to decrypt each cookie value from the
CookiesSQLite database.
You must run the script as the same Windows user who owns the Chrome profile — DPAPI keys are user-scoped.
License
Apache-2.0 — see LICENSE.
Description
Languages
Python
100%