Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/documentation/modules/post/multi/gather/chrome_cookies.md
Views: 11789
Gather Chrome Cookies
Reads all cookies from the Default Chrome Profile on the target machine. Uses Headless Chrome and Chrome's Remote Debugging.
Opsec
Disk writes
This writes randomly-named files to disk temporarily. You may want to consider the tradeoff between getting the user's Chrome cookies and the noisiness of writing to disk.
The module writes a random 10-15 character file containing HTML to a directory you can specify via WRITABLE_DIR
.
Running processes
On non-Windows non-meterpreter sessions, a headless Chrome process will be left running after module execution is completed. You can still find and kill this process manually after the module execution is completed.
Vulnerable Application
This module works on Chrome 59 or later on all operating systems. This module has been tested on Windows, Linux, and OSX.
Chrome does not need to be running on the target machine for this module to work.
Verification Steps
Obtain a session on the target machine
Do:
use post/multi/gather/chrome_cookies
Do:
set SESSION <your session ID>
Do:
run
The current user's Chrome cookies will be stored as loot
Options
CHROME_BINARY_PATH
The path to the user's Chrome binary. On Linux this defaults to searching for google-chrome
in $PATH
. On macOS, this defaults to /Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
. If the module doesn't find any cookies, it may be that a different Chrome binary to the one the user normally uses is being run. In that case, you can change the Chrome binary executed with this option.
WRITABLE_DIR
Directory used to write temporary files.
Two files are written, with random 10-15 character alphanumeric filenames. One file contains an html file for Chrome and the other is where the cookies are saved. Both files are deleted during cleanup.
REMOTE_DEBUGGING_PORT
Port to tell Chrome to expose Remote Debugging on. Default is the normal remote debugging port, 9222
.
Scenarios
Windows
Suppose you've got a session on the target machine.
To extract the target user's Chrome cookies
Future features
Profiles
This module only extracts cookies from the default Chrome profile. The target may have multiple, and you may which to extract cookies from all of them. This would require enumerating and extracting the profiles by name. Example code to extract cookies from a non-default Chrome profile can be found at https://github.com/defaultnamehere/cookie_crimes.
See also
See https://github.com/defaultnamehere/cookie_crimes for more information and manual instructions for Windows.
See https://mango.pdf.zone/stealing-chrome-cookies-without-a-password for the blog post in which this technique was first published.