Merge branch 'master' of github.com:FluxionNetwork/fluxion

This commit is contained in:
Matias Barcenas 2018-05-29 18:02:25 -05:00
commit 7292f90369
8 changed files with 48 additions and 23 deletions

View File

@ -27,6 +27,9 @@ readonly FLUXIONRevision=12
# Declare window ration bigger = smaller windows # Declare window ration bigger = smaller windows
FLUXIONWindowRatio=4 FLUXIONWindowRatio=4
# Allow to skip dependencies if required, not recommended
FLUXIONSkipDependencies=0
# ============================================================ # # ============================================================ #
# ================= < Script Sanity Checks > ================= # # ================= < Script Sanity Checks > ================= #
# ============================================================ # # ============================================================ #
@ -80,7 +83,7 @@ source "$FLUXIONPath/lib/Help.sh"
# ============================================================ # # ============================================================ #
if ! FLUXIONCLIArguments=$( if ! FLUXIONCLIArguments=$(
getopt --options="vdkrnmtbhe:c:l:a:r" \ 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" -- "$@" --name="FLUXION V$FLUXIONVersion.$FLUXIONRevision" -- "$@"
); then ); then
echo -e "${CRed}Aborted$CClr, parameter error detected..."; exit 5 echo -e "${CRed}Aborted$CClr, parameter error detected..."; exit 5
@ -120,6 +123,7 @@ while [ "$1" != "" -a "$1" != "--" ]; do
-a|--attack) FluxionAttack=$2; shift;; -a|--attack) FluxionAttack=$2; shift;;
--ratio) FLUXIONWindowRatio=$2; shift;; --ratio) FLUXIONWindowRatio=$2; shift;;
--auto) readonly FLUXIONAuto=1;; --auto) readonly FLUXIONAuto=1;;
--skip-dependencies) readonly FLUXIONSkipDependencies=1;;
esac esac
shift # Shift new parameters shift # Shift new parameters
done done
@ -274,6 +278,7 @@ fluxion_startup() {
"fuser:psmisc" "killall:psmisc" "fuser:psmisc" "killall:psmisc"
) )
if [ $FLUXIONSkipDependencies != 1 ];then
while ! installer_utils_check_dependencies requiredCLITools[@]; do while ! installer_utils_check_dependencies requiredCLITools[@]; do
if ! installer_utils_run_dependencies InstallerUtilsCheckDependencies[@]; then if ! installer_utils_run_dependencies InstallerUtilsCheckDependencies[@]; then
echo echo
@ -282,6 +287,7 @@ fluxion_startup() {
read bullshit read bullshit
fi fi
done done
fi
echo -e "\n\n" # This echo is for spacing echo -e "\n\n" # This echo is for spacing
} }

View File

@ -11,7 +11,7 @@ InstallerUtilsNoticeMark="*"
PackageManagerLog="$InstallerUtilsWorkspacePath/package_manager.log" PackageManagerLog="$InstallerUtilsWorkspacePath/package_manager.log"
function installer_utils_run_spinner() { installer_utils_run_spinner() {
local pid=$1 local pid=$1
local delay=0.15 local delay=0.15
local spinstr="|/-\\" local spinstr="|/-\\"
@ -33,7 +33,7 @@ function installer_utils_run_spinner() {
# $1 source - Online Info File (text) # $1 source - Online Info File (text)
# $2 version regex - Online version (regex) # $2 version regex - Online version (regex)
# $3 revision 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 if [ ${#@} -ne 3 ]; then return 1; fi
# Attempt to retrieve versioning information from repository script. # Attempt to retrieve versioning information from repository script.
@ -59,7 +59,7 @@ function installer_utils_check_version() {
# $3 version local - Local version (number) # $3 version local - Local version (number)
# $4 revision regex - Online version (regex) # $4 revision regex - Online version (regex)
# $5 revision local - Local version (number) # $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. # The following set of statements aren't very generic, need to be refactored.
local versionDialog="Online Version" local versionDialog="Online Version"
local versionDialogOffset=$(($(tput cols) / 2 + ((${#versionDialog} / 2) - 4))) 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 # 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 if [ ${#@} -ne 3 ]; then return 1; fi
local __installer_utils_run_update__source="$1" 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) # 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 if [ ! "$1" ]; then return 1; fi
local __installer_utils_check_dependencies__CLIToolsInfo=("${!1}") 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 # 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 [ ! "$1" ]; then return 1; fi
if ! ping -q -w 1 -c 1 8.8.8.8 &> /dev/null; then 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" format_center_literals "[${CRed}!$CClr] ${CBYel}No internet connection found!$CClr"
echo -e "\n\n$FormatCenterLiterals" echo -e "\n\n$FormatCenterLiterals"
format_center_literals "[ ${CSRed}CANNOT CONTINUE${CClr} ]" format_center_literals "[ ${CSRed}CANNOT CONTINUE${CClr} ]"
echo -e "$FormatCenterLiterals" echo -e "$FormatCenterLiterals"; sleep 3
sleep 5
return 3 return 3
fi fi
@ -254,12 +253,12 @@ function installer_utils_run_dependencies() {
done done
if [ ! "$PackageManagerCLT" ]; then if [ ! "$PackageManagerCLT" ]; then
format_center_literals "${CRed}[ ~ No Suitable Package Manager Found ~ ]$CClr" format_center_literals "${CRed}[ ~ No Suitable Package Manager Found ~ ]$CClr";echo
echo
sleep 3 sleep 3
return 2 return 2
fi fi
check_package_manager
prep_package_manager prep_package_manager
unset __installer_utils_run_dependencies__installerStatus unset __installer_utils_run_dependencies__installerStatus

View File

@ -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 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() { prep_package_manager() {
if [ ! "$(cat /etc/apt/sources.list | egrep 'deb http://http.kali.org/kali ((kali-rolling|main|contrib|non-free) )*')" ]; then 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." echo "Adding missing sources to package manager, please wait."

View File

@ -11,6 +11,10 @@ if [ -f "/etc/gentoo-release" ]; then
echo "Nothing to unprepare." >$PackageManagerOutputDevice echo "Nothing to unprepare." >$PackageManagerOutputDevice
} }
check_package_manager() {
echo "Nothing to check." >$PackageManagerOutputDevice
}
prep_package_manager() { prep_package_manager() {
echo "Nothing to prepare." >$PackageManagerOutputDevice echo "Nothing to prepare." >$PackageManagerOutputDevice
} }

View File

@ -19,6 +19,10 @@ if [ -f "/etc/arch-release" ]; then
echo "Nothing to unprepare." >$PackageManagerOutputDevice 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() { prep_package_manager() {
echo "Nothing to prepare." >$PackageManagerOutputDevice echo "Nothing to prepare." >$PackageManagerOutputDevice
} }

View File

@ -11,6 +11,10 @@ if [ -f "/etc/redhat-release" ]; then
echo "Nothing to unprepare." >$PackageManagerOutputDevice echo "Nothing to unprepare." >$PackageManagerOutputDevice
} }
check_package_manager () {
echo "Nothing to check." >$PackageManagerOutputDevice
}
prep_package_manager() { prep_package_manager() {
echo "Nothing to prepare." >$PackageManagerOutputDevice echo "Nothing to prepare." >$PackageManagerOutputDevice
} }

View File

@ -11,6 +11,10 @@ if [ -f "/etc/SuSE-release" ]; then
echo "Nothing to unprepare." >$PackageManagerOutputDevice echo "Nothing to unprepare." >$PackageManagerOutputDevice
} }
check_package_manager() {
echo "Nothing to check." >$PackageManagerOutputDevice
}
prep_package_manager() { prep_package_manager() {
echo "Nothing to prepare." >$PackageManagerOutputDevice echo "Nothing to prepare." >$PackageManagerOutputDevice
} }