Data structure
Google Chrome stores user profiles in specific locations based on the operating system:
- Linux:
~/.config/google-chrome/ - Windows:
C:\Users\XXX\AppData\Local\Google\Chrome\User Data\ - MacOS:
/Users/$USER/Library/Application Support/Google/Chrome/
Within these directories, most user data can be found in the Default/ or ChromeDefaultData/ folders.
The following files hold significant data:
History- Contains URLs, downloads, and search keywords. On Windows, ChromeHistoryView can be used to read the historyCookies- Stores cookies. For inspection, ChromeCookiesView is availableCacheHolds cached data. To inspect, Windows users can utilize ChromeCacheViewBookmarks- User bookmarksWeb Data- Contains form historyLogin Data- Includes login credentials like usernames and passwordsCurrent SessionorCurrent Tabs- Data about the current browsing session and open tabLast SessionorLast Tabs- Information about the sites active during the last session before Chrome was closedExtensions- Directories for browser extensions and addons
Stored credentials
You can find credentials in Login Data.
Alternatively, LaZagne can also return results if the user has used one of the popular browsers.
Cookies
Google chrome stores its cookies information in an SQLite database which are encrypted with Data Protection API (DPAPI).
DPAPI is commonly used to encrypt data using information from the current user account or computer.
To get the cookie value, you’ll need to perform a decryption routine from the session of the user we compromised. SharpChromium connects to the current user SQLite cookie database, decrypts the cookie value, and presents the result in JSON format.
You can use Invoke-SharpChromium as it uses reflection to load SharpChromium. If you get and error because the cookie file path try to move the cookie files to where the tool expects them.
PS C:\htb> Invoke-SharpChromium -Command "cookies slack.com"
<SNIP>
{
"domain": ".slack.com",
"expirationDate": 1974643257.67155,
"hostOnly": false,
"httpOnly": true,
"name": "d",
"path": "/",
"sameSite": "lax",
"secure": true,
"session": false,
"storeId": null,
"value": "xoxd-5KK4K2RK2ZLs2sISUEBGUTxLO0dRD8y1wr0Mvst%2Bm7Vy24yiEC3NnxQra8uw6IYh2Q9prDawms%2FG72og092YE0URsfXzxHizC2OAGyzmIzh2j1JoMZNdoOaI9DpJ1Dlqrv8rORsOoRW4hnygmdR59w9Kl%2BLzXQshYIM4hJZgPktT0WOrXV83hNeTYg%3D%3D"
},
<SNIP>Now you can use an extension like Cookie-Editor to implement the cookie into your browser.
Note: When copy/pasting the contents of a cookie, make sure the value is one line.
Process memory dump
If you see a running chrome process, remember that you can dump it with tools like ProcDump and use strings to read it’s content. You might find things like old POST request holding credentials inside of them so search for key words like password, admin, administrator, login or user’s name.
Credentials in a dictionary
Information such as passwords may be entered in an email client or a browser-based application, which underlines any words it doesn’t recognize. The user may add these words to their dictionary to avoid the distracting red underline.
You can check it with - Get-Content 'C:\Users\<USER>\AppData\Local\Google\Chrome\User Data\Default\Custom Dictionary.txt' | Select-String password.