Skip to content

Commit 2d9c37f

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 20388ee + e98d813 commit 2d9c37f

File tree

3 files changed

+131
-0
lines changed

3 files changed

+131
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
2+
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
3+
name: CMake on a single platform
4+
5+
on:
6+
push:
7+
branches: [ "master" ]
8+
pull_request:
9+
branches: [ "master" ]
10+
11+
env:
12+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
13+
BUILD_TYPE: Release
14+
15+
jobs:
16+
build:
17+
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
18+
# You can convert this to a matrix build if you need cross-platform coverage.
19+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Configure CMake
26+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
27+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
28+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
29+
30+
- name: Build
31+
# Build your program with the given configuration
32+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
33+
34+
- name: Test
35+
working-directory: ${{github.workspace}}/build
36+
# Execute tests defined by the CMake configuration.
37+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
38+
run: ctest -C ${{env.BUILD_TYPE}}
39+

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Fadouse
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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

Comments
 (0)