Skip to content

Instantly share code, notes, and snippets.

View misterbastean's full-sized avatar

Josh Bastean misterbastean

  • Levvel, an Endava Company
  • Hartsville, SC
View GitHub Profile
@misterbastean
misterbastean / pwnCheck.sh
Created March 13, 2019 14:49 — forked from tulgeywood/pwnCheck.sh
pwnCheck
#!/bin/bash
read -rsp 'Password: ' PASSWD
echo
HASH=$(echo -n "$PASSWD" | shasum)
SEARCH=$(echo "${HASH:0:5}" | awk '{print toupper($0)}')
COMPARE=$(echo "$HASH" | tail -c 39)
COMPARE=$(echo "${COMPARE:0:35}" | awk '{print toupper($0)}')
RESPONSE=$(curl -s "https://api.pwnedpasswords.com/range/$SEARCH" | grep "$COMPARE")