Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- activate
- 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 ""
- if the button returned of the result is "Ok" then
- set orig_file to text returned of result
- do shell script "plutil -convert xml1 " & orig_file
- do shell script "cat " & orig_file & " | grep -A9 ShadowHashData | tail -n+4 > $TMPDIR/SHADOWHASHDATA"
- do shell script "cat $TMPDIR/SHADOWHASHDATA | base64 -D > $TMPDIR/SHADOWHASHDATA1"
- do shell script "plutil -convert xml1 $TMPDIR/SHADOWHASHDATA1"
- do shell script "cat $TMPDIR/SHADOWHASHDATA1 | tail -n+9 | head -3 | cut -c 3-62 | tr -d '\\n'| base64 -D|xxd -p|tr -d ''"
- set entropy to result
- do shell script "cat $TMPDIR/SHADOWHASHDATA1 | tail -n+14 |head -1 | cut -c 12-16"
- set iterations to result
- do shell script "cat $TMPDIR/SHADOWHASHDATA1 | tail -n+17 | head -1 |cut -c 3-46| base64 -D|xxd -p|tr -d ''"
- set salt to result
- set almost_final_hash to "$ml{:content:}quot; & iterations & "{:content:}quot; & salt & "{:content:}quot; & entropy
- set final_hash to (characters 1 thru 203 of almost_final_hash)
- display dialog "This is your hash: " & final_hash & "
- Do you want to save this? " buttons {"Yes", "No"} default button 1
- if the button returned of the result is "Yes" then
- set savelocation to POSIX path of (choose file name with prompt "Where do you want to save the hash?" default name "Hash.hash")
- do shell script "printf '%s' '" & final_hash & "'> " & savelocation
- end if
- else
- quit
- end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement