2024-04-03 18:53:17 +07:00
2024-04-03 18:07:53 +07:00
2024-04-04 14:00:40 +07:00
2024-04-04 13:40:07 +07:00

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:

  1. Reads the base64-encoded encrypted key from AppData\Local\Google\Chrome\User Data\Local State.
  2. Decrypts it with win32crypt.CryptUnprotectData.
  3. Uses the key to decrypt each cookie value from the Cookies SQLite 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.

S
Description
Export Google Chrome cookies in Windows using Python
Readme Apache-2.0 104 KiB
Languages
Python 100%