Skip to content

Instantly share code, notes, and snippets.

@ryan0x44
Created February 24, 2018 05:47
Show Gist options
  • Save ryan0x44/67abdef6e4eef7f7f4206efa437e7812 to your computer and use it in GitHub Desktop.
Save ryan0x44/67abdef6e4eef7f7f4206efa437e7812 to your computer and use it in GitHub Desktop.
Find out how many times your password has been pwned
#!/bin/bash
# set pw to the password you want to lookup (of course, be careful with writing this to your shell history or unencrypted disk!)
pw="insecure"
# this will output the number of times it has been pwned
s=$(echo -n $pw | openssl sha1 | tr '[a-z]' '[A-Z]'); curl -s "https://api.pwnedpasswords.com/range/${s:0:5}" | grep "${s:5}" | cut -d ":" -f 2
@ryan0x44
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment