Wednesday, January 17, 2018

Captive portal popups: the definitive guide

Hi all,

So for the last half year I have been doing a school project about captive portals. A good helping point for me has been this serverfault Q. But since the Q is closed and I would like to help people the way it helped me I decided to open it up here.

So please everyone post down your Apache/Tomcat/Nginx ways to get the captive portal popups.

One method that worked for me for all devices I tested it on (IOS 8/9/10, Android 4/5/6/7/8, Windows Phone) was:

RedirectMatch 302 / http://$IP 

As told by Stackexchange user @hdezela this is how the captive portal popups are triggered:

All mobile OS just check a web page to decide whether they're behind a captive portal or not. The mechanism is this:

  1. GET/POST http://foo.com/bar.html
  2. If bar.html == [expected content] > Open Internet
  3. If bar.html != [expected content] > Captive Portal
  4. If bar.html[status] != SUCCESS > No Network

Also, for iOS, you need to have a domain for your WiFi network as it assumes a domainless network without access is a home network and just marks it as No Network instead of Captive Portal.



No comments:

Post a Comment