From 3df7ec512dd3007c440194e315fefbc1ef66bb7f Mon Sep 17 00:00:00 2001 From: Matias Barcenas Date: Wed, 20 Dec 2017 18:30:09 -0600 Subject: [PATCH] Fixed pkg-manager bug, and other minor issues. Fixed a bug caused by not resetting the package manager after finishing. The bug occured only when the installer was interrupted. Removed obsolete code from fluxion's exit procedure. Added better message feedback to the apt manager. Updated languages' dialog for new package manager reset notice. --- fluxion.sh | 19 ++++++++++++------- language/cs.sh | 1 + language/de.sh | 1 + language/el.sh | 1 + language/en.sh | 1 + language/es.sh | 1 + language/fr.sh | 1 + language/it.sh | 1 + language/pl.sh | 1 + language/pt-br.sh | 1 + language/ro.sh | 1 + language/sk.sh | 1 + language/sl.sh | 1 + language/tk.sh | 1 + language/zh.sh | 1 + lib/installer/InstallerUtils.sh | 6 +++--- 16 files changed, 29 insertions(+), 10 deletions(-) diff --git a/fluxion.sh b/fluxion.sh index 7e15fc0..f506d02 100755 --- a/fluxion.sh +++ b/fluxion.sh @@ -92,12 +92,14 @@ function fluxion_exitmode() { echo -e "$CWht[$CRed-$CWht]$CRed $FLUXIONCleanupAndClosingNotice$CClr" + # List currently running processes which we might have to kill before exiting. local processes readarray processes < <(ps -A) - # Currently, fluxion is only responsible for killing airodump-ng, - # since it uses it to scan for candidate target access points. - # Everything else should be taken care of by the custom attack abort handler. + # Currently, fluxion is only responsible for killing airodump-ng, because + # fluxion explicitly it uses it to scan for candidate target access points. + # NOTICE: Processes started by subscripts, such as an attack script, + # MUST BE TERMINATED BY THAT SAME SCRIPT in the subscript's abort handler. local targets=("airodump-ng") local targetID # Program identifier/title @@ -109,10 +111,13 @@ function fluxion_exitmode() { killall $targetPID &> $FLUXIONOutputDevice done - if [ "$WIAccessPoint" ]; then - echo -e "$CWht[$CRed-$CWht] $FLUXIONDisablingExtraInterfacesNotice$CGrn $WIAccessPoint$CClr" - iw dev $WIAccessPoint del &> $FLUXIONOutputDevice - fi + + # If the installer activated the package manager, make sure to undo any changes. + if [ "$PackageManagerCLT" ]; then + echo -e "$CWht[$CRed-$CWht] "$(io_dynamic_output "$FLUXIONRestoringPackageManagerNotice")"$CClr" + unprep_package_manager + fi + if [ "$WIMonitor" ]; then echo -e "$CWht[$CRed-$CWht] $FLUXIONDisablingMonitorNotice$CGrn $WIMonitor$CClr" diff --git a/language/cs.sh b/language/cs.sh index f065070..2928752 100755 --- a/language/cs.sh +++ b/language/cs.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Failed to start xterm session (possible # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Čištění a zavírání" FLUXIONKillingProcessNotice="Killing ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Vypínání monitorovacího rozhraní" FLUXIONDisablingExtraInterfacesNotice="Vypínání rozhraní" FLUXIONDisablingPacketForwardingNotice="Vypínání ${CGry}směrování packetů" diff --git a/language/de.sh b/language/de.sh index 27f3035..41030a5 100755 --- a/language/de.sh +++ b/language/de.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Xterm Terminal konnte nicht gestartet we # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Aufräumen und schließen" FLUXIONKillingProcessNotice="Killing ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Deaktivierung der Netzwerkkarte" FLUXIONDisablingExtraInterfacesNotice="Deaktivierung der Netzwerkkarte" FLUXIONDisablingPacketForwardingNotice="Deaktivierung ${CGry}von der Weiterleitung von Paketen" diff --git a/language/el.sh b/language/el.sh index d4bb485..0982ee2 100755 --- a/language/el.sh +++ b/language/el.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Failed to start xterm session (possible # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Καθαρισμός και τερματισμός" FLUXIONKillingProcessNotice="Killing ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Απενεργοποίση εποπτείας περιβάλλοντος" FLUXIONDisablingExtraInterfacesNotice="Απενεργοποίηση περιβάλλοντος" FLUXIONDisablingPacketForwardingNotice="Απενεργοποίηση ${CGry}προώθησης των πακέτων" diff --git a/language/en.sh b/language/en.sh index fe81046..6f9ea4a 100755 --- a/language/en.sh +++ b/language/en.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Failed to start xterm session (possible # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Cleaning and closing" FLUXIONKillingProcessNotice="Killing ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Disabling monitoring interface" FLUXIONDisablingExtraInterfacesNotice="Disabling extra interfaces" FLUXIONDisablingPacketForwardingNotice="Disabling ${CGry}forwarding of packets" diff --git a/language/es.sh b/language/es.sh index f9f4c76..81e2faa 100755 --- a/language/es.sh +++ b/language/es.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Failed to start xterm session (possible # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Limpiando y cerrando" FLUXIONKillingProcessNotice="Killing ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Deshabilitando interfaz de monitoreo" FLUXIONDisablingExtraInterfacesNotice="Deshabilitando interfaz" FLUXIONDisablingPacketForwardingNotice="Deshabilitando ${CGry}reenvio de paquetes" diff --git a/language/fr.sh b/language/fr.sh index 192dd52..c8a7a09 100755 --- a/language/fr.sh +++ b/language/fr.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed} Echec au lancement de la session xterm # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Nettoyage et fermeture" FLUXIONKillingProcessNotice="Killing ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Désactivation de l'interface de monitoring" FLUXIONDisablingExtraInterfacesNotice="Désactivation de l'interface" FLUXIONDisablingPacketForwardingNotice="Désactivation de ${CGry}transmission de paquets" diff --git a/language/it.sh b/language/it.sh index 0743980..42d2a15 100755 --- a/language/it.sh +++ b/language/it.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Errore nell'avvio della sessione XTerm ( # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Pulizia e chiusura" FLUXIONKillingProcessNotice="Killing ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Disabilito l'Interfaccia Monitor" FLUXIONDisablingExtraInterfacesNotice="Disabilito l'Interfaccia" FLUXIONDisablingPacketForwardingNotice="Disabilito ${CGry}l'invio dei pacchetti" diff --git a/language/pl.sh b/language/pl.sh index 3fa2776..b709a78 100644 --- a/language/pl.sh +++ b/language/pl.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed} Start xterm niemożliwy (źle skonfigur # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Sprzątanie i zamykanie" FLUXIONKillingProcessNotice="Zabijanie procesu ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Wyłączanie karty monitorującej" FLUXIONDisablingExtraInterfacesNotice="Disabling extra interfaces" FLUXIONDisablingPacketForwardingNotice="Disabling ${CGry}forwarding of packets" diff --git a/language/pt-br.sh b/language/pt-br.sh index 9abf151..64e01e3 100755 --- a/language/pt-br.sh +++ b/language/pt-br.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Falha ao iniciar a sessão xterm (possiv # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Limpando e saindo" FLUXIONKillingProcessNotice="Matando ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Desabilitando interface do modo monitor" FLUXIONDisablingExtraInterfacesNotice="Desabilitando interfaces extras" FLUXIONDisablingPacketForwardingNotice="Desabilitando ${CGry}encaminhador de pacotes" diff --git a/language/ro.sh b/language/ro.sh index 0582bbd..f60074c 100755 --- a/language/ro.sh +++ b/language/ro.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Failed to start xterm session (possible # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Curatire si inchidere" FLUXIONKillingProcessNotice="Killing ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Dezacticati interfata monitorizata" FLUXIONDisablingExtraInterfacesNotice="Dezactivati interfata" FLUXIONDisablingPacketForwardingNotice="Dezactivati ${CGry}forwarding of packets" diff --git a/language/sk.sh b/language/sk.sh index a66aac8..9cf48e6 100644 --- a/language/sk.sh +++ b/language/sk.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Nepodarilo sa spustiť 'xterm session' ( # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Čistím a zatváram" FLUXIONKillingProcessNotice="Ukončujem ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Vypínam monitorovací adaptér" FLUXIONDisablingExtraInterfacesNotice="Vypínam extra adaptéry" FLUXIONDisablingPacketForwardingNotice="Vypínam ${CGry}smerovanie packet-ov" diff --git a/language/sl.sh b/language/sl.sh index c4c33be..7749eea 100755 --- a/language/sl.sh +++ b/language/sl.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Failed to start xterm session (possible # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Čiščenje in zapiranje" FLUXIONKillingProcessNotice="Killing ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Onemogočanje nadzornega načina" FLUXIONDisablingExtraInterfacesNotice="Onemogočanje vmesnika" FLUXIONDisablingPacketForwardingNotice="Onemogočanje ${CGry}posredovanja paketov" diff --git a/language/tk.sh b/language/tk.sh index b8c356b..6669584 100755 --- a/language/tk.sh +++ b/language/tk.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Failed to start xterm session (possible # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="Temizleniyor ve Kapatiliyor" FLUXIONKillingProcessNotice="Killing ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="Monitor modu kapatiliyor" FLUXIONDisablingExtraInterfacesNotice="Ag Arayuzu kapatiliyor" FLUXIONDisablingPacketForwardingNotice="Kapatiliyor ${CGry}forwarding of packets" diff --git a/language/zh.sh b/language/zh.sh index 44d4b14..64d1cac 100755 --- a/language/zh.sh +++ b/language/zh.sh @@ -66,6 +66,7 @@ FLUXIONGeneralXTermFailureError="${CRed}Failed to start xterm session (possible # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FLUXIONCleanupAndClosingNotice="清理进程并退出" FLUXIONKillingProcessNotice="Killing ${CGry}\$targetID$CClr" +FLUXIONRestoringPackageManagerNotice="Restoring ${CCyn}\$PackageManagerCLT$CClr" FLUXIONDisablingMonitorNotice="关闭监听模式界面" FLUXIONDisablingExtraInterfacesNotice="关闭USB外部网卡接口" FLUXIONDisablingPacketForwardingNotice="关闭 ${CGry}转发数据包" diff --git a/lib/installer/InstallerUtils.sh b/lib/installer/InstallerUtils.sh index 98d638e..3e58bf5 100755 --- a/lib/installer/InstallerUtils.sh +++ b/lib/installer/InstallerUtils.sh @@ -14,7 +14,7 @@ PackageManagerLog="$InstallerUtilsWorkspacePath/package_manager.log" function installer_utils_run_spinner() { local pid=$1 local delay=0.15 - local spinstr='|/-\' + local spinstr="|/-\\" tput civis while [ "`ps a | awk '{print $1}' | grep $pid`" ]; do @@ -150,7 +150,7 @@ function installer_utils_run_update() { if [ ! -d "$__installer_utils_run_update__output" ]; then if ! mkdir -p "$__installer_utils_run_update__output"; then - format_center_literals "${CRed}[ ~ Failed To Create Destination Directory ~ ]$CClr"; echo + format_center_literals "${CRed}[ ~ Failed To Create Destination Directory ~ ]$CClr"; echo fi fi @@ -186,7 +186,7 @@ function installer_utils_check_dependencies() { if [ ${#InstallerUtilsCheckDependencies[@]} -gt 0 ]; then return 2; fi } -# Parameters: $1 - CLI Tools missing array (will be installed) $2 - substitutes array +# Parameters: $1 - CLI Tools missing array (will be installed) $2 - substitutes array function installer_utils_run_dependencies() { if [ ! "$1" ]; then return 1; fi