From 3e1a30805bc83b924f7e0dd81407891d35f178fd Mon Sep 17 00:00:00 2001 From: Matias Barcenas Date: Sun, 24 Dec 2017 14:45:14 -0600 Subject: [PATCH 1/2] Configured lighttpd for global redirection. Lighttpd has been configured to redirect everything to captive.gateway.lan. --- attacks/Captive Portal/attack.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/attacks/Captive Portal/attack.sh b/attacks/Captive Portal/attack.sh index 7005047..c810192 100755 --- a/attacks/Captive Portal/attack.sh +++ b/attacks/Captive Portal/attack.sh @@ -481,10 +481,12 @@ index-file.names = ( \"index.php\" ) -# Redirect www.domain.com to domain.com -#\$HTTP[\"host\"] =~ \"^www\.(.*)$\" { -# url.redirect = ( \"^/(.*)\" => \"http://%1/\$1\" ) -#} +# Redirect all traffic to the captive portal. +\$HTTP[\"host\"] != \"captive.gateway.lan\" { + url.redirect = ( + \"^/(.*)\" => \"http://captive.gateway.lan/\", + ) +} " > "$FLUXIONWorkspacePath/lighttpd.conf" # Configure lighttpd's SSL only if we've got a certificate and its key. From cf23366f871ceff1ec242e60ee8b0dcb63c00f29 Mon Sep 17 00:00:00 2001 From: Matias Barcenas Date: Sun, 24 Dec 2017 15:05:20 -0600 Subject: [PATCH 2/2] Fixed connectivity emulation bug. The bug was recently introduced by lighttpd's global redirection directive. The global redirection ignored special domains used for emulation. --- attacks/Captive Portal/attack.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/attacks/Captive Portal/attack.sh b/attacks/Captive Portal/attack.sh index c810192..f6d39fa 100755 --- a/attacks/Captive Portal/attack.sh +++ b/attacks/Captive Portal/attack.sh @@ -480,13 +480,6 @@ index-file.names = ( \"index.html\", \"index.php\" ) - -# Redirect all traffic to the captive portal. -\$HTTP[\"host\"] != \"captive.gateway.lan\" { - url.redirect = ( - \"^/(.*)\" => \"http://captive.gateway.lan/\", - ) -} " > "$FLUXIONWorkspacePath/lighttpd.conf" # Configure lighttpd's SSL only if we've got a certificate and its key. @@ -516,9 +509,8 @@ index-file.names = ( " >> "$FLUXIONWorkspacePath/lighttpd.conf" else echo "\ -# Android requires an explicit redirection code on certain domains. -# 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\" { +# Redirect all traffic to the captive portal when not emulating a connection. +\$HTTP[\"host\"] != \"captive.gateway.lan\" { url.redirect = ( \"^/(.*)\" => \"http://captive.gateway.lan/\", )