Fixed missing spacers, transitions & captorPID bug.

Added all missing spacers after a choice operation (missing echo).
Rearranged fluxion_header algorithm to make transitions smoother.
Fixed a bug where captorPID might be missed (not waiting [enough] for it).
This commit is contained in:
Matias Barcenas 2017-08-12 21:23:22 -05:00
parent af07814b8e
commit 1aa3d96c8a
3 changed files with 47 additions and 9 deletions

View File

@ -55,6 +55,8 @@ function captive_portal_set_auth() {
io_query_format_fields "" "\t$CRed[$CYel%d$CRed]$CClr %b %b\n" choices[@] \
CaptivePortalAuthenticationMethodsInfo[@]
echo
APRogueAuthMode="${IOQueryFormatFields[0]}"
if [[ "$APRogueAuthMode" = "$FLUXIONGeneralBackOption" ]]; then
@ -102,6 +104,8 @@ function captive_portal_set_cert() {
while [ ! -f "$FLUXIONWorkspacePath/server.pem" -o ! -s "$FLUXIONWorkspacePath/server.pem" ]; do
io_query_choice "$CaptivePortalCertificateSourceQuery" choices[@]
echo
case "$IOQueryChoice" in
"$CaptivePortalCertificateSourceGenerateOption") captive_portal_run_certificate_generator; break;;
"$CaptivePortalCertificateSourceRescanOption") return 2;;
@ -157,6 +161,8 @@ function captive_portal_set_site() {
"$CRed[$CYel%02d$CRed]$CClr %-38b $CBlu[%10s]$CClr\n" \
sitesIdentifier[@] sitesLanguage[@]
echo
local site="${IOQueryFormatFields[0]}"
local siteLanguage="${IOQueryFormatFields[1]}"
local sitePath="${site}_${siteLanguage}"

View File

@ -69,6 +69,8 @@ function handshake_stop_deauthenticator() {
function handshake_start_deauthenticator() {
if [ "$HANDSHAKEDeauthenticatorPID" ]; then return 0; fi
handshake_stop_deauthenticator
# Prepare deauthenticators
case "$HANDSHAKEMethod" in
"$HandshakeSnooperMdk3MethodOption") echo "$APTargetMAC" > $FLUXIONWorkspacePath/mdk3_blacklist.lst
@ -96,11 +98,19 @@ function handshake_stop_captor() {
function handshake_start_captor() {
if [ "$HANDSHAKECaptorPID" ]; then return 0; fi
handshake_stop_captor
xterm -hold -title "Handshake Captor (CH $APTargetChannel)" $TOPRIGHT -bg "#000000" -fg "#FFFFFF" -e \
airodump-ng -d $APTargetMAC -w "$FLUXIONWorkspacePath/capture/dump" -c $APTargetChannel -a $WIMonitor &
sleep 3
HANDSHAKECaptorPID=$(ps a | awk '$5~/^airodump-ng/ && $7~/'"$APTargetMAC"'/{print $1}')
echo -e "$FLUXIONVLine Captor process is starting, please wait..."
while [ ! "$HANDSHAKECaptorPID" ]; do
# Here, we'll wait for the airodump-ng PID, since we want to leave the xterm open.
# This is because we need to have a method of notifying the user the hash is captured.
# Once the hash is captured, we can terminate the captor and the xterm will freeze.
HANDSHAKECaptorPID=$(ps a | awk '$5~/^airodump-ng/ && $7~/'"$APTargetMAC"'/{print $1}')
sleep 1
done
}
function handshake_unset_method() {
@ -110,11 +120,15 @@ function handshake_unset_method() {
function handshake_set_method() {
if [ "$HANDSHAKEMethod" ]; then return 0; fi
handshake_unset_method
local methods=("$HandshakeSnooperMonitorMethodOption" "$HandshakeSnooperAireplayMethodOption" "$HandshakeSnooperMdk3MethodOption" "$FLUXIONGeneralBackOption")
io_query_choice "$HandshakeSnooperMethodQuery" methods[@]
HANDSHAKEMethod=$IOQueryChoice
echo
if [ "$HANDSHAKEMethod" = "$FLUXIONGeneralBackOption" ]; then
handshake_unset_method
return 1
@ -131,6 +145,8 @@ function handshake_set_verifier() {
local choices=("$FLUXIONHashVerificationMethodPyritOption" "$FLUXIONHashVerificationMethodAircrackOption" "$FLUXIONGeneralBackOption")
io_query_choice "$FLUXIONHashVerificationMethodQuery" choices[@]
echo
case "$IOQueryChoice" in
"$FLUXIONHashVerificationMethodPyritOption") HANDSHAKEVerifier="pyrit";;
"$FLUXIONHashVerificationMethodAircrackOption") HANDSHAKEVerifier="aircrack-ng";;

View File

@ -224,14 +224,14 @@ trap handle_exit SIGINT SIGHUP
# Design
function fluxion_header() {
conditional_clear
format_autosize "[%*s]\n"
local verticalBorder=$FormatAutosize
format_autosize "[%*s${CRed}FLUXION $FLUXIONVersion ${CRed}< F${CYel}luxion ${CRed}I${CYel}s ${CRed}T${CYel}he ${CRed}F${CYel}uture >%*s$CBlu]\n";
local headerTextFormat="$FormatAutosize"
conditional_clear
echo -e "`printf "$CRed$verticalBorder" "" | sed -r "s/ /~/g"`"
printf "$CRed$verticalBorder" ""
printf "$headerTextFormat" "" ""
@ -432,9 +432,9 @@ function set_language() {
io_query_choice "Select your language" languages[@]
source "$FLUXIONPath/language/$IOQueryChoice.lang"
echo
source "$FLUXIONPath/language/$IOQueryChoice.lang"
fi
}
@ -510,9 +510,11 @@ function set_interface() {
io_query_format_fields "$FLUXIONVLine $FLUXIONInterfaceQuery" \
"$CRed[$CYel%d$CRed]%b %-8b [%1s] %s\n" \
WIAvailableColor[@] WIAvailable[@] WIAvailableState[@] WIAvailableInfo[@]
echo
WISelected="${IOQueryFormatFields[1]}"
WISelectedState="${IOQueryFormatFields[2]}"
echo
fi
if [ "$WISelected" = "$FLUXIONGeneralRepeatOption" ]; then
@ -655,7 +657,9 @@ function run_scanner() {
local choices=("$FLUXIONGeneralBackOption" "$FLUXIONGeneralExitOption")
io_query_choice "$FLUXIONScannerFailedNotice" choices[@]
echo
case "$IOQueryChoice" in
"$FLUXIONGeneralBackOption") return 1;;
"$FLUXIONGeneralExitOption") exitmode; return 2;;
@ -754,6 +758,8 @@ function set_target_ap() {
TargetAPCandidatesSecurity[@] \
TargetAPCandidatesMAC[@]
echo
APTargetSSID=${IOQueryFormatFields[1]}
APTargetChannel=${IOQueryFormatFields[5]}
APTargetEncryption=${IOQueryFormatFields[6]}
@ -808,6 +814,8 @@ function set_ap_service() {
local choices=("$FLUXIONAPServiceHostapdOption" "$FLUXIONAPServiceAirbaseOption" "$FLUXIONGeneralBackOption")
io_query_choice "" choices[@]
echo
case "$IOQueryChoice" in
"$FLUXIONAPServiceHostapdOption" ) APRogueService="hostapd";;
"$FLUXIONAPServiceAirbaseOption" ) APRogueService="airbase-ng";;
@ -838,6 +846,8 @@ function check_hash() {
local choices=("$FLUXIONHashVerificationMethodPyritOption" "$FLUXIONHashVerificationMethodAircrackOption" "$FLUXIONGeneralBackOption")
io_query_choice "" choices[@]
echo
local verifier
case "$IOQueryChoice" in
"$FLUXIONHashVerificationMethodPyritOption") verifier="pyrit";;
@ -917,6 +927,8 @@ function set_hash() {
local choices=("$FLUXIONHashSourcePathOption" "$FLUXIONHashSourceRescanOption" "$FLUXIONGeneralBackOption")
io_query_choice "" choices[@]
echo
case "$IOQueryChoice" in
"$FLUXIONHashSourcePathOption") set_hash_path; check_hash;;
"$FLUXIONHashSourceRescanOption") set_hash;; # Rescan checks hash automatically.
@ -959,6 +971,8 @@ function set_attack() {
io_query_choice "" attacks[@]
echo
if [ "$IOQueryChoice" = "$FLUXIONGeneralBackOption" ]; then
unset_target_ap
unset_attack
@ -982,7 +996,9 @@ function run_attack() {
start_attack
local choices=("$FLUXIONSelectAnotherAttackOption" "$FLUXIONGeneralExitOption")
io_query_choice "`io_dynamic_output $FLUXIONAttackInProgressNotice`" choices[@]
io_query_choice "`io_dynamic_output $FLUXIONAttackInProgressNotice`" choices[@]
echo
# IOQueryChoice is a global, meaning, its value is volatile.
# We need to make sure to save the choice before it changes.