Extracting Firefox Cookies

During a penetration test, I encountered the need to extract cookies from Firefox. Cookies can contain valuable data, including authentication tokens and session IDs. In this scenario, I required a quick way to extract these cookies and transmit them to a remote server. You can find the C# script here: CookieHound && python script CookieHound_python

The Script:

Initial Setup: The script identifies the Firefox profile directory and connects to the cookies.sqlite database within that profile.

Cookie Retrieval: It queries the database to retrieve the cookies, extracting key-value pairs.

Sending to a Remote Server: The script prompts the user for a remote server URL and formats the cookies for transmission. A WebClient is used to send the cookies to the specified server.


To use the script, one must execute it within a Windows environment and provide the URL of the remote server where the cookies will be sent. The script automates the retrieval and transmission process, providing a quick solution for obtaining cookie data.

Written on December 15, 2023