-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add method to load login credentials as well as cookies #164
base: master
Are you sure you want to change the base?
Conversation
8d4b778
to
e8673f5
Compare
This same idiosyncratic timestamp format ("microseconds since Windows NT epoch") is apparently used by Chromium-based browsers for both cookies’ expiration timestamps, as well as timestamps associated with saved login credentials.
8ef18de
to
217d331
Compare
The machinery for decrypting login credentials on Chromium-based browsers is essentially identical to what's used to decrypt cookies. For a fairly hacky standalone implementation of login credential decryption, see https://github.com/priyankchheda/chrome_password_grabber. Done: - Add ChromiumBased.load_logins() method. - Autodetect paths for login credentials on Chrome and Chromium browsers on Linux. (Tested both) TODO: - Determine correct paths for login credentials on Windows, macOS, and other Chromium-based browsers. For now, you should be able to test whether the same decryption process works by finding the login credentials database path, and passing passing `login_file='THAT_PATH'` to the constructor for any `ChromiumBased` browser. - Add loading and decryption of login credentials from Firefox as well. Perhaps based on https://github.com/unode/firefox_decrypt?
217d331
to
4e33bdd
Compare
You should probably merge that one first, since it just makes small cleanup-y changes…
You could, but I've only tested in on recent Chrome/Chromium on Linux, and not even sure if it'll work with other versions of Chrom*-based browsers or on other OSes. And additional work for Firefox is certainly needed. I mostly wanted to post it at this point in order to get feedback on the interface/API for loading the logins. |
Your approach looks good to me. I can test them on different browsers and OSes. |
No file copying, and no Windows import override needed
The machinery for decrypting login credentials on Chromium-based browsers is essentially identical to what's used to decrypt cookies. For a fairly hacky standalone implementation of login credential decryption, see https://github.com/priyankchheda/chrome_password_grabber. Done: - Add ChromiumBased.load_logins() method. - Autodetect paths for login credentials on Chrome and Chromium browsers on Linux. (Tested both) TODO: - Determine correct paths for login credentials on Windows, macOS, and other Chromium-based browsers. For now, you should be able to test whether the same decryption process works by finding the login credentials database path, and passing passing `login_file='THAT_PATH'` to the constructor for any `ChromiumBased` browser. - Add loading and decryption of login credentials from Firefox as well. Perhaps based on https://github.com/unode/firefox_decrypt?
Also: - Put source package in a directory called browser_cookie3, so that __main__.py can 'from . import *' even while testing - Clean up/clarify BrowserCookieError() messages a bit - Make Firefox class and firefox() function take a key_file parameter, but ignore it, for a consistent interface with Chromium-based browsers - Cleanup all trailing whitespace (with https://github.com/dlenski/wtf)
This pure-Python decryption looks like the best approach: https://github.com/lclevy/firepwd/blob/master/firepwd.py
The machinery for decrypting login credentials on Chromium-based browsers is
essentially identical to what's used to decrypt cookies. For a fairly hacky
standalone implementation of login credential decryption, see
https://github.com/priyankchheda/chrome_password_grabber.
Done:
Linux. (Tested both)
TODO:
Determine correct paths for login credentials on Windows, macOS, and other
Chromium-based browsers.
For now, you should be able to test whether the same decryption process
works by finding the login credentials database path, and passing passing
login_file='THAT_PATH'
to the constructor for anyChromiumBased
browser.
Add loading and decryption of login credentials from Firefox as well.
Perhaps based on https://github.com/unode/firefox_decrypt?