Changed authenticator preferred verification program.

Added logic to choose cowpatty over aircrack-ng when verifying keys.
* This is due to the fact aircrack-ng kept giving false negatives on tests.
This commit is contained in:
Matias Barcenas 2019-05-26 21:39:18 -05:00
parent a2b32f4feb
commit 09dfa6d461
1 changed files with 33 additions and 13 deletions

View File

@ -917,6 +917,22 @@ while [ \$AuthenticatorState = \"running\" ]; do
" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh" " >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
if [ $CaptivePortalAuthenticatorMode = "hash" ]; then if [ $CaptivePortalAuthenticatorMode = "hash" ]; then
# 05/26/19: Default to cowpatty for verification since aircrack-ng appears to have a bug.
if which cowpatty &> /dev/null; then
echo "
if [ -f \"$FLUXIONWorkspacePath/candidate_result.txt\" ]; then
if cowpatty -f \"$FLUXIONWorkspacePath/candidate.txt\" -r \"$CaptivePortalHashPath\" -s \"$FluxionTargetSSID\" &> /dev/null; then
echo \"2\" > \"$FLUXIONWorkspacePath/candidate_result.txt\"
sleep 1
break
else
echo \"1\" > \"$FLUXIONWorkspacePath/candidate_result.txt\"
fi
fi" >> "$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
else
echo " echo "
if [ -f \"$FLUXIONWorkspacePath/candidate_result.txt\" ]; then if [ -f \"$FLUXIONWorkspacePath/candidate_result.txt\" ]; then
# Check if we've got the correct password by looking for anything other than \"Passphrase not in\" or \"KEY NOT FOUND\". # Check if we've got the correct password by looking for anything other than \"Passphrase not in\" or \"KEY NOT FOUND\".
@ -930,7 +946,8 @@ while [ \$AuthenticatorState = \"running\" ]; do
echo \"1\" > \"$FLUXIONWorkspacePath/candidate_result.txt\" echo \"1\" > \"$FLUXIONWorkspacePath/candidate_result.txt\"
fi fi
fi" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh" fi" >> "$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
fi
fi fi
local -r staticSSID=$(printf "%q" "$FluxionTargetSSID" | sed -r 's/\\\ / /g' | sed -r "s/\\\'/\'/g") local -r staticSSID=$(printf "%q" "$FluxionTargetSSID" | sed -r 's/\\\ / /g' | sed -r "s/\\\'/\'/g")
@ -1005,9 +1022,12 @@ IP: $(captive_portal_get_client_IP)
\" >\"$CaptivePortalNetLog/$targetSSIDCleanNormalized-$FluxionTargetMAC.log\"" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh" \" >\"$CaptivePortalNetLog/$targetSSIDCleanNormalized-$FluxionTargetMAC.log\"" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
if [ $CaptivePortalAuthenticatorMode = "hash" ]; then if [ $CaptivePortalAuthenticatorMode = "hash" ]; then
# echo "
# aircrack-ng -a 2 -b $FluxionTargetMAC -0 -s \"$CaptivePortalHashPath\" -w \"$FLUXIONWorkspacePath/candidate.txt\" && echo && echo -e \"The password was saved in "$CRed"$CaptivePortalNetLog/$targetSSIDCleanNormalized-$FluxionTargetMAC.log"$CClr"\"\
#" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
echo " echo "
aircrack-ng -a 2 -b $FluxionTargetMAC -0 -s \"$CaptivePortalHashPath\" -w \"$FLUXIONWorkspacePath/candidate.txt\" && echo && echo -e \"The password was saved in "$CRed"$CaptivePortalNetLog/$targetSSIDCleanNormalized-$FluxionTargetMAC.log"$CClr"\"\ echo -e \"The password was saved in "$CRed"$CaptivePortalNetLog/$targetSSIDCleanNormalized-$FluxionTargetMAC.log"$CClr"\"\
" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh" " >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
fi fi
chmod +x "$FLUXIONWorkspacePath/captive_portal_authenticator.sh" chmod +x "$FLUXIONWorkspacePath/captive_portal_authenticator.sh"