Fix DPAPI credential lookup: add lowercase username for dploot compatibility #1113
Conversation
…ibility dploot looks up credentials with user.lower() (e.g. 'administrator'), but we only stored them under context.username (e.g. 'Administrator'). Python dict lookups are case-sensitive, so the credential wasn't found and master keys were never decrypted. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks for the bug fix PR! I'll take a look at it soon. |
|
I need to investigate on Chrome, maybe the DPAPI routine has changed again. Chances are it's not related to this issue |
|
I can now confirm Google Chrome has implemented a new encryption flag, which breaks Google Chrome (not the other Chromium browsers, only GC) secret decryption. Need to fix this, but it's unrelated to this issue. |
|
No not a reason did not test for changing the first line. So if it both works I think its all good. |
Create an issue to track the missing chrome secrets: #1139 |


Description
Fixes DPAPI master key decryption when the username contains uppercase letters (e.g.
Administrator).dploot looks up credentials using
user.lower()(e.g."administrator"), but credentials were only stored undercontext.username(e.g."Administrator"). Because Python dict lookups are case-sensitive, the credential lookup failed and master keys were not decrypted.This change adds the lowercase username as an additional key in both
plaintextsandnthashesso dploot can find the credentials regardless of casing.No new dependencies.
Type of change
Insert an "x" inside the brackets for relevant items (do not delete options)
Setup guide for the review
Please provide guidance on what setup is needed to test the introduced changes, such as your locally running machine Python version & OS, as well as the target(s) you tested against, including software versions.
In particular:
Administrator,DOMAIN\User). Before the fix, master keys for that user were not decrypted because the credential lookup failed. After the fix, credentials are found and master keys decrypt successfully.Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run python -m ruff check . --preview, use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)