Skip to content

Latest commit

 

History

History
55 lines (45 loc) · 2.66 KB

File metadata and controls

55 lines (45 loc) · 2.66 KB

Cookie Stealer

An automated Python script that leverages the Chrome DevTools Protocol (CDP) to extract cookies from popular web browsers (Chrome, Brave, and Edge) by running them in headless debugging mode. This method effectively bypasses modern security measures like v20/v10 App-Bound Encryption by allowing the browser's own internals to handle the decryption.

Features

  • Multi-Browser Support: Works with Google Chrome, Brave, and Microsoft Edge.
  • Stealthy Execution: Runs the target browser in --headless mode.
  • Encryption Bypass: Bypasses v20/v10 App-Bound Encryption by interacting directly with the CDP.
  • Automated Cleanup: Kills existing browser instances to release database locks and cleans up after extraction.
  • JSON Output: Saves extracted cookies in a portable JSON format.

Scope & Limitations

  • Local Execution: This tool is designed to be run on the target machine. It interacts with the browser's local user data and spawns a debugging instance on localhost.
  • Chromium-Only: Works exclusively with Chrome, Brave, and Edge.
  • Operating System: Supports Windows due to hardcoded file paths and process management.

Prerequisites

  • Windows OS: Paths are hardcoded for default Windows installations.
  • Python 3.x: Ensure Python is installed and added to your PATH.
  • Required Python packages:
    pip install websocket-client requests

Usage

Run the script using Python. You can specify the target browser and a custom debugging port.

Basic Usage (Chrome)

python get_cookies.py

Specify Browser

python get_cookies.py --browser brave
# or
python get_cookies.py -b edge

Custom Port

python get_cookies.py --port 9333

How It Works

  1. Force Kill: Terminates any running instances of the target browser to ensure the User Data directory is not locked.
  2. Headless Start: Launches the browser with --remote-debugging-port, --headless, and the user's actual --user-data-dir.
  3. CDP Connection: Connects to the browser's remote debugging interface via WebSockets.
  4. Cookie Dump: Issues the Network.getAllCookies command to the browser, which returns all cookies (including encrypted ones) in plaintext.
  5. JSON Export: Formats and saves the data to a file named {browser}_cookies_{timestamp}.json.
  6. Cleanup: Kills the headless browser instance once the task is complete.

Disclaimer

Warning

This tool is for educational and authorized security testing purposes only. Unauthorized access to computer systems or data is illegal and unethical. Use this script only on systems you own or have explicit permission to test.