Merge pull request #291 from rad4day/master

Improvementes to debugmode and update
This commit is contained in:
deltax 2016-12-04 00:57:04 +01:00 committed by GitHub
commit 1790229f26
1 changed files with 87 additions and 82 deletions

167
fluxion
View File

@ -27,7 +27,7 @@ ipNmap=`ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*)
# Deauth duration during handshake capture # Deauth duration during handshake capture
# oo # oo
DEAUTHTIME="9999999999999" DEAUTHTIME="9999999999999"
revision=104 revision=105
version=0.23 version=0.23
IP=192.168.1.1 IP=192.168.1.1
RANG_IP=$(echo $IP | cut -d "." -f 1,2,3) RANG_IP=$(echo $IP | cut -d "." -f 1,2,3)
@ -125,99 +125,101 @@ trap exitmode SIGINT SIGHUP
# KILL ALL # KILL ALL
function exitmode { function exitmode {
conditional_clear if [ "$FLUX_DEBUG" != "1" ]; then
top conditional_clear
echo -e "\n\n"$white"["$red"-"$white"] "$red"$general_exitmode"$transparent"" top
echo -e "\n\n"$white"["$red"-"$white"] "$red"$general_exitmode"$transparent""
if ps -A | grep -q aireplay-ng; then if ps -A | grep -q aireplay-ng; then
echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"aireplay-ng"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"aireplay-ng"$transparent""
killall aireplay-ng &>$flux_output_device killall aireplay-ng &>$flux_output_device
fi fi
if ps -A | grep -q airodump-ng; then if ps -A | grep -q airodump-ng; then
echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"airodump-ng"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"airodump-ng"$transparent""
killall airodump-ng &>$flux_output_device killall airodump-ng &>$flux_output_device
fi fi
if ps a | grep python| grep fakedns; then if ps a | grep python| grep fakedns; then
echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"python"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"python"$transparent""
kill $(ps a | grep python| grep fakedns | awk '{print $1}') &>$flux_output_device kill $(ps a | grep python| grep fakedns | awk '{print $1}') &>$flux_output_device
fi fi
if ps -A | grep -q hostapd; then if ps -A | grep -q hostapd; then
echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"hostapd"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"hostapd"$transparent""
killall hostapd &>$flux_output_device killall hostapd &>$flux_output_device
fi fi
if ps -A | grep -q lighttpd; then if ps -A | grep -q lighttpd; then
echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"lighttpd"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"lighttpd"$transparent""
killall lighttpd &>$flux_output_device killall lighttpd &>$flux_output_device
fi fi
if ps -A | grep -q dhcpd; then if ps -A | grep -q dhcpd; then
echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"dhcpd"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"dhcpd"$transparent""
killall dhcpd &>$flux_output_device killall dhcpd &>$flux_output_device
fi fi
if ps -A | grep -q mdk3; then if ps -A | grep -q mdk3; then
echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"mdk3"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"Kill "$grey"mdk3"$transparent""
killall mdk3 &>$flux_output_device killall mdk3 &>$flux_output_device
fi fi
if [ "$WIFI_MONITOR" != "" ]; then if [ "$WIFI_MONITOR" != "" ]; then
echo -e ""$weis"["$rot"-"$weis"] "$weis"$general_exitmode_1 "$green"$WIFI_MONITOR"$transparent"" echo -e ""$weis"["$rot"-"$weis"] "$weis"$general_exitmode_1 "$green"$WIFI_MONITOR"$transparent""
./airmon stop $WIFI_MONITOR &> $flux_output_device ./airmon stop $WIFI_MONITOR &> $flux_output_device
fi fi
if [ "$WIFI" != "" ]; then if [ "$WIFI" != "" ]; then
echo -e ""$weis"["$rot"-"$weis"] "$weis"$general_exitmode_2 "$green"$WIFI"$transparent"" echo -e ""$weis"["$rot"-"$weis"] "$weis"$general_exitmode_2 "$green"$WIFI"$transparent""
./airmon stop $WIFI &> $flux_output_device ./airmon stop $WIFI &> $flux_output_device
./airmon stop $WIFI_MONITOR1 &> $flux_output_device ./airmon stop $WIFI_MONITOR1 &> $flux_output_device
./airmon stop $WIFI_MONITOR2 &> $flux_output_device ./airmon stop $WIFI_MONITOR2 &> $flux_output_device
./airmon stop $WIFI_MONITOR3 &> $flux_output_device ./airmon stop $WIFI_MONITOR3 &> $flux_output_device
./airmon stop $WIFI_MONITOR4 &> $flux_output_device ./airmon stop $WIFI_MONITOR4 &> $flux_output_device
./airmon stop $WIFI_MONITOR5 &> $flux_output_device ./airmon stop $WIFI_MONITOR5 &> $flux_output_device
macchanger -p $WIFI &> $flux_output_device macchanger -p $WIFI &> $flux_output_device
fi fi
if [ "$(cat /proc/sys/net/ipv4/ip_forward)" != "0" ]; then if [ "$(cat /proc/sys/net/ipv4/ip_forward)" != "0" ]; then
echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_3"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_3"$transparent""
sysctl -w net.ipv4.ip_forward=0 &>$flux_output_device sysctl -w net.ipv4.ip_forward=0 &>$flux_output_device
fi fi
echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_4"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_4"$transparent""
iptables --flush iptables --flush
iptables --table nat --flush iptables --table nat --flush
iptables --delete-chain iptables --delete-chain
iptables --table nat --delete-chain iptables --table nat --delete-chain
echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_5"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_5"$transparent""
tput cnorm tput cnorm
if [ $FLUX_DEBUG != 1 ]; then if [ $FLUX_DEBUG != 1 ]; then
echo -e ""$white"["$red"-"$white"] "$white"Delete "$grey"files"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"Delete "$grey"files"$transparent""
rm -R $DUMP_PATH/* &>$flux_output_device rm -R $DUMP_PATH/* &>$flux_output_device
fi fi
echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_6"$transparent"" echo -e ""$white"["$red"-"$white"] "$white"$general_exitmode_6"$transparent""
# systemctl check # systemctl check
systemd=`whereis systemctl` systemd=`whereis systemctl`
if [ "$systemd" = "" ];then if [ "$systemd" = "" ];then
service network-manager restart &> $flux_output_device & service network-manager restart &> $flux_output_device &
service networking restart &> $flux_output_device & service networking restart &> $flux_output_device &
service restart networkmanager &> $flux_output_device & service restart networkmanager &> $flux_output_device &
else else
systemctl restart NetworkManager &> $flux_output_device & systemctl restart NetworkManager &> $flux_output_device &
systemctl start NetworkManager &> $flux_output_device & systemctl start NetworkManager &> $flux_output_device &
fi fi
echo -e ""$white"["$green"+"$white"] "$green"$general_exitmode_7"$transparent"" echo -e ""$white"["$green"+"$white"] "$green"$general_exitmode_7"$transparent""
echo -e ""$white"["$green"+"$white"] "$grey"$general_exitmode_8"$transparent"" echo -e ""$white"["$green"+"$white"] "$grey"$general_exitmode_8"$transparent""
sleep 2 sleep 2
clear clear
exit fi
exit
} }
@ -772,7 +774,7 @@ fi
if [ $FLUX_DEBUG != 1 ]; then if [ $FLUX_DEBUG != 1 ]; then
whiptail --title "Fluxion Disclaimer" --msgbox "Fluxion is intended to be used for legal security purposes only, and you should only use it to protect networks/hosts you own or have permission to test. Any other use is not the responsibility of the developer(s). Be sure that you understand and are complying with the Fluxion licenses and laws in your area. In other words, don't be stupid, don't be an asshole, and use this tool responsibly and legallys." 10 60 whiptail --title "Fluxion Disclaimer" --msgbox "Fluxion is intended to be used for legal security purposes only, and you should only use it to protect networks/hosts you own or have permission to test. Any other use is not the responsibility of the developer(s). Be sure that you understand and are complying with the Fluxion licenses and laws in your area. In other words, don't be stupid, don't be an asshole, and use this tool responsibly and legallys." 10 60
echo "" clear; echo ""
sleep 0.01 && echo -e "$red " sleep 0.01 && echo -e "$red "
sleep 0.01 && echo -e " ⌠▓▒▓▒ ⌠▓╗ ⌠█┐ ┌█ ┌▓\ /▓┐ ⌠▓╖ ⌠◙▒▓▒◙ ⌠█\ ☒┐ " sleep 0.01 && echo -e " ⌠▓▒▓▒ ⌠▓╗ ⌠█┐ ┌█ ┌▓\ /▓┐ ⌠▓╖ ⌠◙▒▓▒◙ ⌠█\ ☒┐ "
sleep 0.01 && echo -e " ║▒_ │▒║ │▒║ ║▒ \▒\/▒/ │☢╫ │▒┌╤┐▒ ║▓▒\ ▓║ " sleep 0.01 && echo -e " ║▒_ │▒║ │▒║ ║▒ \▒\/▒/ │☢╫ │▒┌╤┐▒ ║▓▒\ ▓║ "
@ -799,10 +801,12 @@ if [ $FLUX_DEBUG != 1 ]; then
if [ "$revision" != "$revision_online" ]; then if [ "$revision" != "$revision_online" ]; then
echo echo
echo echo
echo -e $red" New revision found!" $blue "->"$yellow" Update? [ENTER=skip]" echo -ne $red" New revision found! "$yellow
read doupdate echo -ne "Update? [Y/n]: "$transparent
read -N1 doupdate
echo -ne "$transparent" echo -ne "$transparent"
if [ "$doupdate" != "" ]; then doupdate=${doupdate:-"Y"}
if [ "$doupdate" = "Y" ]; then
cp $0 $HOME/flux_rev-$revision.backup cp $0 $HOME/flux_rev-$revision.backup
curl "https://raw.githubusercontent.com/deltaxflux/fluxion/master/fluxion" -s -o $0 curl "https://raw.githubusercontent.com/deltaxflux/fluxion/master/fluxion" -s -o $0
echo echo
@ -812,6 +816,7 @@ if [ $FLUX_DEBUG != 1 ]; then
sleep 3 sleep 3
chmod +x $0 chmod +x $0
exec $0 exec $0
exit
fi fi
fi fi
fi fi