|
| 1 | +# Browser Cookie Decryptor |
| 2 | + |
| 3 | +This project is designed to decrypt cookies stored by the Microsoft Edge browser. It retrieves the encrypted AES key from the `Local State` file, decrypts it using Windows DPAPI, and then uses the decrypted AES key to decrypt the cookies stored in the Edge browser's SQLite database. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- Terminate the Edge browser process to ensure the database is not locked. |
| 8 | +- Retrieve and decrypt the AES key used by Edge to encrypt cookies. |
| 9 | +- Read and decrypt cookies from the Edge browser's SQLite database. |
| 10 | +- Export decrypted cookies to a JSON file. |
| 11 | + |
| 12 | +## Prerequisites |
| 13 | + |
| 14 | +- Windows operating system |
| 15 | +- Microsoft Edge browser |
| 16 | +- [SQLite3](https://www.sqlite.org/download.html) |
| 17 | +- [nlohmann/json](https://github.com/nlohmann/json) library |
| 18 | + |
| 19 | +## Building |
| 20 | + |
| 21 | +1. Clone the repository: |
| 22 | + ```sh |
| 23 | + git clone https://github.com/yourusername/edge-cookie-decryptor.git |
| 24 | + cd edge-cookie-decryptor |
| 25 | + ``` |
| 26 | + |
| 27 | +2. Open the project in your IDE (e.g., CLion). |
| 28 | + |
| 29 | +3. Ensure you have the required libraries installed and linked: |
| 30 | + - `sqlite3` |
| 31 | + - `nlohmann/json` |
| 32 | + |
| 33 | +4. Build the project using your IDE's build tools. |
| 34 | +
|
| 35 | +## Usage |
| 36 | +
|
| 37 | +1. Ensure the Edge browser is closed. The program will attempt to terminate the Edge process if it is running. |
| 38 | +
|
| 39 | +2. Run the executable: |
| 40 | + ``` |
| 41 | + ./edge-cookie-decryptor.exe |
| 42 | + ``` |
| 43 | +
|
| 44 | +3. The program will output the decrypted cookies to a file named `cookies.json`. |
| 45 | +
|
| 46 | +## Code Overview |
| 47 | +
|
| 48 | +### `main.cpp` |
| 49 | +
|
| 50 | +- **KillProcessByName**: Terminates the Edge browser process. |
| 51 | +- **getUserProfilePath**: Retrieves the user's profile path. |
| 52 | +- **getEdgeBrowserCookiePath**: Constructs the path to the Edge browser's cookie database. |
| 53 | +- **getLocalStatePath**: Constructs the path to the Edge browser's `Local State` file. |
| 54 | +- **getEncryptedAESKey**: Retrieves the encrypted AES key from the `Local State` file. |
| 55 | +- **base64Decode**: Decodes a base64-encoded string. |
| 56 | +- **decryptAESKey**: Decrypts the AES key using Windows DPAPI. |
| 57 | +- **decryptWithAESGCM**: Decrypts data using AES-GCM. |
| 58 | +- **decryptWithDPAPI**: Decrypts data using Windows DPAPI. |
| 59 | +- **decryptData**: Determines the encryption method and decrypts the data. |
| 60 | +- **writeCookiesToJson**: Writes the decrypted cookies to a JSON file. |
| 61 | +- **readAndDecryptCookies**: Reads and decrypts cookies from the SQLite database. |
| 62 | + |
| 63 | +## License |
| 64 | + |
| 65 | +This project is licensed under the MIT License. See the `LICENSE` file for details. |
| 66 | + |
| 67 | +## Acknowledgements |
| 68 | + |
| 69 | +- [SQLite](https://www.sqlite.org/) |
| 70 | +- [nlohmann/json](https://github.com/nlohmann/json) |
| 71 | +- [Windows API](https://docs.microsoft.com/en-us/windows/win32/apiindex/windows-api-list) |
0 commit comments