Added support for basic 5GHz scanning.

This commit is contained in:
Matias Barcenas 2017-12-04 03:05:23 -06:00
parent 4cd3bf233c
commit a76f5a7a57
1 changed files with 10 additions and 11 deletions

View File

@ -537,13 +537,15 @@ function fluxion_set_scanner() {
if [ "$FLUXIONAuto" ];then if [ "$FLUXIONAuto" ];then
fluxion_run_scanner $WIMonitor fluxion_run_scanner $WIMonitor
else else
local choices=("$FLUXIONScannerChannelOptionAll" "$FLUXIONScannerChannelOptionSpecific" "$FLUXIONGeneralBackOption") local choices=("$FLUXIONScannerChannelOptionAll (2.4GHz)" "$FLUXIONScannerChannelOptionAll (5GHz)" "$FLUXIONScannerChannelOptionAll (2.4GHz & 5Ghz)" "$FLUXIONScannerChannelOptionSpecific" "$FLUXIONGeneralBackOption")
io_query_choice "$FLUXIONScannerChannelQuery" choices[@] io_query_choice "$FLUXIONScannerChannelQuery" choices[@]
echo echo
case "$IOQueryChoice" in case "$IOQueryChoice" in
"$FLUXIONScannerChannelOptionAll") fluxion_run_scanner $WIMonitor;; "$FLUXIONScannerChannelOptionAll (2.4GHz)") fluxion_run_scanner $WIMonitor "" "bg";;
"$FLUXIONScannerChannelOptionAll (5GHz)") fluxion_run_scanner $WIMonitor "" "a";;
"$FLUXIONScannerChannelOptionAll (2.4GHz & 5Ghz)") fluxion_run_scanner $WIMonitor "" "abg";;
"$FLUXIONScannerChannelOptionSpecific") fluxion_set_scanner_channel;; "$FLUXIONScannerChannelOptionSpecific") fluxion_set_scanner_channel;;
"$FLUXIONGeneralBackOption") fluxion_unset_interface; return 1;; "$FLUXIONGeneralBackOption") fluxion_unset_interface; return 1;;
esac esac
@ -563,8 +565,7 @@ function fluxion_set_scanner_channel() {
echo echo
echo -ne "$FLUXIONPrompt" echo -ne "$FLUXIONPrompt"
local channels local channels; read channels
read channels
echo echo
@ -572,28 +573,26 @@ function fluxion_set_scanner_channel() {
if [ $? -ne 0 ]; then return 1; fi if [ $? -ne 0 ]; then return 1; fi
} }
# Parameters: monitor [channel(s)] # Parameters: monitor [ channel(s) [ band(s) ] ]
function fluxion_run_scanner() { function fluxion_run_scanner() {
if [ ${#@} -lt 1 ]; then return 1; fi;
echo -e "$FLUXIONVLine $FLUXIONStartingScannerNotice" echo -e "$FLUXIONVLine $FLUXIONStartingScannerNotice"
echo -e "$FLUXIONVLine $FLUXIONStartingScannerTip" echo -e "$FLUXIONVLine $FLUXIONStartingScannerTip"
# Remove any pre-existing scanner results. # Remove any pre-existing scanner results.
sandbox_remove_workfile "$FLUXIONWorkspacePath/dump*" sandbox_remove_workfile "$FLUXIONWorkspacePath/dump*"
local monitor=$1
local channels=$2
if [ "$FLUXIONAuto" ]; then if [ "$FLUXIONAuto" ]; then
sleep 30 && killall xterm & sleep 30 && killall xterm &
fi fi
if [ "$channels" ]; then local channelsQuery="--channel $channels"; fi
# Begin scanner and output all results to "dump-01.csv." # Begin scanner and output all results to "dump-01.csv."
if ! xterm $FLUXIONHoldXterm -title "$FLUXIONScannerHeader" $TOPLEFTBIG -bg "#000000" -fg "#FFFFFF" -e "airodump-ng -Mat WPA $channelsQuery -w \"$FLUXIONWorkspacePath/dump\" $monitor" 2> /dev/null; then if ! xterm $FLUXIONHoldXterm -title "$FLUXIONScannerHeader" $TOPLEFTBIG -bg "#000000" -fg "#FFFFFF" -e "airodump-ng -Mat WPA "${2:+"--channel $2"}" "${3:+"--band $3"}" -w \"$FLUXIONWorkspacePath/dump\" $1" 2> /dev/null; then
echo -e "$FLUXIONVLine$CRed $FLUXIONGeneralXTermFailureError"; sleep 5; return 1 echo -e "$FLUXIONVLine$CRed $FLUXIONGeneralXTermFailureError"; sleep 5; return 1
fi fi
# Fix this below, creating subshells for something like this is somewhat ridiculous.
local scannerResultsExist=$([ -f "$FLUXIONWorkspacePath/dump-01.csv" ] && echo true) local scannerResultsExist=$([ -f "$FLUXIONWorkspacePath/dump-01.csv" ] && echo true)
local scannerResultsReadable=$([ -s "$FLUXIONWorkspacePath/dump-01.csv" ] && echo true) local scannerResultsReadable=$([ -s "$FLUXIONWorkspacePath/dump-01.csv" ] && echo true)