browserutils / kooky

Go code to read cookies from browser cookie stores.
MIT License
210 stars 41 forks source link

Chrome 80 windows - add AES decryption #16

Closed srlehn closed 4 years ago

srlehn commented 4 years ago

This PR adds support for the AES-256 GCM encryption introduced with Chrome 80 on Windows. Chrome encrypts cookie values via AES with a master key. This master key is stored encrypted in the json file 'Local State' ".os_crypt.encrypted_key". For the decryption we can use Windows "CryptUnprotectData()" function which we already used in prior Chrome versions on Windows.

The "Local State" file should normally be one directory layer above the "Cookies" database in the profile folder. For the retrieval of the master key we need to know the location of the database to derive the json file location. For that reason there are now 2 global variables, it would be better to remodel the code a bit so that they are no longer necessary.

implementation was done by following https://stackoverflow.com/a/60423699 .

This PR fixes #12 .