Skip to content

Commit

Permalink
Re-Arranged Some Functions
Browse files Browse the repository at this point in the history
  • Loading branch information
esc0rtd3w committed Jan 9, 2017
1 parent 0a3e5f0 commit 73a20c1
Showing 1 changed file with 159 additions and 138 deletions.
297 changes: 159 additions & 138 deletions wifi-hacker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5460,7 +5460,7 @@ killAll(){


############################################################################
# SESSION LOG STUFF BEGIN ##############################################
# SESSIONS STUFF BEGIN #################################################
############################################################################


Expand Down Expand Up @@ -5733,8 +5733,89 @@ sessionLoad(){
}


cleanCaptureFiles(){

currentTask="cleanCaptureFiles"

banner
echo ""
$red
echo "*** THIS WILL ERASE ALL CURRENT CAPTURE FILES!!!"
$white
echo ""
echo ""
echo "If you would like to create a backup before doing this, press B and ENTER"
echo ""
echo ""
echo "If you would like to CANCEL, press C and ENTER"
echo ""
echo ""
echo ""
echo ""
echo "Files will be copied to the \"/sessions/\" directory and backed up to a ZIP file"
echo ""
echo ""
echo ""
echo ""
$cyan
echo "Automatically Continuing In 10 Seconds..."
$white
echo ""
echo ""

read -t 10 eraseCaptureConfirm

case "$eraseCaptureConfirm" in

"")
banner
echo ""
echo "Cleaning Capture Files...."
echo ""
echo ""

sleep 3

rm *.cap
rm *.ivs
rm *.xor
rm *.csv
rm *.netxml
;;

"c" | "C")
menuExtras
;;

"b" | "B")
backupFromCaptureErase="1"
backupSessionFiles
;;

*)
cleanCaptureFiles
;;

esac

}


findCaptureFiles(){

currentTask="findCaptureFiles"

listCap=$(ls | grep .cap)
listIvs=$(ls | grep .ivs)
listXor=$(ls | grep .xor)
listCsv=$(ls | grep .csv)
listNetXml=$(ls | grep .netxml)

}


############################################################################
# SESSION LOG STUFF END ################################################
# SESSIONS STUFF END ###################################################
############################################################################


Expand Down Expand Up @@ -5851,7 +5932,7 @@ checkForEmptyCredentials(){


############################################################################
# MISC STUFF BEGIN #####################################################
# INTERFACE STUFF BEGIN ################################################
############################################################################

checkInterfaceMode(){
Expand Down Expand Up @@ -6264,87 +6345,98 @@ getWirelessInterfaces(){
}


cleanCaptureFiles(){
disableChannelHopping(){

currentTask="cleanCaptureFiles"
sleep 1
ifconfig $interface down

banner
echo ""
$red
echo "*** THIS WILL ERASE ALL CURRENT CAPTURE FILES!!!"
$white
echo ""
echo ""
echo "If you would like to create a backup before doing this, press B and ENTER"
echo ""
echo ""
echo "If you would like to CANCEL, press C and ENTER"
echo ""
echo ""
echo ""
echo ""
echo "Files will be copied to the \"/sessions/\" directory and backed up to a ZIP file"
echo ""
echo ""
echo ""
echo ""
$cyan
echo "Automatically Continuing In 10 Seconds..."
$white
echo ""
echo ""
}

read -t 10 eraseCaptureConfirm

case "$eraseCaptureConfirm" in
enableChannelHopping(){

"")
banner
echo ""
echo "Cleaning Capture Files...."
echo ""
echo ""
sleep 1
ifconfig $interface up

sleep 3
}

rm *.cap
rm *.ivs
rm *.xor
rm *.csv
rm *.netxml
;;
interfaceUp(){

"c" | "C")
menuExtras
;;
#ifconfig $interface up
ifconfig $interfaceMonitor up

"b" | "B")
backupFromCaptureErase="1"
backupSessionFiles
;;
}

*)
cleanCaptureFiles
;;

esac
interfaceDown(){

#ifconfig $interface down
ifconfig $interfaceMonitor down

}


findCaptureFiles(){
interfaceManaged(){

currentTask="findCaptureFiles"
#iwconfig wlan0mon mode managed
iwconfig $interfaceMonitor mode managed

listCap=$(ls | grep .cap)
listIvs=$(ls | grep .ivs)
listXor=$(ls | grep .xor)
listCsv=$(ls | grep .csv)
listNetXml=$(ls | grep .netxml)
}


interfaceMonitor(){

#iwconfig wlan0mon mode monitor
iwconfig $interfaceMonitor mode monitor

}


fixKaliTwoMonError(){

currentTask="fixKaliTwoMonError"

case "$isDebugMode" in

"1")
echo "DEBUG: Kali 2.x Fix - Step 1"
echo ""
echo "$interface"
echo "$interfaceMonitor"
read pause
;;
esac

ifconfig $interfaceMonitor down
sleep 2
iwconfig $interfaceMonitor mode monitor
sleep 2
ifconfig $interfaceMonitor up

case "$isDebugMode" in

"1")
echo "DEBUG: Kali 2.x Fix - Step 2"
echo ""
echo "$interface"
echo "$interfaceMonitor"
read pause
;;
esac
}


############################################################################
# INTERFACE STUFF END ##################################################
############################################################################



############################################################################
# MISC STUFF BEGIN #####################################################
############################################################################


getCustomList(){

banner
Expand Down Expand Up @@ -6421,12 +6513,14 @@ fixNegativeOneChannelError(){

}


startNetworkManager(){

NetworkManager

}


killNetworkManager(){

currentPID=$(ps -A | grep NetworkManager | cut -c 1-5)
Expand All @@ -6439,6 +6533,7 @@ killNetworkManager(){

}


wpaSupplicantKill(){

currentTask="wpaSupplicantKill"
Expand Down Expand Up @@ -6471,81 +6566,6 @@ wpaSupplicantDisable(){

}

disableChannelHopping(){

sleep 1
ifconfig $interface down

}

enableChannelHopping(){

sleep 1
ifconfig $interface up

}

interfaceUp(){

#ifconfig $interface up
ifconfig $interfaceMonitor up

}

interfaceDown(){

#ifconfig $interface down
ifconfig $interfaceMonitor down

}

interfaceManaged(){

#iwconfig wlan0mon mode managed
iwconfig $interfaceMonitor mode managed

}

interfaceMonitor(){

#iwconfig wlan0mon mode monitor
iwconfig $interfaceMonitor mode monitor

}

fixKaliTwoMonError(){

currentTask="fixKaliTwoMonError"

case "$isDebugMode" in

"1")
echo "DEBUG: Kali 2.x Fix - Step 1"
echo ""
echo "$interface"
echo "$interfaceMonitor"
read pause
;;
esac

ifconfig $interfaceMonitor down
sleep 2
iwconfig $interfaceMonitor mode monitor
sleep 2
ifconfig $interfaceMonitor up

case "$isDebugMode" in

"1")
echo "DEBUG: Kali 2.x Fix - Step 2"
echo ""
echo "$interface"
echo "$interfaceMonitor"
read pause
;;
esac
}


# This will output all variables and values currently in use, and is for debugging purposes only
dumpEnvironment(){
Expand All @@ -6572,6 +6592,7 @@ dumpEnvironment(){

initMain


############################################################################
# INITIAL LAUNCH END ###################################################
############################################################################
Expand Down

0 comments on commit 73a20c1

Please sign in to comment.