-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Added bitlocker2john.py #5564
Added bitlocker2john.py #5564
Conversation
Added Python script to extract hashes for BitLocker-encrypted volumes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script is missing a shebang line. Is it Python 3 only or is it also compatible with Python 2? Depending on this, please start it with either #!/usr/bin/env python3
or #!/usr/bin/env python
. For this sort of updates to the main script within this PR, please amend the one existing commit and force-push.
You could also want to update doc/README.BitLocker
to mention this script as (the recommended?) alternative to our compiled bitlocker2john
program (making that program a secondary choice?)
Removed references to hashcat and updated comments to reflect that both user password and recovery key hashes are supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for these updates, they mostly look good. I suggest a couple of minor edits, can you please incorporate those as well?
For such fixups within a PR, we normally amend the existing commit and force-push, not add more commits. But if you're not used to work like that (or if the git client software you use doesn't let you), it's OK if you add commits (I will then need to temporarily allow squash-and-merge for this repo and use that on this specific PR).
Thanks again!
doc/README.BitLocker
Outdated
$bitlocker$3$16$4b10ca85ab17a7419990d92f75abc848$1048558$12$a015f77b68aed80106000000$60$11e39cfd4dc9f647cef46b843347a3677c0706d3653f3477d44c72c8e36e8e02e010744dc384a419ff487a0190b42da0a29229d57a0bc3c6a7193f7 | ||
|
||
|
||
Alternatively, run compiled script bitlocker2john. Found at tools/john/src/bitlocker2john.c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The C program isn't a script
and we do not have a tools/john
directory and people are not expected to compile just one C file manually. So I'd replace this line with:
Alternatively, run the compiled program bitlocker2john, which is normally
built from source along with the rest of John the Ripper and is included
pre-built in John the Ripper binary releases.
run/bitlocker2john.py
Outdated
@@ -0,0 +1,240 @@ | |||
#!/usr/bin/python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the env
trick here for consistency with our other scripts and not to rely on specific location of python3
. So the line should be:
#!/usr/bin/env python3
This failed our CI whitespace-errors check, please also fix this minor detail:
|
Oh, we also need to add a |
1e3e4cb
to
1d33f8f
Compare
Updated README.Bitlocker to include Python script usage. Fixed whitespace. Updated doc/NEWS
1d33f8f
to
f0a2a5d
Compare
$bitlocker$0$16$4a67bc123abedc43d60b3ece78ec6d1e$1048558$12$a015f77b68aed80103000000$60$2dbacf4710d3d42aa4f7baeedff85d72fc892f8f3457271901c0d2eccc3de890f081b3335740a5b5f1473892569ec0455d1aa2fd0075ac073a5f7b2a | ||
$bitlocker$1$16$4a67bc123abedc43d60b3ece78ec6d1e$1048558$12$a015f77b68aed80103000000$60$2dbacf4710d3d42aa4f7baeedff85d72fc892f8f3457271901c0d2eccc3de890f081b3335740a5b5f1473892569ec0455d1aa2fd0075ac073a5f7b2a | ||
$bitlocker$2$16$4b10ca85ab17a7419990d92f75abc848$1048558$12$a015f77b68aed80106000000$60$11e39cfd4dc9f647cef46b843347a3677c0706d3653f3477d44c72c8e36e8e02e010744dc384a419ff487a0190b42da0a29229d57a0bc3c6a7193f7 | ||
$bitlocker$3$16$4b10ca85ab17a7419990d92f75abc848$1048558$12$a015f77b68aed80106000000$60$11e39cfd4dc9f647cef46b843347a3677c0706d3653f3477d44c72c8e36e8e02e010744dc384a419ff487a0190b42da0a29229d57a0bc3c6a7193f7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just merged this PR (thanks!) but now I notice that the two example Recovery Password "hashes" given here are somehow one character too short - last field is 119 instead of 120 chars. Do we maybe have a bug where a leading zero is omitted? In my testing of the script, I got all strings of the same length, but maybe I just didn't trigger that bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing such bug in the current script, so maybe it was in some older revision? I think I'll "fix" these "hashes" by inserting a 0
after $60$
, just so that they're a correct illustration. But I'd appreciate @holly-o's comments here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I edited one of my known hashes to add as an example, and accidentally removed a character. The script should always output len 120.
Thanks for your fix!
Sorry for being late. I had a quick look, no deep dive or actual testing but I think it looks good. Only some formatting things or minor idiomatic points. Noting that needs a fix now and it's probably fine being merged. |
Added Python script to extract hashes for BitLocker-encrypted volumes