Created
January 17, 2019 17:39
-
-
Save xenithorb/0114200c02a8bc9952d829b99623f9f7 to your computer and use it in GitHub Desktop.
HIBP API curl one-liner for keepassXC CSV output to check for circulated passwords
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while read -r line; do hash=$( awk -F'","' '{printf "%s", $4}' <<< "$line" | sha1sum | cut -d' ' -f1 ); hash=${hash^^}; if (curl -s "https://api.pwnedpasswords.com/range/${hash:0:5}" | grep -q "${hash:5}" ); then echo "$line"; fi; sleep 1; done < <( { tr -d '\n' < output.csv | sed -r -e 's|"(xenith_keepass)|\n"\1|g' -e 's|,,|,"",|g'; echo; } | tail -n+2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment