diff --git a/CHANGELOG.md b/CHANGELOG.md index 1023c5877..1b1dfa093 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +### 7.01 + - Fixed bug while changing interface mode if the destination interface name is in use + - Removed util-linux dependency for rev use + - The existing iptables rules before the launch of airgeddon are now restored upon exiting if modified + - Fixed bug while checking for NetworkManager's version on some linux distributions + - Tested compatibility with Kali Linux 2017.1 and Parrot 3.5 + - Dockerfile updated + ### 7.0 - New WEP attacks menu - Added All-in-One WEP attack diff --git a/Dockerfile b/Dockerfile index 2564fd552..4eda428a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,10 +102,9 @@ COPY \ #airgeddon install method 2 (only one method can be used, other must be commented) #Install airgeddon (manual image build) -#Uncomment one of the three to select branch (master->latest, dev->beta, docker->alpha) +#Uncomment one of them to select branch (master->latest, dev->beta) #ENV BRANCH="master" #ENV BRANCH="dev" -#ENV BRANCH="docker" #RUN \ # git clone -b ${BRANCH} ${AIRGEDDON_URL} diff --git a/README.md b/README.md index 240664b87..b119a3cd1 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ All the needed info about how to install|use|enjoy `airgeddon` is present at [Gi [Hat Tip To]: https://github.com/v1s1t0r1sh3r3/airgeddon/wiki/Hat%20Tip%20To [Inspiration]: https://github.com/v1s1t0r1sh3r3/airgeddon/wiki/Inspiration -[Version-shield]: https://img.shields.io/badge/version-7.0-blue.svg?style=flat-square&colorA=273133&colorB=0093ee "Latest version" +[Version-shield]: https://img.shields.io/badge/version-7.01-blue.svg?style=flat-square&colorA=273133&colorB=0093ee "Latest version" [Bash4.2-shield]: https://img.shields.io/badge/bash-4.2%2B-blue.svg?style=flat-square&colorA=273133&colorB=00db00 "Bash 4.2 or later" [License-shield]: https://img.shields.io/badge/license-GPL%20v3%2B-blue.svg?style=flat-square&colorA=273133&colorB=bd0000 "GPL v3+" [Docker-shield]: https://img.shields.io/docker/automated/v1s1t0r1sh3r3/airgeddon.svg?style=flat-square&colorA=273133&colorB=f9ff5a "Docker rules!" diff --git a/airgeddon.sh b/airgeddon.sh index 1c7aa46d8..630d5fffb 100644 --- a/airgeddon.sh +++ b/airgeddon.sh @@ -2,8 +2,8 @@ #Title........: airgeddon.sh #Description..: This is a multi-use bash script for Linux systems to audit wireless networks. #Author.......: v1s1t0r -#Date.........: 20170505 -#Version......: 7.0 +#Date.........: 20170508 +#Version......: 7.01 #Usage........: bash airgeddon.sh #Bash Version.: 4.2 or later @@ -106,8 +106,8 @@ declare -A possible_alias_names=( ) #General vars -airgeddon_version="7.0" -language_strings_expected_version="7.0-1" +airgeddon_version="7.01" +language_strings_expected_version="7.01-1" standardhandshake_filename="handshake-01.cap" tmpdir="/tmp/" osversionfile_dir="/etc/" @@ -751,7 +751,7 @@ function calculate_easybox_algorithm() { Z1=$((0x${hexi[2]} ^ hex_to_dec[3])) Z2=$((0x${hexi[3]} ^ hex_to_dec[2])) - easybox_pin=$(printf '%08d\n' "$((0x$X1$X2$Y1$Y2$Z1$Z2$X3))" | rev | cut -c -7 | rev) + easybox_pin=$(printf '%08d\n' "$((0x$X1$X2$Y1$Y2$Z1$Z2$X3))" | awk '{for(i=length; i!=0; i--) x=x substr($0, i, 1);} END {print x}' | cut -c -7 | awk '{for(i=length; i!=0; i--) x=x substr($0, i, 1);} END {print x}') } #Calculate the last digit on pin following the checksum rule @@ -874,7 +874,7 @@ function prepare_et_interface() { et_initial_state=${ifacemode} if [ "${ifacemode}" != "Managed" ]; then - new_interface=$(${airmon} stop "${interface}" 2> /dev/null | grep station) + new_interface=$(${airmon} stop "${interface}" 2> /dev/null | grep station | head -n 1) ifacemode="Managed" [[ ${new_interface} =~ \]?([A-Za-z0-9]+)\)?$ ]] && new_interface="${BASH_REMATCH[1]}" if [ "${interface}" != "${new_interface}" ]; then @@ -909,6 +909,14 @@ function restore_et_interface() { ifacemode="Managed" else new_interface=$(${airmon} start "${interface}" 2> /dev/null | grep monitor) + desired_interface_name="" + [[ ${new_interface} =~ ^You[[:space:]]already[[:space:]]have[[:space:]]a[[:space:]]([A-Za-z0-9]+)[[:space:]]device ]] && desired_interface_name="${BASH_REMATCH[1]}" + if [ -n "${desired_interface_name}" ]; then + echo + language_strings "${language}" 435 "red" + language_strings "${language}" 115 "read" + return + fi ifacemode="Monitor" [[ ${new_interface} =~ \]?([A-Za-z0-9]+)\)?$ ]] && new_interface="${BASH_REMATCH[1]}" if [ "${interface}" != "${new_interface}" ]; then @@ -943,7 +951,7 @@ function managed_option() { language_strings "${language}" 17 "blue" ifconfig "${interface}" up - new_interface=$(${airmon} stop "${interface}" 2> /dev/null | grep station) + new_interface=$(${airmon} stop "${interface}" 2> /dev/null | grep station | head -n 1) ifacemode="Managed" [[ ${new_interface} =~ \]?([A-Za-z0-9]+)\)?$ ]] && new_interface="${BASH_REMATCH[1]}" @@ -993,6 +1001,16 @@ function monitor_option() { fi new_interface=$(${airmon} start "${interface}" 2> /dev/null | grep monitor) + + desired_interface_name="" + [[ ${new_interface} =~ ^You[[:space:]]already[[:space:]]have[[:space:]]a[[:space:]]([A-Za-z0-9]+)[[:space:]]device ]] && desired_interface_name="${BASH_REMATCH[1]}" + if [ -n "${desired_interface_name}" ]; then + echo + language_strings "${language}" 435 "red" + language_strings "${language}" 115 "read" + return + fi + ifacemode="Monitor" [[ ${new_interface} =~ \]?([A-Za-z0-9]+)\)?$ ]] && new_interface="${BASH_REMATCH[1]}" @@ -2855,7 +2873,30 @@ function clean_routing_rules() { echo "${original_routing_state}" > /proc/sys/net/ipv4/ip_forward fi - clean_iptables + if [ "${iptables_saved}" -eq 1 ]; then + restore_iptables + else + clean_iptables + fi +} + +#Save iptables rules +function save_iptables() { + + debug_print + + iptables-save > "${tmpdir}ag.iptables" 2> /dev/null + if [ "$?" = "0" ]; then + iptables_saved=1 + fi +} + +#Restore iptables rules +function restore_iptables() { + + debug_print + + iptables-restore < "${tmpdir}ag.iptables" 2> /dev/null } #Clean iptables rules @@ -4705,9 +4746,13 @@ function set_std_internet_routing_rules() { debug_print - routing_toclean=1 - original_routing_state=$(cat /proc/sys/net/ipv4/ip_forward) + if [ "${routing_modified}" -eq 0 ]; then + original_routing_state=$(cat /proc/sys/net/ipv4/ip_forward) + save_iptables + fi + ifconfig "${interface}" ${et_ip_router} netmask ${std_c_mask} > /dev/null 2>&1 + routing_modified=1 clean_iptables @@ -7747,7 +7792,7 @@ function exit_script_option() { echo -e "${green_color} Ok\r${normal_color}" fi - if [ ${routing_toclean} -eq 1 ]; then + if [ ${routing_modified} -eq 1 ]; then action_on_exit_taken=1 language_strings "${language}" 297 "multiline" clean_routing_rules @@ -7793,7 +7838,7 @@ function hardcore_exit() { clean_tmpfiles fi - if [ ${routing_toclean} -eq 1 ]; then + if [ ${routing_modified} -eq 1 ]; then clean_routing_rules killall dhcpd > /dev/null 2>&1 killall hostapd > /dev/null 2>&1 @@ -8318,7 +8363,9 @@ function check_if_kill_needed() { if [ "${nm_system_version}" != "" ]; then - [[ ${nm_system_version} =~ ^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]+).*?$ ]] && nm_main_system_version="${BASH_REMATCH[1]}" && nm_system_subversion="${BASH_REMATCH[2]}" && nm_system_subversion2="${BASH_REMATCH[3]}" + [[ ${nm_system_version} =~ ^([0-9]{1,2})\.([0-9]{1,2})\.?(([0-9]+)|.+)? ]] && nm_main_system_version="${BASH_REMATCH[1]}" && nm_system_subversion="${BASH_REMATCH[2]}" && nm_system_subversion2="${BASH_REMATCH[3]}" + + [[ ${nm_system_subversion2} =~ [a-zA-Z] ]] && nm_system_subversion2="0" if [ "${nm_main_system_version}" -lt ${nm_min_main_version} ]; then check_kill_needed=1 @@ -8654,7 +8701,8 @@ function initialize_script_settings() { airmon_fix autochanged_language=0 tmpfiles_toclean=0 - routing_toclean=0 + routing_modified=0 + iptables_saved=0 spoofed_mac=0 mac_spoofing_desired=0 dhcpd_path_changed=0 diff --git a/binaries/kali/airgeddon_7.01-1_all.deb b/binaries/kali/airgeddon_7.01-1_all.deb new file mode 100644 index 000000000..ac65967b3 Binary files /dev/null and b/binaries/kali/airgeddon_7.01-1_all.deb differ diff --git a/binaries/kali/airgeddon_7.0-1_all.deb b/binaries/kali/legacy/airgeddon_7.0-1_all.deb similarity index 100% rename from binaries/kali/airgeddon_7.0-1_all.deb rename to binaries/kali/legacy/airgeddon_7.0-1_all.deb diff --git a/language_strings.sh b/language_strings.sh index ed21acb4d..2f580ac3c 100644 --- a/language_strings.sh +++ b/language_strings.sh @@ -2,7 +2,7 @@ #Title........: language_strings.sh #Description..: All the translated strings that airgeddon uses are located here. #Author.......: v1s1t0r -#Date.........: 20170505 +#Date.........: 20170507 #Bash Version.: 4.2 or later #Set language_strings file version @@ -11,7 +11,7 @@ function set_language_strings_version() { debug_print - language_strings_version="7.0-1" + language_strings_version="7.01-1" } #Set different language text strings @@ -3841,6 +3841,14 @@ function language_strings() { arr["RUSSIAN",434]="Атака WEP \"Все-в-Одном\" началась. Для её остановки клавишу [Enter] в этом окне" arr["GREEK",434]="Η επίθεση WEP \"All-in-One\" έχει αρχίσει. Πατήστε το κουμπί [Enter] σε αυτό το παράθυρο για να την σταματήσετε" + arr["ENGLISH",435]="Error trying to change interface mode. During the process the interface name must be changed, but it looks like you already have an interface occupying the name that would be needed (${normal_color}${desired_interface_name}${red_color})" + arr["SPANISH",435]="Error al intentar cambiar el modo de la interfaz. En el proceso el nombre del interfaz cambia, pero parece que ya tienes un interfaz ocupando el nombre que se necesitaría (${normal_color}${desired_interface_name}${red_color})" + arr["FRENCH",435]="${pending_of_translation} Erreur lors de la tentative de changer le mode d'interface. Dans le processus, le nom des modifications de l'interface, mais il semble que vous avez déjà une interface occupant le nom nécessaire (${normal_color}${desired_interface_name}${red_color})" + arr["CATALAN",435]="${pending_of_translation} Error en intentar canviar el mode de la interfície. En el procés el nom de la interfície canvia, però sembla que ja tens una interfície ocupant el nom que es necessitaria (${normal_color}${desired_interface_name}${red_color})" + arr["PORTUGUESE",435]="${pending_of_translation} Erro ao tentar alterar o modo de interface. No processo, o nome das mudanças de interface, mas parece que você já tem uma interface que ocupa o nome necessário (${normal_color}${desired_interface_name}${red_color})" + arr["RUSSIAN",435]="${pending_of_translation} Ошибка при попытке изменить режим интерфейса. Во время процесса имя интерфейса должно быть изменено, но похоже, что у вас уже есть интерфейс, занимающий нужное имя (${normal_color}${desired_interface_name}${red_color})" + arr["GREEK",435]="${pending_of_translation} Σφάλμα κατά την προσπάθεια να αλλάξει την κατάσταση διασύνδεσης. Κατά τη διάρκεια της διαδικασίας, το όνομα διεπαφής πρέπει να αλλάξει, αλλά φαίνεται ότι έχετε ήδη μια διεπαφή που καταλαμβάνει το όνομα που θα χρειαζόταν (${normal_color}${desired_interface_name}${red_color})" + case "${3}" in "yellow") interrupt_checkpoint "${2}" "${3}"