Change preference file
This commit is contained in:
parent
d1a5d666f4
commit
ec094539b4
117
fluxion
117
fluxion
|
@ -8,21 +8,24 @@
|
||||||
# the script, however, will be loaded correctly.
|
# the script, however, will be loaded correctly.
|
||||||
|
|
||||||
# Path to directory containing the FLUXION executable script.
|
# Path to directory containing the FLUXION executable script.
|
||||||
declare -r FLUXIONPath=$(cd "$(dirname "$0")"; pwd -P)
|
readonly FLUXIONPath=$(cd "$(dirname "$0")"; pwd -P)
|
||||||
|
|
||||||
# Path to the temp. directory available to FLUXION & subscripts.
|
# Path to the temp. directory available to FLUXION & subscripts.
|
||||||
declare -r FLUXIONWorkspacePath="/tmp/fluxspace"
|
readonly FLUXIONWorkspacePath="/tmp/fluxspace"
|
||||||
|
|
||||||
# Path to FLUXION's preferences file, to be loaded afterward.
|
# Path to FLUXION's preferences file, to be loaded afterward.
|
||||||
declare -r FLUXIONPreferencesFile="$FLUXIONPath/preferences.conf"
|
readonly FLUXIONLanguagePreferencesFile="$FLUXIONPath/preferences/LanguagePreference.conf"
|
||||||
|
|
||||||
# Constants denoting the reference noise floor & ceiling levels.
|
# Constants denoting the reference noise floor & ceiling levels.
|
||||||
# These are used by the the wireless network scanner visualizer.
|
# These are used by the the wireless network scanner visualizer.
|
||||||
declare -r FLUXIONNoiseFloor=-90
|
readonly FLUXIONNoiseFloor=-90
|
||||||
declare -r FLUXIONNoiseCeiling=-60
|
readonly FLUXIONNoiseCeiling=-60
|
||||||
|
|
||||||
declare -r FLUXIONVersion=4
|
readonly FLUXIONVersion=4
|
||||||
declare -r FLUXIONRevision=1
|
readonly FLUXIONRevision=2
|
||||||
|
|
||||||
|
# Declare window ration bigger = smaller windows
|
||||||
|
FLUXIONWindowRatio=4
|
||||||
|
|
||||||
|
|
||||||
# ============================================================ #
|
# ============================================================ #
|
||||||
|
@ -79,14 +82,14 @@ source lib/HashUtils.sh
|
||||||
# ============================================================ #
|
# ============================================================ #
|
||||||
if ! FLUXIONCLIArguments=$(
|
if ! FLUXIONCLIArguments=$(
|
||||||
getopt --options="vdkrnmtb:e:c:l:a:" \
|
getopt --options="vdkrnmtb:e:c:l:a:" \
|
||||||
--longoptions="debug,version,killer,reloader,airmon-ng,multiplexer,target,test,bssid:,essid:,channel:,language:,attack:" \
|
--longoptions="debug,version,killer,reloader,ratio,airmon-ng,multiplexer,target,test,bssid:,essid:,channel:,language:,attack:" \
|
||||||
--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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AttackCLIArguments=${FLUXIONCLIArguments##*--}
|
AttackCLIArguments=${FLUXIONCLIArguments##*--}
|
||||||
declare -r FLUXIONCLIArguments=${FLUXIONCLIArguments%%--*}
|
readonly FLUXIONCLIArguments=${FLUXIONCLIArguments%%--*}
|
||||||
|
|
||||||
|
|
||||||
# ============================================================ #
|
# ============================================================ #
|
||||||
|
@ -96,17 +99,18 @@ declare -r FLUXIONCLIArguments=${FLUXIONCLIArguments%%--*}
|
||||||
# ============= < Argument Loaded Configurables > ============ #
|
# ============= < Argument Loaded Configurables > ============ #
|
||||||
eval set -- "$FLUXIONCLIArguments" # Set environment parameters.
|
eval set -- "$FLUXIONCLIArguments" # Set environment parameters.
|
||||||
|
|
||||||
[ "$1" != "" ] && declare -r FLUXIONAuto=1 # Auto-mode if using CLI.
|
#[ "$1" != "" ] && readonly FLUXIONAuto=1 # Auto-mode if using CLI.
|
||||||
|
|
||||||
while [ "$1" != "" -a "$1" != "--" ]; do
|
while [ "$1" != "" -a "$1" != "--" ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-v|--version) echo "FLUXION V$FLUXIONVersion.$FLUXIONRevision"; exit;;
|
-v|--version) echo "FLUXION V$FLUXIONVersion.$FLUXIONRevision"; exit;;
|
||||||
-d|--debug) declare -r FLUXIONDebug=1;;
|
-d|--debug) readonly FLUXIONDebug=1;;
|
||||||
-k|--killer) declare -r FLUXIONWIKillProcesses=1;;
|
-k|--killer) readonly FLUXIONWIKillProcesses=1;;
|
||||||
-r|--reloader) declare -r FLUXIONWIReloadDriver=1;;
|
-r|--reloader) readonly FLUXIONWIReloadDriver=1;;
|
||||||
-n|--airmon-ng) declare -r FLUXIONAirmonNG=1;;
|
-n|--airmon-ng) readonly FLUXIONAirmonNG=1;;
|
||||||
-m|--multiplexer) declare -r FLUXIONTMux=1;;
|
-m|--multiplexer) readonly FLUXIONTMux=1;;
|
||||||
-b|--bssid) FluxionTargetMAC=$2; shift;;
|
-b|--bssid) FluxionTargetMAC=$2; shift;;
|
||||||
|
--ratio) FLUXIONWindowRatio=$2;shift;;
|
||||||
-e|--essid) FluxionTargetSSID=$2;
|
-e|--essid) FluxionTargetSSID=$2;
|
||||||
FluxionTargetSSIDClean=$(
|
FluxionTargetSSIDClean=$(
|
||||||
echo "$FluxionTargetSSID" | sed -r 's/( |\/|\.|\~|\\)+/_/g'
|
echo "$FluxionTargetSSID" | sed -r 's/( |\/|\.|\~|\\)+/_/g'
|
||||||
|
@ -126,67 +130,67 @@ shift # Remove "--" to prepare for attacks to read parameters.
|
||||||
# Load user-defined preferences if there's an executable script.
|
# Load user-defined preferences if there's an executable script.
|
||||||
# If no script exists, prepare one for the user to store config.
|
# If no script exists, prepare one for the user to store config.
|
||||||
# WARNING: Preferences file must assure no redeclared constants.
|
# WARNING: Preferences file must assure no redeclared constants.
|
||||||
if [ -x "$FLUXIONPreferencesFile" ]; then
|
if [ -x "$FLUXIONLanguagePreferencesFile" ]; then
|
||||||
source "$FLUXIONPreferencesFile"
|
source "$FLUXIONLanguagePreferencesFile"
|
||||||
else
|
else
|
||||||
echo '#!/bin/bash' > "$FLUXIONPreferencesFile"
|
echo '#!/bin/bash' > "$FLUXIONLanguagePreferencesFile"
|
||||||
chmod u+x "$FLUXIONPreferencesFile"
|
chmod u+x "$FLUXIONLanguagePreferencesFile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ================ < Configurable Constants > ================ #
|
# ================ < Configurable Constants > ================ #
|
||||||
if [ "$FLUXIONAuto" != "1" ]; then # If defined, assure 1.
|
if [ "$FLUXIONAuto" != "1" ]; then # If defined, assure 1.
|
||||||
declare -r FLUXIONAuto=${FLUXIONAuto:+1}
|
readonly FLUXIONAuto=${FLUXIONAuto:+1}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$FLUXIONDebug" != "1" ]; then # If defined, assure 1.
|
if [ "$FLUXIONDebug" != "1" ]; then # If defined, assure 1.
|
||||||
declare -r FLUXIONDebug=${FLUXIONDebug:+1}
|
readonly FLUXIONDebug=${FLUXIONDebug:+1}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$FLUXIONAirmonNG" != "1" ]; then # If defined, assure 1.
|
if [ "$FLUXIONAirmonNG" != "1" ]; then # If defined, assure 1.
|
||||||
declare -r FLUXIONAirmonNG=${FLUXIONAirmonNG:+1}
|
readonly FLUXIONAirmonNG=${FLUXIONAirmonNG:+1}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$FLUXIONWIKillProcesses" != "1" ]; then # If defined, assure 1.
|
if [ "$FLUXIONWIKillProcesses" != "1" ]; then # If defined, assure 1.
|
||||||
declare -r FLUXIONWIKillProcesses=${FLUXIONWIKillProcesses:+1}
|
readonly FLUXIONWIKillProcesses=${FLUXIONWIKillProcesses:+1}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$FLUXIONWIReloadDriver" != "1" ]; then # If defined, assure 1.
|
if [ "$FLUXIONWIReloadDriver" != "1" ]; then # If defined, assure 1.
|
||||||
declare -r FLUXIONWIReloadDriver=${FLUXIONWIReloadDriver:+1}
|
readonly FLUXIONWIReloadDriver=${FLUXIONWIReloadDriver:+1}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# FLUXIONDebug [Normal Mode "" / Developer Mode 1]
|
# FLUXIONDebug [Normal Mode "" / Developer Mode 1]
|
||||||
if [ $FLUXIONDebug ]; then
|
if [ $FLUXIONDebug ]; then
|
||||||
declare -r FLUXIONOutputDevice="/dev/stdout"
|
readonly FLUXIONOutputDevice="/dev/stdout"
|
||||||
declare -r FLUXIONHoldXterm="-hold"
|
readonly FLUXIONHoldXterm="-hold"
|
||||||
else
|
else
|
||||||
declare -r FLUXIONOutputDevice="/dev/null"
|
readonly FLUXIONOutputDevice="/dev/null"
|
||||||
declare -r FLUXIONHoldXterm=""
|
readonly FLUXIONHoldXterm=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ================ < Configurable Variables > ================ #
|
# ================ < Configurable Variables > ================ #
|
||||||
declare -r FLUXIONPromptDefault="$CRed[${CSBlu}fluxion$CSYel@$CSWht$HOSTNAME$CClr$CRed]-[$CSYel~$CClr$CRed]$CClr "
|
readonly FLUXIONPromptDefault="$CRed[${CSBlu}fluxion$CSYel@$CSWht$HOSTNAME$CClr$CRed]-[$CSYel~$CClr$CRed]$CClr "
|
||||||
FLUXIONPrompt=$FLUXIONPromptDefault
|
FLUXIONPrompt=$FLUXIONPromptDefault
|
||||||
|
|
||||||
declare -r FLUXIONVLineDefault="$CRed[$CSYel*$CClr$CRed]$CClr"
|
readonly FLUXIONVLineDefault="$CRed[$CSYel*$CClr$CRed]$CClr"
|
||||||
FLUXIONVLine=$FLUXIONVLineDefault
|
FLUXIONVLine=$FLUXIONVLineDefault
|
||||||
|
|
||||||
# ================== < Library Parameters > ================== #
|
# ================== < Library Parameters > ================== #
|
||||||
declare -r InterfaceUtilsOutputDevice="$FLUXIONOutputDevice"
|
readonly InterfaceUtilsOutputDevice="$FLUXIONOutputDevice"
|
||||||
|
|
||||||
declare -r SandboxWorkspacePath="$FLUXIONWorkspacePath"
|
readonly SandboxWorkspacePath="$FLUXIONWorkspacePath"
|
||||||
declare -r SandboxOutputDevice="$FLUXIONOutputDevice"
|
readonly SandboxOutputDevice="$FLUXIONOutputDevice"
|
||||||
|
|
||||||
declare -r InstallerUtilsWorkspacePath="$FLUXIONWorkspacePath"
|
readonly InstallerUtilsWorkspacePath="$FLUXIONWorkspacePath"
|
||||||
declare -r InstallerUtilsOutputDevice="$FLUXIONOutputDevice"
|
readonly InstallerUtilsOutputDevice="$FLUXIONOutputDevice"
|
||||||
declare -r InstallerUtilsNoticeMark="$FLUXIONVLine"
|
readonly InstallerUtilsNoticeMark="$FLUXIONVLine"
|
||||||
|
|
||||||
declare -r PackageManagerLog="$InstallerUtilsWorkspacePath/package_manager.log"
|
readonly PackageManagerLog="$InstallerUtilsWorkspacePath/package_manager.log"
|
||||||
|
|
||||||
declare IOUtilsHeader="fluxion_header"
|
declare IOUtilsHeader="fluxion_header"
|
||||||
declare -r IOUtilsQueryMark="$FLUXIONVLine"
|
readonly IOUtilsQueryMark="$FLUXIONVLine"
|
||||||
declare -r IOUtilsPrompt="$FLUXIONPrompt"
|
readonly IOUtilsPrompt="$FLUXIONPrompt"
|
||||||
|
|
||||||
declare -r HashOutputDevice="$FLUXIONOutputDevice"
|
readonly HashOutputDevice="$FLUXIONOutputDevice"
|
||||||
|
|
||||||
|
|
||||||
# ============================================================ #
|
# ============================================================ #
|
||||||
|
@ -418,30 +422,29 @@ trap fluxion_handle_exit SIGINT SIGHUP
|
||||||
# =============== < Resolution & Positioning > =============== #
|
# =============== < Resolution & Positioning > =============== #
|
||||||
# ============================================================ #
|
# ============================================================ #
|
||||||
fluxion_set_resolution() { # Windows + Resolution
|
fluxion_set_resolution() { # Windows + Resolution
|
||||||
# Calc options
|
|
||||||
RATIO=4
|
|
||||||
|
|
||||||
# Get demensions
|
# Get dimensions
|
||||||
SCREEN_SIZE=$(xdpyinfo | grep dimension | awk '{print $4}' | tr -d "(")
|
SCREEN_SIZE=$(xdpyinfo | grep dimension | awk '{print $4}' | tr -d "(")
|
||||||
SCREEN_SIZE_X=$(printf '%.*f\n' 0 $(echo $SCREEN_SIZE | sed -e s'/x/ /'g | awk '{print $1}'))
|
SCREEN_SIZE_X=$(printf '%.*f\n' 0 $(echo $SCREEN_SIZE | sed -e s'/x/ /'g | awk '{print $1}'))
|
||||||
SCREEN_SIZE_Y=$(printf '%.*f\n' 0 $(echo $SCREEN_SIZE | sed -e s'/x/ /'g | awk '{print $2}'))
|
SCREEN_SIZE_Y=$(printf '%.*f\n' 0 $(echo $SCREEN_SIZE | sed -e s'/x/ /'g | awk '{print $2}'))
|
||||||
|
|
||||||
|
# Calculate proportional windows
|
||||||
PROPOTION=$(echo $(awk "BEGIN {print $SCREEN_SIZE_X/$SCREEN_SIZE_Y}")/1 | bc)
|
PROPOTION=$(echo $(awk "BEGIN {print $SCREEN_SIZE_X/$SCREEN_SIZE_Y}")/1 | bc)
|
||||||
NEW_SCREEN_SIZE_X=$(echo $(awk "BEGIN {print $SCREEN_SIZE_X/$RATIO}")/1 | bc)
|
NEW_SCREEN_SIZE_X=$(echo $(awk "BEGIN {print $SCREEN_SIZE_X/$FLUXIONWindowRatio}")/1 | bc)
|
||||||
NEW_SCREEN_SIZE_Y=$(echo $(awk "BEGIN {print $SCREEN_SIZE_Y/$RATIO}")/1 | bc)
|
NEW_SCREEN_SIZE_Y=$(echo $(awk "BEGIN {print $SCREEN_SIZE_Y/$FLUXIONWindowRatio}")/1 | bc)
|
||||||
|
|
||||||
NEW_SCREEN_SIZE_BIG_X=$(echo $(awk "BEGIN {print 1.5*$SCREEN_SIZE_X/$RATIO}")/1 | bc)
|
NEW_SCREEN_SIZE_BIG_X=$(echo $(awk "BEGIN {print 1.5*$SCREEN_SIZE_X/$FLUXIONWindowRatio}")/1 | bc)
|
||||||
NEW_SCREEN_SIZE_BIG_Y=$(echo $(awk "BEGIN {print 1.5*$SCREEN_SIZE_Y/$RATIO}")/1 | bc)
|
NEW_SCREEN_SIZE_BIG_Y=$(echo $(awk "BEGIN {print 1.5*$SCREEN_SIZE_Y/$FLUXIONWindowRatio}")/1 | bc)
|
||||||
|
|
||||||
SCREEN_SIZE_MID_X=$(echo $(($SCREEN_SIZE_X + ($SCREEN_SIZE_X - 2 * $NEW_SCREEN_SIZE_X) / 2)))
|
SCREEN_SIZE_MID_X=$(echo $(($SCREEN_SIZE_X + ($SCREEN_SIZE_X - 2 * $NEW_SCREEN_SIZE_X) / 2)))
|
||||||
SCREEN_SIZE_MID_Y=$(echo $(($SCREEN_SIZE_Y + ($SCREEN_SIZE_Y - 2 * $NEW_SCREEN_SIZE_Y) / 2)))
|
SCREEN_SIZE_MID_Y=$(echo $(($SCREEN_SIZE_Y + ($SCREEN_SIZE_Y - 2 * $NEW_SCREEN_SIZE_Y) / 2)))
|
||||||
|
|
||||||
# Upper
|
# Upper windows
|
||||||
TOPLEFT="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y+0+0"
|
TOPLEFT="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y+0+0"
|
||||||
TOPRIGHT="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y-0+0"
|
TOPRIGHT="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y-0+0"
|
||||||
TOP="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y+$SCREEN_SIZE_MID_X+0"
|
TOP="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y+$SCREEN_SIZE_MID_X+0"
|
||||||
|
|
||||||
# Lower
|
# Lower windows
|
||||||
BOTTOMLEFT="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y+0-0"
|
BOTTOMLEFT="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y+0-0"
|
||||||
BOTTOMRIGHT="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y-0-0"
|
BOTTOMRIGHT="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y-0-0"
|
||||||
BOTTOM="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y+$SCREEN_SIZE_MID_X-0"
|
BOTTOM="-geometry $NEW_SCREEN_SIZE_Xx$NEW_SCREEN_SIZE_Y+$SCREEN_SIZE_MID_X-0"
|
||||||
|
@ -542,7 +545,7 @@ fluxion_do_sequence() {
|
||||||
if [ ${#@} -ne 2 ]; then return -1; fi
|
if [ ${#@} -ne 2 ]; then return -1; fi
|
||||||
|
|
||||||
# TODO: Implement an alternative, better method of doing
|
# TODO: Implement an alternative, better method of doing
|
||||||
# what this subroutine does, maybe using for-loop iteration.
|
# what this subroutine does, maybe using for-loop iteFLUXIONWindowRation.
|
||||||
# The for-loop implementation must support the subroutines
|
# The for-loop implementation must support the subroutines
|
||||||
# defined above, including updating the namespace tracker.
|
# defined above, including updating the namespace tracker.
|
||||||
|
|
||||||
|
@ -618,8 +621,8 @@ fluxion_header() {
|
||||||
fluxion_unset_language() {
|
fluxion_unset_language() {
|
||||||
FluxionLanguage=""
|
FluxionLanguage=""
|
||||||
|
|
||||||
if [ "$FLUXIONPreferencesFile" ]; then
|
if [ "$FLUXIONLanguagePreferencesFile" ]; then
|
||||||
sed -i.backup "/FluxionLanguage=.\+/ d" "$FLUXIONPreferencesFile"
|
sed -i.backup "/FluxionLanguage=.\+/ d" "$FLUXIONLanguagePreferencesFile"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -661,13 +664,13 @@ fluxion_set_language() {
|
||||||
|
|
||||||
source "$FLUXIONPath/language/$FluxionLanguage.sh"
|
source "$FLUXIONPath/language/$FluxionLanguage.sh"
|
||||||
|
|
||||||
if [ "$FLUXIONPreferencesFile" ]; then
|
if [ "$FLUXIONLanguagePreferencesFile" ]; then
|
||||||
if more $FLUXIONPreferencesFile | \
|
if more $FLUXIONLanguagePreferencesFile | \
|
||||||
grep -q "FluxionLanguage=.\+" &> /dev/null; then
|
grep -q "FluxionLanguage=.\+" &> /dev/null; then
|
||||||
sed -r "s/FluxionLanguage=.+/FluxionLanguage=$FluxionLanguage/g" \
|
sed -r "s/FluxionLanguage=.+/FluxionLanguage=$FluxionLanguage/g" \
|
||||||
-i.backup "$FLUXIONPreferencesFile"
|
-i.backup "$FLUXIONLanguagePreferencesFile"
|
||||||
else
|
else
|
||||||
echo "FluxionLanguage=$FluxionLanguage" >> "$FLUXIONPreferencesFile"
|
echo "FluxionLanguage=$FluxionLanguage" >> "$FLUXIONLanguagePreferencesFile"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -1013,7 +1016,7 @@ fluxion_target_get_candidates() {
|
||||||
return 3
|
return 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Syntheize scan operation results from output file "dump-01.csv."
|
# Syntheize scan opeFLUXIONWindowRation results from output file "dump-01.csv."
|
||||||
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).
|
||||||
|
|
Loading…
Reference in New Issue