From cdacff38e1f28dad4785e2bb94dc85baeb160efb Mon Sep 17 00:00:00 2001 From: strasharo <3337997+strasharo@users.noreply.github.com> Date: Sat, 21 Feb 2026 14:15:33 +0200 Subject: [PATCH] Fix load_attack config corruption, allow --list-interfaces without root - Replace more with direct redirection in load_attack (Handshake Snooper and Captive Portal): more adds 3 header lines when stdout is a pipe, shifting all config array indices by +3 and corrupting the deauth method, jammer interface, and verifier settings on second and subsequent runs - Apply the same fix to fluxion_handle_target_change, which read target_info.txt through more causing MAC/SSID/channel corruption on tracker-triggered restarts - Allow --list-interfaces to run without root: all operations are read-only sysfs/lsusb/lspci/iw queries that need no elevated privileges - Skip preferences file load/create when not root to avoid permission errors on the root-owned preferences.conf --- attacks/Captive Portal/attack.sh | 2 +- attacks/Handshake Snooper/attack.sh | 2 +- fluxion.sh | 18 ++++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/attacks/Captive Portal/attack.sh b/attacks/Captive Portal/attack.sh index bf46c03..fc7a5ca 100755 --- a/attacks/Captive Portal/attack.sh +++ b/attacks/Captive Portal/attack.sh @@ -1363,7 +1363,7 @@ load_attack() { local -r configurationPath=$1 local configuration - readarray -t configuration < <(more "$configurationPath") + readarray -t configuration < "$configurationPath" CaptivePortalJammerInterfaceOriginal=${configuration[0]} CaptivePortalAccessPointInterfaceOriginal=${configuration[1]} diff --git a/attacks/Handshake Snooper/attack.sh b/attacks/Handshake Snooper/attack.sh index be2c2a7..c21743f 100755 --- a/attacks/Handshake Snooper/attack.sh +++ b/attacks/Handshake Snooper/attack.sh @@ -541,7 +541,7 @@ load_attack() { local -r configurationPath=$1 local configuration - readarray -t configuration < <(more "$configurationPath") + readarray -t configuration < "$configurationPath" HandshakeSnooperDeauthenticatorIdentifier=${configuration[0]} HandshakeSnooperJammerInterfaceOriginal=${configuration[1]} diff --git a/fluxion.sh b/fluxion.sh index 2a45d72..73e2390 100755 --- a/fluxion.sh +++ b/fluxion.sh @@ -22,7 +22,7 @@ readonly FLUXIONNoiseFloor=-90 readonly FLUXIONNoiseCeiling=-60 readonly FLUXIONVersion=6 -readonly FLUXIONRevision=22 +readonly FLUXIONRevision=23 # Declare window ration bigger = smaller windows FLUXIONWindowRatio=4 @@ -53,7 +53,7 @@ for arg in "$@"; do esac done -if [ $EUID -ne 0 ] && [ ! "$FLUXIONPreParseHelp" ]; then +if [ $EUID -ne 0 ] && [ ! "$FLUXIONPreParseHelp" ] && [ ! "$FLUXIONPreParseListIfaces" ]; then echo -e "\\033[31mAborted, please execute the script as root.\\033[0m"; exit 1 fi @@ -198,11 +198,13 @@ shift # Remove "--" to prepare for attacks to read parameters. # Load user-defined preferences if there's an executable script. # If no script exists, prepare one for the user to store config. # WARNING: Preferences file must assure no redeclared constants. -if [ -x "$FLUXIONPreferencesFile" ]; then - source "$FLUXIONPreferencesFile" -else - echo '#!/usr/bin/env bash' > "$FLUXIONPreferencesFile" - chmod u+x "$FLUXIONPreferencesFile" +if [ $EUID -eq 0 ]; then + if [ -x "$FLUXIONPreferencesFile" ]; then + source "$FLUXIONPreferencesFile" + else + echo '#!/usr/bin/env bash' > "$FLUXIONPreferencesFile" + chmod u+x "$FLUXIONPreferencesFile" + fi fi # ================ < Configurable Constants > ================ # @@ -656,7 +658,7 @@ fluxion_handle_target_change() { echo "Target change signal received!" > $FLUXIONOutputDevice local targetInfo - readarray -t targetInfo < <(more "$FLUXIONWorkspacePath/target_info.txt") + readarray -t targetInfo < "$FLUXIONWorkspacePath/target_info.txt" FluxionTargetMAC=${targetInfo[0]} FluxionTargetSSID=${targetInfo[1]}