if [ x$1 = x ]; then echo Usage: $0 PASSWORDFILE [ ADDONS_FILE ] echo echo Create a PASSWORDFILE containg all your passwords, each in a single line. echo You may also provide an ADDONS_FILE in which you may add possible pre- or echo postfixes to your passwords. This script will test these combinations: echo ADDONpassword, password, passwordADDON, ADDONpasswordADDON exit fi if [ -f pwned-passwords-ordered-by-count.txt ]; then echo [OK] pwned password file downloaded else echo downloading pwned password file downloaded from cloudflare wget https://downloads.pwnedpasswords.com/passwords/pwned-passwords-ordered-by-count.7z echo computing checksum: sha1sum pwned-passwords-ordered-by-count.7z echo please check against the sha1sum at "https://haveibeenpwned.com/Passwords" echo extracting 7z x pwned-passwords-ordered-by-count.7z echo cleaning up rm pwned-passwords-ordered-by-count.7z fi if [ -f pwned-passwords-ntlm-ordered-by-count.txt ]; then echo [OK] pwned ntlm password file downloaded else echo downloading pwned ntlm password file downloaded from cloudflare wget https://downloads.pwnedpasswords.com/passwords/pwned-passwords-ntlm-ordered-by-count.7z echo computing checksum: sha1sum pwned-passwords-ntlm-ordered-by-count.7z echo please check against the sha1sum at "https://haveibeenpwned.com/Passwords" echo extracting 7z x pwned-passwords-ntlm-ordered-by-count.7z echo cleaning up rm pwned-passwords-ntlm-ordered-by-count.7z fi echo -n "" > results.txt echo -n "" > hashes.sha1 echo -n "" > hashes.ntlm echo -n "" > lookup.txt echo -n "" > fullpwds.txt echo merging password combinations if [ x$2 = x ]; then cp -f $1 $2 else while read line do echo $line >> fullpwds.txt while read lservice do echo $line$lservice >> fullpwds.txt echo $lservice$line$lservice >> fullpwds.txt echo $lservice$line >> fullpwds.txt done < $2 done < $1 fi echo creating hashes while read line do myshahash=`echo -n "$line" | sha1sum | cut -d' ' -f 1 |tr "[a-z]" "[A-Z]"` myntlmhash=`echo -n "$line" | iconv -f UTF8 -t UTF16LE | openssl dgst -md4 | cut -d' ' -f2 |tr "[a-z]" "[A-Z]"` if grep -xq $line lookup.txt; then echo $line already found continue fi echo "$line" $myshahash $myntlmhash >> lookup.txt echo $myshahash >> hashes.sha1 echo $myntlmhash >> hashes.ntlm done < fullpwds.txt echo checking sha1 hashes against pwnd list grep -f hashes.sha1 pwned-passwords-ordered-by-count.txt | { while IFS= read -r line do myhash=`echo -n $line | cut -d ':' -f 1` counts=`echo -n $line | cut -d ':' -f 2` echo "Hash:" $myhash " is comprimized "$counts" times, password:" `grep $myhash lookup.txt | cut -d' ' -f 1` >> results.txt done } echo checking ntlm hashes against pwnd list grep -f hashes.ntlm pwned-passwords-ntlm-ordered-by-count.txt | { while IFS= read -r line do myhash=`echo -n $line | cut -d ':' -f 1` counts=`echo -n $line | cut -d ':' -f 2` echo "Hash:" $myhash " is comprimized "$counts" times, password:" `grep $myhash lookup.txt | cut -d' ' -f 1` >> results.txt done } rm -f hashes.* rm -f lookup.txt rm -f fullpwds.txt echo done, your results: cat results.txt