How to query and parse cookie chrome browser in the terminal it?
Each query cookie, always first open the browser, and then set the option to find a lot of trouble
Can we write a tool to get the site cookie directly Terminal in it?
Below, we mac system chrome browser, for example, to explore. . .
The location where the cookie file of the browser chrome find ~/Library/Application Support/Google/Chrome/Profile 1/Cookies
this position may be inconsistent, in some machines ~/Library/Application Support/Google/Chrome/Default/Cookies
directory
cookie file is a file format sqlite3 database, we used to load sqlite3
cd ~/Library/Application\ Support/Google/Chrome/Profile\ 1/ && sqlite3 Cookies
View the database in which tables
> .tables
View table structure cookies
> .schema cookies
Get table structure
CREATE TABLE cookies(
creation_utc INTEGER NOT NULL,
host_key TEXT NOT NULL,
name TEXT NOT NULL,
value TEXT NOT NULL,
path TEXT NOT NULL,
expires_utc INTEGER NOT NULL,
is_secure INTEGER NOT NULL,
is_httponly INTEGER NOT NULL,
last_access_utc INTEGER NOT NULL,
has_expires INTEGER NOT NULL DEFAULT 1,
is_persistent INTEGER NOT NULL DEFAULT 1,
priority INTEGER NOT NULL DEFAULT 1,
encrypted_value BLOB DEFAULT '',
samesite INTEGER NOT NULL DEFAULT -1,
UNIQUE (host_key, name, path));
Haha, we direct inquiries with the appropriate fields sql statement, no you're done, so easy!
Etc ... encrypted_value What the hell! ! !
The original, chrome browser cookie value field to do the encryption
Decryption algorithm reference http://n8henrie.com/2014/05/decrypt-chrome-cookies-with-python/
Algorithm with mock password macox as private, was to value AES encryption; we get DerivedKey
decrypted to obtain the original value
If you do not want to study how specific decryption, direct look at my project it, based on golang achieve
Project Address: https://github.com/muyids/chrome-cookie
Original Address: http://www.muyids.com/posts/sqlite3-chrome-cookie/