richardpenman / browsercookie

GNU Lesser General Public License v2.1
118 stars 27 forks source link

Decrypting Chrome cookies doesn't work #7

Open dcolascione opened 3 years ago

dcolascione commented 3 years ago

The code handles v10 encrypted cookies only, but my Chrome has v11 cookies as well. All cookies have the empty string in their value field.

rg7663 commented 3 years ago

Found the same problem using browsercookie with chrome on Linux. IN my case it looks like chrome has stopped using a hardcoded password ("peanuts") for cookie encryption and uses a random secret stored in the gnome keyring. Can extract this using secretstorage pypi module

artshmelev commented 3 years ago

works for me - https://github.com/richardpenman/browsercookie/pull/8

can you test the PR solution works for you?

bneumann commented 3 years ago

Hey, I just stumbled across that issue and you PR works. I am using windows 10 latest update with Chrome 86. Thanks!

SteveJSzabo commented 3 years ago

I think I just stumbled upon a similar issue with the latest Chrome update (90.0.4430.93). I get the following error:

  self.__cj = chrome()
  File "C:\Users\doste\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\browsercookie\__init__.py", line 422, in chrome
    return Chrome(cookie_file).load()
  File "C:\Users\doste\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\browsercookie\__init__.py", line 92, in load
    for cookie in self.get_cookies():
  File "C:\Users\doste\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\browsercookie\__init__.py", line 157, in get_cookies
    cur.execute(query)
>▬.�▬�▬�S←����o'nalError: Could not decode to UTF-8 column 'encrypted_value' with text 'v10�������w����5�(p�
NicoCaldo commented 3 years ago

It has issue to decode the sqlite format. Got this error

File "C:\Users\nicoc\PycharmProjects\WriteAI\venv\lib\site-packages\browsercookie\__init__.py", line 146, in get_cookies
    cur.execute(query)
sqlite3.OperationalError: Could not decode to UTF-8 column 'encrypted_value' with text 'v10�����0(�Uy�w����>�_5E9F��o_%��7���B����P(E?%�d�'