Skip to content

Instantly share code, notes, and snippets.

@thalex
Forked from intrd/leakcheck_kanonymity.txt
Created April 24, 2018 14:22
Show Gist options
  • Save thalex/31bd42e8e3d44e9b18f4c4b2370ddc0c to your computer and use it in GitHub Desktop.
Save thalex/31bd42e8e3d44e9b18f4c4b2370ddc0c to your computer and use it in GitHub Desktop.
One-liner password leak check + k-anonymity method (w/out exposing the password on request)
## One-liner password leak check + k-anonymity method (w/out exposing the password on request)
# Compute the SHA1, Grab 1st 5 chars of the hash, check by range on huge haveibeenpwnd DB!
# original source: https://news.ycombinator.com/item?id=16432344
VARPWD='test123'; HASH=`echo -n $VARPWD | sha1sum`; curl --silent https://api.pwnedpasswords.com/range/`cut -b 1-5 <(echo $HASH)` --stderr - | grep -i `cut -b 6- <(echo $HASH) | cut -d ' ' -f 1`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment