Advertisement
Guest User

Extract hashes Mac OS 10.8-10.9

a guest
Nov 2nd, 2014
2,859
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. activate
  2. display dialog "Please enter the path to the .plist file or drag the file into the text box below" buttons {"Cancel", "Ok"} default button 2 default answer ""
  3. if the button returned of the result is "Ok" then
  4. set orig_file to text returned of result
  5. do shell script "plutil -convert xml1 " & orig_file
  6. do shell script "cat " & orig_file & " | grep -A9 ShadowHashData | tail -n+4 > $TMPDIR/SHADOWHASHDATA"
  7. do shell script "cat $TMPDIR/SHADOWHASHDATA | base64 -D > $TMPDIR/SHADOWHASHDATA1"
  8. do shell script "plutil -convert xml1 $TMPDIR/SHADOWHASHDATA1"
  9. do shell script "cat $TMPDIR/SHADOWHASHDATA1 | tail -n+9 | head -3 | cut -c 3-62 | tr -d '\\n'| base64 -D|xxd -p|tr -d ''"
  10. set entropy to result
  11. do shell script "cat $TMPDIR/SHADOWHASHDATA1 | tail -n+14 |head -1 | cut -c 12-16"
  12. set iterations to result
  13. do shell script "cat $TMPDIR/SHADOWHASHDATA1 | tail -n+17 | head -1 |cut -c 3-46| base64 -D|xxd -p|tr -d ''"
  14. set salt to result
  15. set almost_final_hash to "$ml{:content:}quot; & iterations & "{:content:}quot; & salt & "{:content:}quot; & entropy
  16. set final_hash to (characters 1 thru 203 of almost_final_hash)
  17. display dialog "This is your hash: " & final_hash & "
  18. Do you want to save this? " buttons {"Yes", "No"} default button 1
  19. if the button returned of the result is "Yes" then
  20. set savelocation to POSIX path of (choose file name with prompt "Where do you want to save the hash?" default name "Hash.hash")
  21. do shell script "printf '%s' '" & final_hash & "'> " & savelocation
  22. end if
  23. else
  24. quit
  25. end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement