From 2602de87380d7fa3135a87bb4c619659ad4e0fad Mon Sep 17 00:00:00 2001 From: Matias Barcenas Date: Fri, 11 Aug 2017 00:03:54 -0500 Subject: [PATCH] Changed signal to quality & fixed value bug. --- fluxion.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/fluxion.sh b/fluxion.sh index fb45da2..faa7ae0 100755 --- a/fluxion.sh +++ b/fluxion.sh @@ -10,6 +10,7 @@ FLUXIONHashPath="$FLUXIONPath/attacks/Handshake Snooper/handshakes" FLUXIONScanDB="dump" FLUXIONNoiseFloor=-90 +FLUXIONNoiseCeiling=-60 FLUXIONVersion=3 FLUXIONRevision=0 @@ -700,17 +701,29 @@ function set_target_ap() { TargetAPCandidatesChannel[i]=$(echo $candidateAPInfo | cut -d , -f 4) TargetAPCandidatesSecurity[i]=$(echo $candidateAPInfo | cut -d , -f 6) TargetAPCandidatesPower[i]=$(echo $candidateAPInfo | cut -d , -f 9) - # Bug: If value < -90, it'll be < 0%, if > -60 it'll be > 100%, too tired to fix this now. - TargetAPCandidatesSignal[i]=$((( ${TargetAPCandidatesPower[i]} * 10 - $FLUXIONNoiseFloor * 10 ) / 3 )) TargetAPCandidatesESSID[i]=$(echo $candidateAPInfo | cut -d , -f 14) TargetAPCandidatesColor[i]=$([ ${TargetAPCandidatesClientsCount[i]} -gt 0 ] && echo $CGrn || echo $CClr) + + local power=${TargetAPCandidatesPower[i]} + if [ $power -eq -1 ]; then + # airodump-ng's man page says -1 means unsupported value. + TargetAPCandidatesQuality[i]="??"; + elif [ $power -le $FLUXIONNoiseFloor ]; then + TargetAPCandidatesQuality[i]=0; + elif [ $power -gt $FLUXIONNoiseCeiling ]; then + TargetAPCandidatesQuality[i]=100; + else + # Bash doesn't support floating point division, so I gotta work around it... + # The function is Q = ((P - F) / (C - F)); Q - quality, P - power, F - floor, C - Ceiling. + TargetAPCandidatesQuality[i]=$((( ${TargetAPCandidatesPower[i]} * 10 - $FLUXIONNoiseFloor * 10 ) / ( ( $FLUXIONNoiseCeiling - $FLUXIONNoiseFloor ) / 10 ) )) + fi done - local header=$(printf "%44s\n\n$CRed[$CYel * $CRed]$CClr %-30s %4s %3s %3s %4s %6s %18s\n" "WIFI LIST" "ESSID" "SIG" "PWR" "CL" "CH" "SEC" "MAC ADDRESS") + local header=$(printf "%44s\n\n$CRed[$CYel * $CRed]$CClr %-30s %4s %3s %3s %4s %6s %18s\n" "WIFI LIST" "ESSID" "QLTY" "PWR" "CL" "CH" "SEC" "MAC ADDRESS") io_query_format_fields "$header" "$CRed[$CYel%03d$CRed]%b %-30s %3s%% %3s %3d %4s %6s %18s\n" \ TargetAPCandidatesColor[@] \ TargetAPCandidatesESSID[@] \ - TargetAPCandidatesSignal[@] \ + TargetAPCandidatesQuality[@] \ TargetAPCandidatesPower[@] \ TargetAPCandidatesClientsCount[@] \ TargetAPCandidatesChannel[@] \