IOS CNA bypass when implementing a hidden portal in Linux + Apache2

I am trying to implement a hijacked portal using a Linux machine with Apache2. In this situation, most operating systems use the Captive Network Assistant (CNA) method to "detect", regardless of whether they are connected to an unclaimed portal (Android, Windows, OSX, iOS, ...).

Well, everything works "perfectly" for Android and Windows devices (although they may warn you with some message like "you may need additional network information ...", etc.). The problem is with Apple devices. It seems that the iOS implementation for CNA is a little more complicated because it opens a login pop-up window waiting for credentials to be entered ... Thus, I cannot view my content in the main Safari window, but in this “temporary” Safari window. ..

I looked in detail at some ways to "work around" this iOS CNA implementation, which simply serves the "success.html" file when it's convenient, and I found that someone managed to use the LightTPD web server, for example:

dir-listing.hide-dotfiles   = "enable"

# Fix for iOS7
#   It ask especially different domains without a specific URL.
#   It want to get a "success" message, to allow full system/internet access
$HTTP["useragent"] =~ "CaptiveNetworkSupport" {
    server.document-root =  "/opt/piratebox/www/library/test/"
    index-file.names        = ( "success.html" )
    dir-listing.activate    = "disable"
    server.error-handler-404 = "/success.html"
}

, - "" LightTPD Apache2, , RewriteCond + RewriteRule...

, - iOS CNA Apache2, , .

.

+3
1

:

    RewriteEngine  on
    RewriteCond %{HTTP_USER_AGENT}  ^CaptiveNetworkSupport(.*)$
    RewriteCond %{REQUEST_URI}  !^/tools/apple(.*) [NC]
    RewriteRule ^(.*)$  http://yourdomain/pub/apple/success.html [L,R=302]
0

All Articles