Shortened some statements to follow style guides.
This commit is contained in:
parent
792c362d26
commit
f16917d04f
181
fluxion
181
fluxion
|
@ -77,8 +77,12 @@ source lib/HashUtils.sh
|
||||||
# ============================================================ #
|
# ============================================================ #
|
||||||
# =================== < Parse Parameters > =================== #
|
# =================== < Parse Parameters > =================== #
|
||||||
# ============================================================ #
|
# ============================================================ #
|
||||||
if ! FLUXIONCLIArguments=$(getopt --options="vdkrnmtl:a:" --longoptions="debug,version,killer,reloader,airmon-ng,multiplexer,target,test,language:,attack:" --name="FLUXION V$FLUXIONVersion.$FLUXIONRevision" -- "$@")
|
if ! FLUXIONCLIArguments=$(
|
||||||
then echo -e "${CRed}Aborted$CClr, parameter error detected..."; exit 5
|
getopt --options="vdkrnmtl:a:" \
|
||||||
|
--longoptions="debug,version,killer,reloader,airmon-ng,multiplexer,target,test,language:,attack:" \
|
||||||
|
--name="FLUXION V$FLUXIONVersion.$FLUXIONRevision" -- "$@"
|
||||||
|
); then
|
||||||
|
echo -e "${CRed}Aborted$CClr, parameter error detected..."; exit 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
declare -r FLUXIONCLIArguments=$FLUXIONCLIArguments
|
declare -r FLUXIONCLIArguments=$FLUXIONCLIArguments
|
||||||
|
@ -190,20 +194,26 @@ source "$FLUXIONPath/language/en.sh"
|
||||||
function fluxion_startup() {
|
function fluxion_startup() {
|
||||||
if [ "$FLUXIONDebug" ]; then return 1; fi
|
if [ "$FLUXIONDebug" ]; then return 1; fi
|
||||||
|
|
||||||
FLUXIONBanner=()
|
local banner=()
|
||||||
|
|
||||||
format_center_literals " ⌠▓▒▓▒ ⌠▓╗ ⌠█┐ ┌█ ┌▓\ /▓┐ ⌠▓╖ ⌠◙▒▓▒◙ ⌠█\ ☒┐"
|
format_center_literals \
|
||||||
FLUXIONBanner+=("$FormatCenterLiterals")
|
" ⌠▓▒▓▒ ⌠▓╗ ⌠█┐ ┌█ ┌▓\ /▓┐ ⌠▓╖ ⌠◙▒▓▒◙ ⌠█\ ☒┐"
|
||||||
format_center_literals " ║▒_ │▒║ │▒║ ║▒ \▒\/▒/ │☢╫ │▒┌╤┐▒ ║▓▒\ ▓║"
|
banner+=("$FormatCenterLiterals")
|
||||||
FLUXIONBanner+=("$FormatCenterLiterals")
|
format_center_literals \
|
||||||
format_center_literals " ≡◙◙ ║◙║ ║◙║ ║◙ ◙◙ ║¤▒ ║▓║☯║▓ ♜◙\✪\◙♜"
|
" ║▒_ │▒║ │▒║ ║▒ \▒\/▒/ │☢╫ │▒┌╤┐▒ ║▓▒\ ▓║"
|
||||||
FLUXIONBanner+=("$FormatCenterLiterals")
|
banner+=("$FormatCenterLiterals")
|
||||||
format_center_literals " ║▒ │▒║__ │▒└_┘▒ /▒/\▒\ │☢╫ │▒└╧┘▒ ║█ \▒█║"
|
format_center_literals \
|
||||||
FLUXIONBanner+=("$FormatCenterLiterals")
|
" ≡◙◙ ║◙║ ║◙║ ║◙ ◙◙ ║¤▒ ║▓║☯║▓ ♜◙\✪\◙♜"
|
||||||
format_center_literals " ⌡▓ ⌡◘▒▓▒ ⌡◘▒▓▒◘ └▓/ \▓┘ ⌡▓╝ ⌡◙▒▓▒◙ ⌡▓ \▓┘"
|
banner+=("$FormatCenterLiterals")
|
||||||
FLUXIONBanner+=("$FormatCenterLiterals")
|
format_center_literals \
|
||||||
format_center_literals "¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯"
|
" ║▒ │▒║__ │▒└_┘▒ /▒/\▒\ │☢╫ │▒└╧┘▒ ║█ \▒█║"
|
||||||
FLUXIONBanner+=("$FormatCenterLiterals")
|
banner+=("$FormatCenterLiterals")
|
||||||
|
format_center_literals \
|
||||||
|
" ⌡▓ ⌡◘▒▓▒ ⌡◘▒▓▒◘ └▓/ \▓┘ ⌡▓╝ ⌡◙▒▓▒◙ ⌡▓ \▓┘"
|
||||||
|
banner+=("$FormatCenterLiterals")
|
||||||
|
format_center_literals \
|
||||||
|
"¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯"
|
||||||
|
banner+=("$FormatCenterLiterals")
|
||||||
|
|
||||||
clear
|
clear
|
||||||
|
|
||||||
|
@ -212,32 +222,49 @@ function fluxion_startup() {
|
||||||
else echo -e "$CRed"
|
else echo -e "$CRed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for line in "${FLUXIONBanner[@]}"
|
for line in "${banner[@]}"
|
||||||
do echo "$line"; sleep 0.05
|
do echo "$line"; sleep 0.05
|
||||||
done
|
done
|
||||||
|
|
||||||
echo # Do not remove.
|
echo # Do not remove.
|
||||||
|
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
format_center_literals "${CGrn}Site: ${CRed}https://github.com/FluxionNetwork/fluxion$CClr"
|
local -r fluxionRepository="https://github.com/FluxionNetwork/fluxion"
|
||||||
|
format_center_literals "${CGrn}Site: ${CRed}$fluxionRepository$CClr"
|
||||||
echo -e "$FormatCenterLiterals"
|
echo -e "$FormatCenterLiterals"
|
||||||
|
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
format_center_literals "${CSRed}FLUXION $FLUXIONVersion$CClr (rev. $CSBlu$FLUXIONRevision$CClr)$CYel by$CWht ghost"
|
local -r versionInfo="${CSRed}FLUXION $FLUXIONVersion$CClr"
|
||||||
|
local -r revisionInfo="(rev. $CSBlu$FLUXIONRevision$CClr)"
|
||||||
|
local -r credits="${CYel}by$CWht FluxionNetwork"
|
||||||
|
format_center_literals "$versionInfo $revisionInfo $credits"
|
||||||
echo -e "$FormatCenterLiterals"
|
echo -e "$FormatCenterLiterals"
|
||||||
|
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
if installer_utils_check_update "https://raw.githubusercontent.com/FluxionNetwork/fluxion/master/fluxion.sh" "FLUXIONVersion=" "FLUXIONRevision=" $FLUXIONVersion $FLUXIONRevision
|
local -r fluxionDomain="raw.githubusercontent.com"
|
||||||
then installer_utils_run_update "https://github.com/FluxionNetwork/fluxion/archive/master.zip" "FLUXION-V$FLUXIONVersion.$FLUXIONRevision" "$(dirname "$FLUXIONPath")"
|
local -r fluxionPath="FluxionNetwork/fluxion/master/fluxion.sh"
|
||||||
|
local -r updateDomain="github.com"
|
||||||
|
local -r updatePath="FluxionNetwork/fluxion/archive/master.zip"
|
||||||
|
if installer_utils_check_update "https://$fluxionDomain/$fluxionPath" \
|
||||||
|
"FLUXIONVersion=" "FLUXIONRevision=" \
|
||||||
|
$FLUXIONVersion $FLUXIONRevision; then
|
||||||
|
installer_utils_run_update "https://$updateDomain/$updatePath" \
|
||||||
|
"FLUXION-V$FLUXIONVersion.$FLUXIONRevision" \
|
||||||
|
"$(dirname "$FLUXIONPath")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo # Do not remove.
|
echo # Do not remove.
|
||||||
|
|
||||||
FLUXIONCLIToolsRequired=("aircrack-ng" "python2:python2.7|python2" "bc" "awk:awk|gawk|mawk" "curl" "dhcpd:isc-dhcp-server|dhcp" "7zr:p7zip" "hostapd" "lighttpd" "iwconfig:wireless-tools" "macchanger" "mdk3" "nmap" "openssl" "php-cgi" "pyrit" "xterm" "rfkill" "unzip" "route:net-tools" "fuser:psmisc" "killall:psmisc")
|
local requiredCLITools=(
|
||||||
FLUXIONCLIToolsMissing=()
|
"aircrack-ng" "python2:python2.7|python2" "bc" "awk:awk|gawk|mawk"
|
||||||
|
"curl" "dhcpd:isc-dhcp-server|dhcp" "7zr:p7zip" "hostapd" "lighttpd"
|
||||||
|
"iwconfig:wireless-tools" "macchanger" "mdk3" "nmap" "openssl"
|
||||||
|
"php-cgi" "pyrit" "xterm" "rfkill" "unzip" "route:net-tools"
|
||||||
|
"fuser:psmisc" "killall:psmisc"
|
||||||
|
)
|
||||||
|
|
||||||
while ! installer_utils_check_dependencies FLUXIONCLIToolsRequired[@]
|
while ! installer_utils_check_dependencies requiredCLITools[@]; do
|
||||||
do installer_utils_run_dependencies InstallerUtilsCheckDependencies[@]
|
installer_utils_run_dependencies InstallerUtilsCheckDependencies[@]
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "\n\n" # This echo is for spacing
|
echo -e "\n\n" # This echo is for spacing
|
||||||
|
@ -253,20 +280,22 @@ function fluxion_shutdown() {
|
||||||
|
|
||||||
echo -e "$CWht[$CRed-$CWht]$CRed $FLUXIONCleanupAndClosingNotice$CClr"
|
echo -e "$CWht[$CRed-$CWht]$CRed $FLUXIONCleanupAndClosingNotice$CClr"
|
||||||
|
|
||||||
# List currently running processes which we might have to kill before exiting.
|
# Get running processes we might have to kill before exiting.
|
||||||
local processes
|
local processes
|
||||||
readarray processes < <(ps -A)
|
readarray processes < <(ps -A)
|
||||||
|
|
||||||
# Currently, fluxion is only responsible for killing airodump-ng, since
|
# Currently, fluxion is only responsible for killing airodump-ng, since
|
||||||
# fluxion explicitly uses it to scan for candidate target access points.
|
# fluxion explicitly uses it to scan for candidate target access points.
|
||||||
# NOTICE: Processes started by subscripts, such as an attack script,
|
# NOTICE: Processes started by subscripts, such as an attack script,
|
||||||
# MUST BE TERMINATED BY THAT SAME SCRIPT in the subscript's abort handler.
|
# MUST BE TERMINATED BY THAT SCRIPT in the subscript's abort handler.
|
||||||
local -r targets=("airodump-ng")
|
local -r targets=("airodump-ng")
|
||||||
|
|
||||||
local targetID # Program identifier/title
|
local targetID # Program identifier/title
|
||||||
for targetID in "${targets[@]}"; do
|
for targetID in "${targets[@]}"; do
|
||||||
# Get PIDs of all programs matching targetPID
|
# Get PIDs of all programs matching targetPID
|
||||||
local targetPID=$(echo "${processes[@]}" | awk '$4~/'"$targetID"'/{print $1}')
|
local targetPID=$(
|
||||||
|
echo "${processes[@]}" | awk '$4~/'"$targetID"'/{print $1}'
|
||||||
|
)
|
||||||
if [ ! "$targetPID" ]; then continue; fi
|
if [ ! "$targetPID" ]; then continue; fi
|
||||||
echo -e "$CWht[$CRed-$CWht] `io_dynamic_output $FLUXIONKillingProcessNotice`"
|
echo -e "$CWht[$CRed-$CWht] `io_dynamic_output $FLUXIONKillingProcessNotice`"
|
||||||
kill -s SIGKILL $targetPID &> $FLUXIONOutputDevice
|
kill -s SIGKILL $targetPID &> $FLUXIONOutputDevice
|
||||||
|
@ -274,7 +303,9 @@ function fluxion_shutdown() {
|
||||||
|
|
||||||
# Assure changes are reverted if installer was activated.
|
# Assure changes are reverted if installer was activated.
|
||||||
if [ "$PackageManagerCLT" ]; then
|
if [ "$PackageManagerCLT" ]; then
|
||||||
echo -e "$CWht[$CRed-$CWht] "$(io_dynamic_output "$FLUXIONRestoringPackageManagerNotice")"$CClr"
|
echo -e "$CWht[$CRed-$CWht] "$(
|
||||||
|
io_dynamic_output "$FLUXIONRestoringPackageManagerNotice"
|
||||||
|
)"$CClr"
|
||||||
unprep_package_manager
|
unprep_package_manager
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -459,7 +490,7 @@ function fluxion_undo() {
|
||||||
local __fluxion_undo__instruction=${__fluxion_undo__history[__fluxion_undo__i-1]}
|
local __fluxion_undo__instruction=${__fluxion_undo__history[__fluxion_undo__i-1]}
|
||||||
local __fluxion_undo__command=${__fluxion_undo__instruction%%_*}
|
local __fluxion_undo__command=${__fluxion_undo__instruction%%_*}
|
||||||
local __fluxion_undo__identifier=${__fluxion_undo__instruction#*_}
|
local __fluxion_undo__identifier=${__fluxion_undo__instruction#*_}
|
||||||
|
|
||||||
if ! eval ${__fluxion_undo__namespace}_${FLUXIONUndoable["$__fluxion_undo__command"]}_$__fluxion_undo__identifier; then
|
if ! eval ${__fluxion_undo__namespace}_${FLUXIONUndoable["$__fluxion_undo__command"]}_$__fluxion_undo__identifier; then
|
||||||
eval FXDLog_$__fluxion_undo__namespace=\("${__fluxion_undo__history[@]::$__fluxion_undo__i}"\)
|
eval FXDLog_$__fluxion_undo__namespace=\("${__fluxion_undo__history[@]::$__fluxion_undo__i}"\)
|
||||||
return 0
|
return 0
|
||||||
|
@ -568,9 +599,15 @@ function fluxion_set_language() {
|
||||||
readarray -t languageCodes < <(ls -1 language | sed -E 's/\.sh//')
|
readarray -t languageCodes < <(ls -1 language | sed -E 's/\.sh//')
|
||||||
|
|
||||||
local languages
|
local languages
|
||||||
readarray -t languages < <(head -n 3 language/*.sh | grep -E "^# native: " | sed -E 's/# \w+: //')
|
readarray -t languages < <(
|
||||||
|
head -n 3 language/*.sh |
|
||||||
|
grep -E "^# native: " |
|
||||||
|
sed -E 's/# \w+: //'
|
||||||
|
)
|
||||||
|
|
||||||
io_query_format_fields "$FLUXIONVLine Select your language" "\t$CRed[$CSYel%d$CClr$CRed]$CClr %s / %s\n" languageCodes[@] languages[@]
|
io_query_format_fields "$FLUXIONVLine Select your language" \
|
||||||
|
"\t$CRed[$CSYel%d$CClr$CRed]$CClr %s / %s\n" \
|
||||||
|
languageCodes[@] languages[@]
|
||||||
|
|
||||||
FLUXIONLanguage=${IOQueryFormatFields[0]}
|
FLUXIONLanguage=${IOQueryFormatFields[0]}
|
||||||
|
|
||||||
|
@ -687,7 +724,9 @@ function fluxion_allocate_interface() { # Reserve interfaces
|
||||||
rmmod -f $driver &> $FLUXIONOutputDevice
|
rmmod -f $driver &> $FLUXIONOutputDevice
|
||||||
|
|
||||||
# Wait while interface becomes unavailable.
|
# Wait while interface becomes unavailable.
|
||||||
echo -e "$FLUXIONVLine `io_dynamic_output $FLUXIONUnloadingWIDriverNotice`"
|
echo -e "$FLUXIONVLine "$(
|
||||||
|
io_dynamic_output $FLUXIONUnloadingWIDriverNotice
|
||||||
|
)
|
||||||
while interface_physical "$identifier"
|
while interface_physical "$identifier"
|
||||||
do sleep 1
|
do sleep 1
|
||||||
done
|
done
|
||||||
|
@ -713,7 +752,9 @@ function fluxion_allocate_interface() { # Reserve interfaces
|
||||||
modprobe "$driver" &> $FLUXIONOutputDevice
|
modprobe "$driver" &> $FLUXIONOutputDevice
|
||||||
|
|
||||||
# Wait while interface becomes available.
|
# Wait while interface becomes available.
|
||||||
echo -e "$FLUXIONVLine `io_dynamic_output $FLUXIONLoadingWIDriverNotice`"
|
echo -e "$FLUXIONVLine "$(
|
||||||
|
io_dynamic_output $FLUXIONLoadingWIDriverNotice
|
||||||
|
)
|
||||||
while ! interface_physical "$identifier"
|
while ! interface_physical "$identifier"
|
||||||
do sleep 1
|
do sleep 1
|
||||||
done
|
done
|
||||||
|
@ -844,7 +885,9 @@ function fluxion_get_interface() {
|
||||||
"$CClr" \
|
"$CClr" \
|
||||||
)
|
)
|
||||||
|
|
||||||
format_apply_autosize "$CRed[$CSYel%1d$CClr$CRed]%b %-8b %3s$CClr %-*.*s\n"
|
format_apply_autosize \
|
||||||
|
"$CRed[$CSYel%1d$CClr$CRed]%b %-8b %3s$CClr %-*.*s\n"
|
||||||
|
|
||||||
io_query_format_fields \
|
io_query_format_fields \
|
||||||
"$FLUXIONVLine $FLUXIONInterfaceQuery" "$FormatApplyAutosize" \
|
"$FLUXIONVLine $FLUXIONInterfaceQuery" "$FormatApplyAutosize" \
|
||||||
interfacesAvailableColor[@] interfacesAvailable[@] \
|
interfacesAvailableColor[@] interfacesAvailable[@] \
|
||||||
|
@ -888,7 +931,9 @@ function fluxion_target_get_candidates() {
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
# Begin scanner and output all results to "dump-01.csv."
|
# Begin scanner and output all results to "dump-01.csv."
|
||||||
if ! xterm -title "$FLUXIONScannerHeader" $TOPLEFTBIG -bg "#000000" -fg "#FFFFFF" -e "airodump-ng -Mat WPA "${2:+"--channel $2"}" "${3:+"--band $3"}" -w \"$FLUXIONWorkspacePath/dump\" $1" 2> $FLUXIONOutputDevice; then
|
if ! xterm -title "$FLUXIONScannerHeader" $TOPLEFTBIG \
|
||||||
|
-bg "#000000" -fg "#FFFFFF" -e \
|
||||||
|
"airodump-ng -Mat WPA "${2:+"--channel $2"}" "${3:+"--band $3"}" -w \"$FLUXIONWorkspacePath/dump\" $1" 2> $FLUXIONOutputDevice; then
|
||||||
echo -e "$FLUXIONVLine$CRed $FLUXIONGeneralXTermFailureError"
|
echo -e "$FLUXIONVLine$CRed $FLUXIONGeneralXTermFailureError"
|
||||||
sleep 5
|
sleep 5
|
||||||
return 2
|
return 2
|
||||||
|
@ -906,10 +951,23 @@ function fluxion_target_get_candidates() {
|
||||||
echo -e "$FLUXIONVLine $FLUXIONPreparingScannerResultsNotice"
|
echo -e "$FLUXIONVLine $FLUXIONPreparingScannerResultsNotice"
|
||||||
# WARNING: The code below may break with different version of airmon-ng.
|
# WARNING: The code below may break with different version of airmon-ng.
|
||||||
# The times matching operator "{n}" isn't supported by mawk (alias awk).
|
# The times matching operator "{n}" isn't supported by mawk (alias awk).
|
||||||
# readarray FLUXIONTargetCandidates < <(gawk -F, 'NF==15 && $1~/([A-F0-9]{2}:){5}[A-F0-9]{2}/ {print $0}' $FLUXIONWorkspacePath/dump-01.csv)
|
# readarray FLUXIONTargetCandidates < <(
|
||||||
# readarray FLUXIONTargetCandidatesClients < <(gawk -F, 'NF==7 && $1~/([A-F0-9]{2}:){5}[A-F0-9]{2}/ {print $0}' $FLUXIONWorkspacePath/dump-01.csv)
|
# gawk -F, 'NF==15 && $1~/([A-F0-9]{2}:){5}[A-F0-9]{2}/ {print $0}'
|
||||||
readarray FluxionTargetCandidates < <(awk -F, 'NF==15 && length($1)==17 && $1~/([A-F0-9][A-F0-9]:)+[A-F0-9][A-F0-9]/ {print $0}' "$FLUXIONWorkspacePath/dump-01.csv")
|
# $FLUXIONWorkspacePath/dump-01.csv
|
||||||
readarray FluxionTargetCandidatesClients < <(awk -F, 'NF==7 && length($1)==17 && $1~/([A-F0-9][A-F0-9]:)+[A-F0-9][A-F0-9]/ {print $0}' "$FLUXIONWorkspacePath/dump-01.csv")
|
# )
|
||||||
|
# readarray FLUXIONTargetCandidatesClients < <(
|
||||||
|
# gawk -F, 'NF==7 && $1~/([A-F0-9]{2}:){5}[A-F0-9]{2}/ {print $0}'
|
||||||
|
# $FLUXIONWorkspacePath/dump-01.csv
|
||||||
|
# )
|
||||||
|
local -r matchMAC="([A-F0-9][A-F0-9]:)+[A-F0-9][A-F0-9]"
|
||||||
|
readarray FluxionTargetCandidates < <(
|
||||||
|
awk -F, "NF==15 && length(\$1)==17 && \$1~/$matchMAC/ {print \$0}"
|
||||||
|
"$FLUXIONWorkspacePath/dump-01.csv"
|
||||||
|
)
|
||||||
|
readarray FluxionTargetCandidatesClients < <(
|
||||||
|
awk -F, "NF==7 && length(\$1)==17 && \$1~/$matchMAC/ {print \$0}"
|
||||||
|
"$FLUXIONWorkspacePath/dump-01.csv"
|
||||||
|
)
|
||||||
|
|
||||||
# Cleanup the workspace to prevent potential bugs/conflicts.
|
# Cleanup the workspace to prevent potential bugs/conflicts.
|
||||||
sandbox_remove_workfile "$FLUXIONWorkspacePath/dump*"
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/dump*"
|
||||||
|
@ -1005,7 +1063,7 @@ function fluxion_get_target() {
|
||||||
)
|
)
|
||||||
|
|
||||||
# Parse any non-ascii characters by letting bash handle them.
|
# Parse any non-ascii characters by letting bash handle them.
|
||||||
# Just escape all single quotes in ESSID and let bash's $'...' handle it.
|
# Escape all single quotes in ESSID and let bash's $'...' handle it.
|
||||||
local sanitizedESSID=$(
|
local sanitizedESSID=$(
|
||||||
echo "${candidateAPInfo//\'/\\\'}" | cut -d , -f 14
|
echo "${candidateAPInfo//\'/\\\'}" | cut -d , -f 14
|
||||||
)
|
)
|
||||||
|
@ -1020,9 +1078,12 @@ function fluxion_get_target() {
|
||||||
elif [ $power -gt $FLUXIONNoiseCeiling ]; then
|
elif [ $power -gt $FLUXIONNoiseCeiling ]; then
|
||||||
candidatesQuality[i]=100
|
candidatesQuality[i]=100
|
||||||
else
|
else
|
||||||
# Bash doesn't support floating point division, so I gotta work around it...
|
# Bash doesn't support floating point division, work around it...
|
||||||
# The function is Q = ((P - F) / (C - F)); Q - quality, P - power, F - floor, C - Ceiling.
|
# Q = ((P - F) / (C - F)); Q-quality, P-power, F-floor, C-Ceiling.
|
||||||
candidatesQuality[i]=$(((${candidatesPower[i]} * 10 - $FLUXIONNoiseFloor * 10) / (($FLUXIONNoiseCeiling - $FLUXIONNoiseFloor) / 10)))
|
candidatesQuality[i]=$(
|
||||||
|
((${candidatesPower[i]} * 10 - $FLUXIONNoiseFloor * 10) / \
|
||||||
|
(($FLUXIONNoiseCeiling - $FLUXIONNoiseFloor) / 10))
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -1030,10 +1091,14 @@ function fluxion_get_target() {
|
||||||
local -r headerTitle="$FormatCenterLiterals\n\n"
|
local -r headerTitle="$FormatCenterLiterals\n\n"
|
||||||
|
|
||||||
format_apply_autosize "$CRed[$CSYel ** $CClr$CRed]$CClr %-*.*s %4s %3s %3s %2s %-8.8s %18s\n"
|
format_apply_autosize "$CRed[$CSYel ** $CClr$CRed]$CClr %-*.*s %4s %3s %3s %2s %-8.8s %18s\n"
|
||||||
local -r headerFields=$(printf "$FormatApplyAutosize" "ESSID" "QLTY" "PWR" "STA" "CH" "SECURITY" "BSSID")
|
local -r headerFields=$(
|
||||||
|
printf "$FormatApplyAutosize" \
|
||||||
|
"ESSID" "QLTY" "PWR" "STA" "CH" "SECURITY" "BSSID"
|
||||||
|
)
|
||||||
|
|
||||||
format_apply_autosize "$CRed[$CSYel%03d$CClr$CRed]%b %-*.*s %3s%% %3s %3d %2s %-8.8s %18s\n"
|
format_apply_autosize "$CRed[$CSYel%03d$CClr$CRed]%b %-*.*s %3s%% %3s %3d %2s %-8.8s %18s\n"
|
||||||
io_query_format_fields "$headerTitle$headerFields" "$FormatApplyAutosize" \
|
io_query_format_fields "$headerTitle$headerFields" \
|
||||||
|
"$FormatApplyAutosize" \
|
||||||
candidatesColor[@] \
|
candidatesColor[@] \
|
||||||
candidatesESSID[@] \
|
candidatesESSID[@] \
|
||||||
candidatesQuality[@] \
|
candidatesQuality[@] \
|
||||||
|
@ -1063,21 +1128,23 @@ function fluxion_get_target() {
|
||||||
# network "; rm -rf / ;". If the string isn't sanitized accidentally
|
# network "; rm -rf / ;". If the string isn't sanitized accidentally
|
||||||
# shit'll hit the fan and we'll have an extremly distressed user.
|
# shit'll hit the fan and we'll have an extremly distressed user.
|
||||||
# Replacing ' ', '/', '.', '~', '\' with '_'
|
# Replacing ' ', '/', '.', '~', '\' with '_'
|
||||||
FLUXIONGetTargetSSIDClean=$(
|
FluxionTargetSSIDClean=$(
|
||||||
echo "$FLUXIONGetTargetSSID" | sed -r 's/( |\/|\.|\~|\\)+/_/g'
|
echo "$FLUXIONGetTargetSSID" | sed -r 's/( |\/|\.|\~|\\)+/_/g'
|
||||||
)
|
)
|
||||||
|
|
||||||
# We'll change a single hex digit from the target AP's MAC address.
|
# We'll change a single hex digit from the target AP's MAC address.
|
||||||
# This new MAC address will be used as the rogue AP's MAC address.
|
# This new MAC address will be used as the rogue AP's MAC address.
|
||||||
local -r rogueMACHex=$(printf %02X $((0x${APTargetMAC:13:1} + 1)))
|
local -r rogueMACHex=$(printf %02X $((0x${FluxionTargetMAC:13:1} + 1)))
|
||||||
FLUXIONGetTargetRogueMAC="${FLUXIONGetTargetMAC::13}${rogueMACHex:1:1}${FLUXIONGetTargetRogueMAC:14:4}"
|
FluxionTargetRogueMAC="${FluxionTargetMAC::13}${rogueMACHex:1:1}${FluxionTargetMAC:14:4}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function fluxion_target_show() {
|
function fluxion_target_show() {
|
||||||
format_apply_autosize "%*s$CBlu%7s$CClr: %-32s%*s\n"
|
format_apply_autosize "%*s$CBlu%7s$CClr: %-32s%*s\n"
|
||||||
|
|
||||||
local colorlessFormat="$FormatApplyAutosize"
|
local colorlessFormat="$FormatApplyAutosize"
|
||||||
local colorfullFormat=$(echo "$colorlessFormat" | sed -r 's/%-32s/%-32b/g')
|
local colorfullFormat=$(
|
||||||
|
echo "$colorlessFormat" | sed -r 's/%-32s/%-32b/g'
|
||||||
|
)
|
||||||
|
|
||||||
printf "$colorlessFormat" "" "ESSID" "\"${FluxionTargetSSID:-[N/A]}\" / ${FluxionTargetEncryption:-[N/A]}" ""
|
printf "$colorlessFormat" "" "ESSID" "\"${FluxionTargetSSID:-[N/A]}\" / ${FluxionTargetEncryption:-[N/A]}" ""
|
||||||
printf "$colorlessFormat" "" "Channel" " ${FluxionTargetChannel:-[N/A]}" ""
|
printf "$colorlessFormat" "" "Channel" " ${FluxionTargetChannel:-[N/A]}" ""
|
||||||
|
@ -1269,13 +1336,19 @@ function fluxion_set_attack() {
|
||||||
readarray -t attacks < <(ls -1 attacks)
|
readarray -t attacks < <(ls -1 attacks)
|
||||||
|
|
||||||
local descriptions
|
local descriptions
|
||||||
readarray -t descriptions < <(head -n 3 attacks/*/language/$FLUXIONLanguage.sh | grep -E "^# description: " | sed -E 's/# \w+: //')
|
readarray -t descriptions < <(
|
||||||
|
head -n 3 attacks/*/language/$FLUXIONLanguage.sh | \
|
||||||
|
grep -E "^# description: " | sed -E 's/# \w+: //'
|
||||||
|
)
|
||||||
|
|
||||||
local identifiers=()
|
local identifiers=()
|
||||||
|
|
||||||
local attack
|
local attack
|
||||||
for attack in "${attacks[@]}"; do
|
for attack in "${attacks[@]}"; do
|
||||||
local identifier="$(head -n 3 "attacks/$attack/language/$FLUXIONLanguage.sh" | grep -E "^# identifier: " | sed -E 's/# \w+: //')"
|
local identifier=$(
|
||||||
|
head -n 3 "attacks/$attack/language/$FLUXIONLanguage.sh" | \
|
||||||
|
grep -E "^# identifier: " | sed -E 's/# \w+: //'
|
||||||
|
)
|
||||||
if [ "$identifier" ]; then identifiers+=("$identifier")
|
if [ "$identifier" ]; then identifiers+=("$identifier")
|
||||||
else identifiers+=("$attack")
|
else identifiers+=("$attack")
|
||||||
fi
|
fi
|
||||||
|
@ -1285,7 +1358,9 @@ function fluxion_set_attack() {
|
||||||
identifiers+=("$FLUXIONGeneralBackOption")
|
identifiers+=("$FLUXIONGeneralBackOption")
|
||||||
descriptions+=("")
|
descriptions+=("")
|
||||||
|
|
||||||
io_query_format_fields "" "\t$CRed[$CSYel%d$CClr$CRed]$CClr%0.0s $CCyn%b$CClr %b\n" attacks[@] identifiers[@] descriptions[@]
|
io_query_format_fields "" \
|
||||||
|
"\t$CRed[$CSYel%d$CClr$CRed]$CClr%0.0s $CCyn%b$CClr %b\n" \
|
||||||
|
attacks[@] identifiers[@] descriptions[@]
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
@ -1422,7 +1497,7 @@ function fluxion_main() {
|
||||||
"prep_attack" \
|
"prep_attack" \
|
||||||
"run_attack" \
|
"run_attack" \
|
||||||
)
|
)
|
||||||
|
|
||||||
while true # Fluxion's runtime-loop.
|
while true # Fluxion's runtime-loop.
|
||||||
do fluxion_do_sequence fluxion sequence[@]
|
do fluxion_do_sequence fluxion sequence[@]
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue