Search haveibeenpwned Hash File Locally using the Command Line (Mac and Linux)

In this video, I download the haveibeenpwned hash file and search it using command line commands. Big thanks to Troy Hunt for putting the site together.

Here is the site: https://haveibeenpwned.com

Troy Hunt’s website and twitter: https://www.troyhunt.comhttps://twitter.com/troyhunt

Calculate sha1 Hash of File
shasum pwned-password-sha1-ordered-by-hash-v4.7z
Install 7zip on Mac (using Macports)
sudo port install p7zip
Install 7zip on Ubuntu
sudo apt install p7zip
View 7zipped File Stats
7z l 7z x pwned-passwords-sha1-ordered-by-hash-v4.7z
View Password Hashes in File (press control-c to exit)
7z x pwned-passwords-sha1-ordered-by-hash-v4.7z -so 
Temporarily Disable Shell History
unset HISTFILE
Get shasum of Password
echo -n 'password' | shasum
Isolate Hash
echo -n 'password' | shasum | cut -d ' '
Convert to Uppercase
echo -n 'password' | shasum | cut -d ' ' -f1|tr [a-z] [A-z]
Search SHA-1 Password File for Password Hash
7z x pwned-passwords-sha1-ordered-by-hash-v4.7z -so | grep `(echo -n 'password'|shasum|cut -d ' ' -f1|tr [a-z] [A-z])`

Leave a comment

Your email address will not be published. Required fields are marked *