Skip to content

Instantly share code, notes, and snippets.

@aerosol
Created August 26, 2018 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aerosol/6ce45fd0fa58fa6441ac0d261aaa76e1 to your computer and use it in GitHub Desktop.
Save aerosol/6ce45fd0fa58fa6441ac0d261aaa76e1 to your computer and use it in GitHub Desktop.
Have I Been Pwnd shell check
function hibp() {
sha1=$(echo -n "$1"|sha1sum|awk '{print toupper($0)}'|tr -d '\n');
curl -s -H $'Referer: https://haveibeenpwned.com/' https://api.pwnedpasswords.com/range/$(echo -n $sha1|cut -c1-5) | grep -i $(echo -n $sha1|cut -c6-40);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment