diff --git a/fluxion.sh b/fluxion.sh index 8bf01a3..3634f0f 100755 --- a/fluxion.sh +++ b/fluxion.sh @@ -27,6 +27,9 @@ readonly FLUXIONRevision=12 # Declare window ration bigger = smaller windows FLUXIONWindowRatio=4 +# Allow to skip dependencies if required, not recommended +FLUXIONSkipDependencies=0 + # ============================================================ # # ================= < Script Sanity Checks > ================= # # ============================================================ # @@ -80,7 +83,7 @@ source "$FLUXIONPath/lib/Help.sh" # ============================================================ # if ! FLUXIONCLIArguments=$( getopt --options="vdkrnmtbhe:c:l:a:r" \ - --longoptions="debug,version,killer,reloader,help,airmon-ng,multiplexer,target,test,auto,bssid:,essid:,channel:,language:,attack:,ratio:" \ + --longoptions="debug,version,killer,reloader,help,airmon-ng,multiplexer,target,test,auto,bssid:,essid:,channel:,language:,attack:,ratio,skip-dependencies" \ --name="FLUXION V$FLUXIONVersion.$FLUXIONRevision" -- "$@" ); then echo -e "${CRed}Aborted$CClr, parameter error detected..."; exit 5 @@ -120,6 +123,7 @@ while [ "$1" != "" -a "$1" != "--" ]; do -a|--attack) FluxionAttack=$2; shift;; --ratio) FLUXIONWindowRatio=$2; shift;; --auto) readonly FLUXIONAuto=1;; + --skip-dependencies) readonly FLUXIONSkipDependencies=1;; esac shift # Shift new parameters done @@ -274,14 +278,16 @@ fluxion_startup() { "fuser:psmisc" "killall:psmisc" ) - while ! installer_utils_check_dependencies requiredCLITools[@]; do - if ! installer_utils_run_dependencies InstallerUtilsCheckDependencies[@]; then - echo - echo -e "${CRed}Dependency installation failed!$CClr" - echo "Press enter to retry, ctrl+c to exit..." - read bullshit - fi - done + if [ $FLUXIONSkipDependencies != 1 ];then + while ! installer_utils_check_dependencies requiredCLITools[@]; do + if ! installer_utils_run_dependencies InstallerUtilsCheckDependencies[@]; then + echo + echo -e "${CRed}Dependency installation failed!$CClr" + echo "Press enter to retry, ctrl+c to exit..." + read bullshit + fi + done + fi echo -e "\n\n" # This echo is for spacing } diff --git a/lib/InterfaceUtils.sh b/lib/InterfaceUtils.sh index 1d8f3ba..8ed1da8 100755 --- a/lib/InterfaceUtils.sh +++ b/lib/InterfaceUtils.sh @@ -162,18 +162,18 @@ function interface_set_mode() { function interface_reidentify() { if [ ${#@} -ne 2 ]; then return 1; fi - + local -r __interface_reidentify__oldIdentifier=$1 local -r __interface_reidentify__newIdentifier=$2 - + if [[ $__interface_reidentify__newIdentifier == *" "* ]] then return 2 fi - + if ! interface_set_state $__interface_reidentify__oldIdentifier down then return 3 fi - + # TODO: Add alternatives to 'ip' in case of failure. ip link set $__interface_reidentify__oldIdentifier name $__interface_reidentify__newIdentifier return $? diff --git a/lib/installer/InstallerUtils.sh b/lib/installer/InstallerUtils.sh index 97e5fba..e3af974 100755 --- a/lib/installer/InstallerUtils.sh +++ b/lib/installer/InstallerUtils.sh @@ -11,7 +11,7 @@ InstallerUtilsNoticeMark="*" PackageManagerLog="$InstallerUtilsWorkspacePath/package_manager.log" -function installer_utils_run_spinner() { +installer_utils_run_spinner() { local pid=$1 local delay=0.15 local spinstr="|/-\\" @@ -33,7 +33,7 @@ function installer_utils_run_spinner() { # $1 source - Online Info File (text) # $2 version regex - Online version (regex) # $3 revision regex - Online version (regex) -function installer_utils_check_version() { +installer_utils_check_version() { if [ ${#@} -ne 3 ]; then return 1; fi # Attempt to retrieve versioning information from repository script. @@ -59,7 +59,7 @@ function installer_utils_check_version() { # $3 version local - Local version (number) # $4 revision regex - Online version (regex) # $5 revision local - Local version (number) -function installer_utils_check_update() { +installer_utils_check_update() { # The following set of statements aren't very generic, need to be refactored. local versionDialog="Online Version" local versionDialogOffset=$(($(tput cols) / 2 + ((${#versionDialog} / 2) - 4))) @@ -108,7 +108,7 @@ function installer_utils_check_update() { } # Parameters: $1 - Update source (zip) $2 - Backup file name $3 - Update output -function installer_utils_run_update() { +installer_utils_run_update() { if [ ${#@} -ne 3 ]; then return 1; fi local __installer_utils_run_update__source="$1" @@ -204,7 +204,7 @@ function installer_utils_run_update() { } # Parameters: $1 - CLI Tools required array $2 - CLI Tools missing array (will be populated) -function installer_utils_check_dependencies() { +installer_utils_check_dependencies() { if [ ! "$1" ]; then return 1; fi local __installer_utils_check_dependencies__CLIToolsInfo=("${!1}") @@ -229,15 +229,14 @@ function installer_utils_check_dependencies() { } # Parameters: $1 - CLI Tools missing array (will be installed) $2 - substitutes array -function installer_utils_run_dependencies() { +installer_utils_run_dependencies() { if [ ! "$1" ]; then return 1; fi if ! ping -q -w 1 -c 1 8.8.8.8 &> /dev/null; then format_center_literals "[${CRed}!$CClr] ${CBYel}No internet connection found!$CClr" echo -e "\n\n$FormatCenterLiterals" format_center_literals "[ ${CSRed}CANNOT CONTINUE${CClr} ]" - echo -e "$FormatCenterLiterals" - sleep 5 + echo -e "$FormatCenterLiterals"; sleep 3 return 3 fi @@ -254,12 +253,12 @@ function installer_utils_run_dependencies() { done if [ ! "$PackageManagerCLT" ]; then - format_center_literals "${CRed}[ ~ No Suitable Package Manager Found ~ ]$CClr" - echo + format_center_literals "${CRed}[ ~ No Suitable Package Manager Found ~ ]$CClr";echo sleep 3 return 2 fi + check_package_manager prep_package_manager unset __installer_utils_run_dependencies__installerStatus diff --git a/lib/installer/managers/apt.sh b/lib/installer/managers/apt.sh index f00d3e3..05cce57 100755 --- a/lib/installer/managers/apt.sh +++ b/lib/installer/managers/apt.sh @@ -11,6 +11,10 @@ if [ -f "/etc/debian_version" ]; then echo "$(cat /etc/apt/sources.list | grep -v 'deb http://http.kali.org/kali kali-rolling main non-free contrib # Installed By FLUXION')" >/etc/apt/sources.list } + check_package_manager() { + echo "Nothing to check." >$PackageManagerOutputDevice + } + prep_package_manager() { if [ ! "$(cat /etc/apt/sources.list | egrep 'deb http://http.kali.org/kali ((kali-rolling|main|contrib|non-free) )*')" ]; then echo "Adding missing sources to package manager, please wait." diff --git a/lib/installer/managers/emerge.sh b/lib/installer/managers/emerge.sh index 28033b3..1266d08 100755 --- a/lib/installer/managers/emerge.sh +++ b/lib/installer/managers/emerge.sh @@ -11,6 +11,10 @@ if [ -f "/etc/gentoo-release" ]; then echo "Nothing to unprepare." >$PackageManagerOutputDevice } + check_package_manager() { + echo "Nothing to check." >$PackageManagerOutputDevice + } + prep_package_manager() { echo "Nothing to prepare." >$PackageManagerOutputDevice } diff --git a/lib/installer/managers/pacman.sh b/lib/installer/managers/pacman.sh index f939e34..ffc6a3a 100755 --- a/lib/installer/managers/pacman.sh +++ b/lib/installer/managers/pacman.sh @@ -19,6 +19,10 @@ if [ -f "/etc/arch-release" ]; then echo "Nothing to unprepare." >$PackageManagerOutputDevice } + check_package_manager() { + if [ -f "/var/lib/pacman/db.lck" ];then echo -e "[\033[31m!\033[0m] Pacman is locked, can't install dependencies. Exit."; exit 4; fi + } + prep_package_manager() { echo "Nothing to prepare." >$PackageManagerOutputDevice } diff --git a/lib/installer/managers/yum.sh b/lib/installer/managers/yum.sh index 1f15913..f9d53d3 100755 --- a/lib/installer/managers/yum.sh +++ b/lib/installer/managers/yum.sh @@ -11,6 +11,10 @@ if [ -f "/etc/redhat-release" ]; then echo "Nothing to unprepare." >$PackageManagerOutputDevice } + check_package_manager () { + echo "Nothing to check." >$PackageManagerOutputDevice + } + prep_package_manager() { echo "Nothing to prepare." >$PackageManagerOutputDevice } diff --git a/lib/installer/managers/zypp.sh b/lib/installer/managers/zypp.sh index c28dbb8..81df10f 100755 --- a/lib/installer/managers/zypp.sh +++ b/lib/installer/managers/zypp.sh @@ -11,6 +11,10 @@ if [ -f "/etc/SuSE-release" ]; then echo "Nothing to unprepare." >$PackageManagerOutputDevice } + check_package_manager() { + echo "Nothing to check." >$PackageManagerOutputDevice + } + prep_package_manager() { echo "Nothing to prepare." >$PackageManagerOutputDevice }