-
-
Save Tonyliu2ca/40744c2c8d81311d2bf540d9f64b33d3 to your computer and use it in GitHub Desktop.
OSX user PW to HC format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo dscl . read /Users/$USER ShadowHashData | tail -1 | xxd -p -r | plutil -convert xml1 - -o - | sed s/data/string/ | plutil -convert json - -o $USER.json | |
ITERATIONS=$(jq '."SALTED-SHA512-PBKDF2".iterations' $USER.json) | |
SALT=$(jq '."SALTED-SHA512-PBKDF2".salt' $USER.json | sed -E 's/"?\\n\\t\\t"?//g' | base64 -D | xxd -c 256 -p) | |
ENTROPY=$(jq '."SALTED-SHA512-PBKDF2".entropy' $USER.json | sed -E 's/"?\\n\\t\\t"?//g' | base64 -D | xxd -c 256 -p | cut -c -128) | |
echo "\$ml\$$ITERATIONS\$$SALT\$$ENTROPY" > $USER.hash | |
hashcat -m 7100 --example-hashes | awk '/HASH/{print $2}' > example.hash | |
hashcat -a 3 -m 7100 example.hash "?l?l?l?l?l?l?l" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment