├── Ruijie
├── portal
│ └── index.php
├── auth
│ └── index.php
├── login
│ └── index.php
└── README.md
├── Mikrotik
├── SUMMARY.md
├── index.php
├── README.md
├── connect.php
└── md5.js
├── Meraki
├── connect.php
├── index.php
└── README.md
├── Aruba iAP
├── Auth Text Settings.png
├── login.php
├── userlogin.html
├── index.php
└── README.md
├── D Link
├── index.php
└── README.md
├── Huawei
├── index.php
└── README.md
├── Unifi
├── Server Instructions.txt
├── index.php
├── README.md
└── connecting.php
├── Aerohive
├── index.html
└── README.md
├── Fortigate
├── README.md
└── index.php
├── Ruckus
├── unleashed.php
├── ruckusone-noradius.php
├── ruckusone-withradius.php
├── smartzone.php
└── README.md
├── Zyxel Nebula
├── index.html
└── README.md
├── Cambium cnMaestro
├── README.md
└── index.php
├── Draytek
├── index.php
└── README.md
├── Aruba Instant On
├── index.php
└── README.md
├── Alta
├── README.md
└── index.php
├── OpenNDS
├── fas-0.php
├── fas-1.php
├── fas-23.php
└── README.md
├── Cradlepoint
├── README.md
├── connect.php
└── index.php
├── README.md
├── Plasma Cloud
├── connect.php
├── README.md
└── index.php
├── TP Link Omada
├── RADIUS
│ ├── index.php
│ ├── login.php
│ └── radius.html
├── README.md
└── index.php
├── Coova Chilli
├── connect.php
├── index.php
└── README.md
├── Cisco
├── README.md
└── index.php
└── LICENSE
/Ruijie/portal/index.php:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Aruba iAP/login.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 | WiFi Portal
14 |
15 |
16 |
17 | Guest_authenticated
18 | Login Successful!
19 |
20 |
21 |
--------------------------------------------------------------------------------
/D Link/index.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Huawei/index.php:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Unifi/Server Instructions.txt:
--------------------------------------------------------------------------------
1 | *********************
2 | Tested on Ubuntu 16
3 | *********************
4 |
5 | Step 1:
6 |
7 | apt-get -y install apache2 nano curl software-properties-common python-software-properties
8 |
9 | Step 2:
10 |
11 | add-apt-repository ppa:ondrej/php
12 |
13 | Step 3:
14 |
15 | apt-get update
16 |
17 | Step 4:
18 |
19 | apt-get install -y --allow-unauthenticated php7.2 php-pear php7.2-curl php7.2-dev php7.2-xml php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xmlrpc php-curl libapache2-mod-php
20 |
21 | Step 5:
22 |
23 | systemctl restart apache2
24 |
--------------------------------------------------------------------------------
/Aerohive/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | WiFi Portal
6 |
7 |
8 |
9 | Welcome!
10 | Please login to our Wifi service
11 |
12 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Fortigate/README.md:
--------------------------------------------------------------------------------
1 | # Fortigate External Captive Portal
2 |
3 | This is an example of a PHP based external captive portal for Fortigate. The code given here can be used to setup a basic captive portal featuring an HTML login form.
4 |
5 | The username and password has to be posted to the Fortigate firewall.
6 |
7 | HTTP Request Type: `GET`
8 |
9 | Apache access log example:
10 |
11 | ```
12 | login&post=http://172.172.172.1:1000/fgtauth&magic=050e078a95ae1754&usermac=fc:3f:db:a6:4a:ff&apmac=70:4c:a5:ab:85:95&apip=172.172.172.1&userip=172.172.172.2&ssid=Test&apname=FG800D5818800451&bssid=00:00:00:00:00:00
13 | ```
14 |
--------------------------------------------------------------------------------
/Fortigate/index.php:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ruckus/unleashed.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 | WiFi Portal
12 |
13 |
14 |
15 | Welcome!
16 | Please login to our Wifi service
17 |
18 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Zyxel Nebula/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | WiFi Portal
6 |
7 |
8 |
9 | Welcome!
10 | Please login to our Wifi service
11 |
12 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Cambium cnMaestro/README.md:
--------------------------------------------------------------------------------
1 | # Cambium cnMaestro External Captive Portal
2 |
3 | This is an example of a PHP based external captive portal for Cambium cnMaestro. It has been tested with cnPilot e410. The code given here authorizes the user on the network. Any user engagement flow can be added to it based on one's requirements.
4 |
5 | Note: The username password that is submitted via `index.php` should exist in RADIUS as well.
6 |
7 | Here is Apache's access log:
8 |
9 | ```
10 | "GET /?ga_ssid=guest&ga_ap_mac=30-CB-C7-AF-7F-A2&ga_nas_id=E410-AF7FA2&ga_srvr=eu-w1-guest.cloud.cambiumnetworks.com&ga_cmac=22-91-CA-5D-90-96&s=1fk1b1gzLbHILDkUkBcObftO_6Lu11dxu_aYG0D4GDAo.&ga_Qv=eUROBR86HBgAGDEEVgQAGw4UWRUCACYVMgFPQ1RZX1tfIVRGKC1FUHBZQVNLBhMUMww. HTTP/1.1"
11 | ```
12 |
--------------------------------------------------------------------------------
/Zyxel Nebula/README.md:
--------------------------------------------------------------------------------
1 | # Zyxel Nebula External Captive Portal
2 |
3 | This portal has been tested on the following hardware:
4 |
5 | ```
6 | Device: NWA90AX
7 | Redirect Method: GET
8 | ```
9 |
10 | *GET Parameters*
11 |
12 | ```
13 | Array ( [apmac] => b8:ec:a3:e4:69:c2 [usermac] => 1e:ef:13:77:22:d0 [apip] => 192.168.1.161 [userip] => 10.156.213.184 [ssid_name] => owetm__Test Nebula1_9e433ee873 [apurl] => http://nap-slogin.nebula.zyxel.com/cgi-bin/Clicktocontinue.cgi )
14 | ```
15 |
16 | Example of Apache Access Log (on captive portal server):
17 |
18 | ```
19 | apmac=b8:ec:a3:e4:69:c2&usermac=16:ca:3d:da:3c:ce&apip=192.168.1.161&userip=10.8.83.43&ssid_name=_Test%20Nebula1&apurl=https://nap-slogin.nebula.zyxel.com/cgi-bin/login.cgi&error_num=1 HTTP/1.1
20 | ```
21 |
--------------------------------------------------------------------------------
/Cambium cnMaestro/index.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 | WiFi Portal
14 |
15 |
16 |
17 | Welcome!
18 | Please login to our Wifi service
19 |
20 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Draytek/index.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Aruba Instant On/index.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 | WiFi Portal
11 |
12 |
13 |
14 | Welcome!
15 | Please login to our Wifi service
16 |
17 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Unifi/index.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 | WiFi Portal
16 |
17 |
18 |
19 | Welcome!
20 | Please login to our Wifi service
21 |
22 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Aruba iAP/userlogin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | WiFi Portal
6 |
7 |
8 |
9 | Welcome!
10 | Please login to our Wifi service
11 |
12 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Alta/README.md:
--------------------------------------------------------------------------------
1 | # Alta External Captive Portal
2 |
3 | This is an example of a PHP based external captive portal for Alta. It has been tested with AP6. The code given here authorizes the user on the network. Any user engagement flow can be added to it based on one's requirements.
4 |
5 | You need to enter the correct value for `$secret` based on what you have configured on Alta's portal.
6 |
7 | This portal will authorize the user for 4 hours by default. You may include `timeout` parameter in JSON body to specify a different time limit in seconds.
8 |
9 | The redirect query string just contains 1 parameter `token`. Here is Apache's access log:
10 |
11 | ```
12 | "GET /?token=dKBnu3mnU05KF3JXmoxL5Tu_mRnf7MqvOMcqKNG3QHgn_0StyWaqAHvTGKMRbqkpRlJW1Ix_qJJ9bQweDmsn9j8UYoOL1HpjlJZUxscf6MM2YAry7zM6mFL8T_qc0kr5XCumfYflkkNnEQ HTTP/1.0" 200 4681 "-" "CaptiveNetworkSupport-443.120.3 wispr"
13 | ```
14 |
--------------------------------------------------------------------------------
/Aruba iAP/index.php:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 | WiFi Portal
14 |
15 |
16 |
17 | Welcome!
18 | Please login to our Wifi service
19 |
20 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Meraki/README.md:
--------------------------------------------------------------------------------
1 | # Cisco Meraki External Captive Portal
2 |
3 | This portal has been tested on Meraki as well as Meraki Go.
4 |
5 | Apache Access Log (on captive portal server):-
6 | ```
7 | 95.141.23.135 - - [24/Nov/2022:10:29:50 +0000] "GET /?user_continue_url=https%3A%2F%2Fn93.network-auth.com%2Fsplash%2Fconnected%3Fhide_terms%3Dtrue&node_id=247165649030275&node_mac=e0:cb:bc:b6:0c:83&gateway_id=247165649030275&client_ip=10.218.44.108&client_mac=42:ae:4c:c0:73:a2&base_grant_url=https%3A%2F%2Fn93.network-auth.com%2Fsplash%2Fgrant HTTP/1.0" 200 1006 "-" "CaptiveNetworkSupport-441 wispr"
8 | ```
9 | Get parameters in redirect:
10 | ```
11 | Array ( [user_continue_url] => http://www.cnn.com/ [node_id] => 247165649030275 [node_mac] => e0:cb:bc:b6:0c:83 [gateway_id] => 247165649030275 [client_ip] => 10.218.44.108 [client_mac] => 42:ae:4c:c0:73:a2 [base_grant_url] => https://n93.network-auth.com/splash/grant )
12 | ```
13 |
--------------------------------------------------------------------------------
/OpenNDS/fas-0.php:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 | Free WiFi
14 |
15 |
16 |
17 |
18 | Connecting
19 |
23 |
30 |
31 |
--------------------------------------------------------------------------------
/Cradlepoint/README.md:
--------------------------------------------------------------------------------
1 | # Cradlepoint External Captive Portal
2 |
3 | Cradlepoint uses Coova Chilli under the hood. Their documentation can be found [here](https://customer.cradlepoint.com/articles/Knowledge/NCOS-How-to-Setup-Hotspot-Services-Captive-Portal).
4 |
5 | For further details please consult Coova Chilli documentation in [this](https://github.com/nasirhafeez/capport/tree/master/Coova%20Chilli) repository. The only difference between the code given here is that in `connect.php` line 45 uses `response` parameter instead of `password`.
6 |
7 | Apache access log for Coova Chilli on OpenWRT:
8 |
9 | ```
10 | "GET /?res=notyet&uamip=192.168.0.1&uamport=8000&challenge=0b1c72e9022049697cd6eee92c037e31&called=00-30-44-46-7d-7a&mac=66-8c-01-5c-82-37&ip=192.168.0.184&nasid=&sessionid=2b3abee1c0a800b8&userurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html HTTP/1.0" 302 3374 "-" "CaptiveNetworkSupport-428.120.3 wispr"
11 | ```
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Captive Portal Parameters
2 |
3 | This repository is a collection of captive portal redirect parameters for various vendors' equipment (like Mikrotik, Ubiquiti, Draytek etc) and software packages (like Coova Chilli) as well as parameters and code required to authenticate users on those platforms.
4 |
5 | *Notes on other systems that support captive portals*
6 |
7 | #### Coova Chilli ####
8 |
9 | Many vendors use Coova Chilli as their captive portal package so the code given [here](https://github.com/splash-networks/capport/tree/master/Coova%20Chilli) will work for them. Some examples are Teltonika, Xirrus, LigoWave and OpenMesh. Some use Coova Chilli with slight variations, such as Cradlepoint and Plasma. Their codes are given in their respective folders.
10 |
11 | #### pfSense, OPNSense, PacketFence, Sophos
12 |
13 | These platforms only have an internal captive portal. They do not support external captive portals.
14 |
--------------------------------------------------------------------------------
/D Link/README.md:
--------------------------------------------------------------------------------
1 | Tested on `DBA-2520P` AP with firmware `2.05.003` via D Link Nuclias Cloud.
2 |
3 | Apache access log:
4 |
5 | ```
6 | "GET /?continue_url=https%3A%2F%2Fwww.nuclias.com%2F&login_url=https%3A%2F%2Fexternal.redirect.nuclias.com%2Fexternal.ccp%3Fstate%3D50335181369277980&ssid=Nuclias_Guest&ap_mac=C4%3AE9%3A0A%3AA0%3A18%3AC6&ap_name=C4%3AE9%3A0A%3AA0%3A18%3AC6&ap_tags=Captive%20Wifi%2CCaptive%20Wifi&mauth=1A%3AFF%3A2C%3A18%3A99%3A96&ip=10.229.65.131&mac=1A%3AFF%3A2C%3A18%3A99%3A96&logout_url=https%3A%2F%2Flogout.redirect.nuclias.com%2F HTTP/1.1" 200 5887 "http://connectivitycheck.gstatic.com/" "Mozilla/5.0 (Linux; Android 12; A063 Build/SKQ1.211230.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/108.0.5359.128 Mobile Safari/537.36"
7 | ```
8 |
9 | The RADIUS server needs to allow only usernames and passwords. If a RADIUS server is configured with `DEFAULT Auth-Type := Accept` to allow all users for testing, the external captive portal redirection does not work properly because D-Link starts using MAC based authentication (this was communicated by D Link support).
10 |
--------------------------------------------------------------------------------
/Aerohive/README.md:
--------------------------------------------------------------------------------
1 | # Aerohive External Captive Portal
2 |
3 | This is an example of a PHP based external captive portal for Aerohive. The code given here can be used to setup a basic captive portal featuring an HTML login form. The `http://1.1.1.1/reg.php` URL given here represents the internal IP address of the one of the radio interfaces on the Aerohive AP. The AP has several internal radio interfaces (and sub-interfaces) like: `Wifi0`, `Wifi1`, `Wifi0.1` and `Wifi1.1`. They represent 2.4 GHz and 5 GHz channels and also 802.11n/802.11ac standards. They have IPs like `1.1.1.1` and `1.1.2.1`.
4 |
5 | The username and password has to be posted to the IP of the correct interface.
6 |
7 | HTTP Request Type: `GET`
8 |
9 | Apache access log example:
10 |
11 | ```
12 | url=E2B8F3578D88E9B12D88FB428D83488ECB3F06945E31C5FBC89099D15D278E90A4AFE84A98C0A3BC2794F4538BA813C896&ssid=CAPTIVE-TEST&mac=2a3a117cfd4a&autherr=0&challenge=2D3DCCBBA8F7A3C217228514113476D1&Called-Station-Id=90b8326defa7&NAS-IP-Address=198.18.38.1&RADIUS-NAS-IP=192.168.10.250&Calling-Station-Id=2a3a117cfd4a&STA-IP=192.168.10.14&NAS-ID=AH-6def80&MGT-MAC-Address=90b8326def80 HTTP/1.1
13 | ```
14 |
--------------------------------------------------------------------------------
/Alta/index.php:
--------------------------------------------------------------------------------
1 | $token,
13 | "secret" => $secret
14 | ];
15 |
16 | curl_setopt_array($curl, array(
17 | CURLOPT_URL => $api_url,
18 | CURLOPT_RETURNTRANSFER => true,
19 | CURLOPT_ENCODING => '',
20 | CURLOPT_MAXREDIRS => 10,
21 | CURLOPT_TIMEOUT => 0,
22 | CURLOPT_SSL_VERIFYPEER => false,
23 | CURLOPT_SSL_VERIFYHOST => false,
24 | CURLOPT_FOLLOWLOCATION => true,
25 | CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
26 | CURLOPT_CUSTOMREQUEST => 'POST',
27 | CURLOPT_POSTFIELDS => json_encode($postData),
28 | CURLOPT_HTTPHEADER => array(
29 | 'Content-Type: application/json'
30 | ),
31 | ));
32 |
33 | $response = curl_exec($curl);
34 |
35 | if ($response !== false) {
36 | $json = json_decode($response, true);
37 | echo $json;
38 | }
39 | else {
40 | die("Error: check with your network administrator");
41 | }
42 |
43 | ?>
44 |
--------------------------------------------------------------------------------
/Mikrotik/index.php:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
21 | WiFi Portal
22 |
23 |
24 |
25 | Welcome!
26 | Please login to our Wifi service
27 |
28 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Plasma Cloud/connect.php:
--------------------------------------------------------------------------------
1 |
42 |
--------------------------------------------------------------------------------
/TP Link Omada/RADIUS/index.php:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
23 | WiFi Portal
24 |
25 |
26 |
27 | Welcome!
28 | Please login to our Wifi service
29 |
30 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Unifi/README.md:
--------------------------------------------------------------------------------
1 | # Unifi External Captive Portal
2 |
3 | This is an example of a PHP based external captive portal for Unifi. The code given here can be used to setup a basic captive portal featuring an HTML login form. The code for authorizing the user is from Art of WiFi's excellent Unifi API client located here:
4 |
5 | https://github.com/Art-of-WiFi/UniFi-API-client
6 |
7 | To run this you need to install the Unifi API client. The can be done using Composer:
8 | ```
9 | composer require art-of-wifi/unifi-api-client
10 | ```
11 | Or include the following code in your composer.json file:
12 | ```
13 | {
14 | "require": {
15 | "art-of-wifi/unifi-api-client": "^1.1"
16 | }
17 | }
18 | ```
19 | This portal will authorize the user for 30 minutes on the Unifi controller and redirect them to Google. In connecting.php you need to enter the correct values for `$site_id`, `$controlleruser`, `$controllerpassword`, `$controllerurl` and `$controllerversion`.
20 |
21 | For an Android client the redirect parameters are as follows:
22 |
23 | ```
24 | Array ( [ap] => 44:d9:e7:0a:80:43 [id] => 70:8a:09:65:4d:ec [t] => 1601896413 [url] => http://connectivitycheck.platform.hicloud.com/generate_204_291a4662-e11c-4a24-aa5c-e16876b713f3 [ssid] => Unifi Zigsa )
25 | ```
26 |
--------------------------------------------------------------------------------
/Plasma Cloud/README.md:
--------------------------------------------------------------------------------
1 | # Plasma External Captive Portal
2 |
3 | This is an example of a PHP based external captive portal for Plasma Cloud. It has been tested with PA1200 AP. The code given here authorizes the user on the network. Any user engagement flow can be added to it based on one's requirements.
4 |
5 | The parameter `$uam_secret` needs to be updated in `connect.php` and has to match the UAM secret defined in Plasma Cloud.
6 |
7 | The username and password entered by the user is sent to the AP which then sends them to the configured RADIUS server for authentication.
8 |
9 | Here is Apache's access log:
10 |
11 | ```
12 | "GET /?res=notyet&uamip=10.255.0.1&uamport=8081&mac=9C-2E-A1-35-C0-D5&called=54-9C-27-07-9C-F0&ssid=guest&nasid=Office%20test%20&userurl=http%3A%2F%2Fconnect.rom.miui.com%2Fgenerate_204&challenge=5387D931F347D4915B7A4DDC9C0E30C65C3D4F7062366136C68A71E10C818405 HTTP/1.1"
13 | ```
14 |
15 | Plasma is based on Open Mesh and uses Coova Chilli for captive portal. The code given here is slightly modified from the Coova Chilli code available [here](https://github.com/splash-networks/capport/tree/master/Coova%20Chilli).
16 |
17 | Plasma's captive portal documentation is given [here](https://www.kaiwoo.ai/docs/captive-portal/) and redirection details are available [here](https://www.kaiwoo.ai/docs/splashpage-redirect/).
18 |
--------------------------------------------------------------------------------
/Draytek/README.md:
--------------------------------------------------------------------------------
1 | # Draytek External Captive Portal
2 |
3 | This portal has been tested on the following hardware:
4 |
5 | ```
6 | Device: Draytek Vigor2862
7 | Redirect Method: GET
8 | ```
9 |
10 | URL format and passed parameters when redirecting client to captive portal:-
11 | ```
12 | http:///login.php?apmac=&clientmac=&loginurl=&target=
13 | ```
14 | Redirecting client from captive portal to router (for authorization):-
15 | ```
16 | URL format: http://portal.draytek.com:8001/cgi-bin/wifilogin.cgi?username=&password=
17 | ```
18 | Example of Apache Access Log (on captive portal server):-
19 | ```
20 | apmac=00-1D-AA-09-44-10&client_mac=D8-8F-76-6D-A8-7B&loginurl=http://portal.draytek.com:8001/cgi-bin/wifilogin.cgi&target=http://captive.apple.com/hotspot-detect.html HTTP/1.0" 404 379 "-" "CaptiveNetworkSupport-355.270.2 wispr"
21 | ```
22 | Example of RADIUS Access-Request Packet (in FreeRADIUS debug):-
23 | ```
24 | User-Name = "draytek"
25 | User-Password = "draytek"
26 | Called-Station-Id = "00-1D-AA-09-44-10"
27 | Calling-Station-Id = "D8-8F-76-6D-A8-7B"
28 | NAS-IP-Address =
29 | Service-Type = Authenticate-Only
30 | ```
31 | Notes: portal.draytek.com is the address of the Draytek router
32 |
--------------------------------------------------------------------------------
/Plasma Cloud/index.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 | WiFi Portal
19 |
20 |
21 |
22 |
23 |
26 | Welcome!
27 | Please login to our Wifi service
28 |
29 |
34 |
35 | Sorry, failed to authenticate";
40 | } else if ($res === "logoff") {
41 | echo "Logging off...
";
42 | } else if ($res === "already") {
43 | header("Location: $redirect_url");
44 | } else {
45 | echo "Error: Permission Denied
";
46 | }
47 | ?>
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Aruba Instant On/README.md:
--------------------------------------------------------------------------------
1 | # Aruba Instant On External Captive Portal
2 |
3 | This is an example of a PHP based external captive portal for Aruba Instant On AP. The code given here can be used to setup a basic captive portal featuring an HTML form.
4 |
5 | Apache access log showing redirect parameters
6 |
7 | ```
8 | 50.3.71.170 - - [18/Aug/2021:11:11:32 +0000] "GET /?cmd=login&mac=f2%3A62%3Ae7%3A99%3A63%3Ac6&network=wifi.ten&ip=172.16.0.221&apmac=d0%3A15%3Aa6%3Ac2%3A74%3Ad0&site=wifi-ten%20Site&post=captive-2020.aio.cloudauth.net&url=http%3A%2F%2Fconnectivitycheck.gstatic.com%2Fgenerate_204 HTTP/1.1" 200 8455 "-" "Mozilla/5.0 (Linux; Android 11; SM-A515F Build/RP1A.200720.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.159 Mobile Safari/537.36"
9 | ```
10 |
11 | FreeRADIUS Access-Request
12 |
13 | ```
14 | (0) Received Access-Request Id 1 from 50.3.71.170:61185 to 167.99.74.17:1812 length 181
15 | (0) NAS-IP-Address = 192.168.8.179
16 | (0) NAS-Port = 0
17 | (0) NAS-Port-Type = Wireless-802.11
18 | (0) User-Name = "user1"
19 | (0) User-Password = "pass1"
20 | (0) Service-Type = Login-User
21 | (0) Calling-Station-Id = "f262e79963c6"
22 | (0) Called-Station-Id = "d015a6c274d0"
23 | (0) Framed-IP-Address = 172.16.0.221
24 | (0) Aruba-Essid-Name = "wifi.ten"
25 | (0) Aruba-Location-Id =
26 | (0) Aruba-AP-Group = "InstantOn-C2:74:D0"
27 | (0) Message-Authenticator = 0xdf504be2ae2fc5bf3d362cad0014b260
28 | ```
29 | Tested on Aruba Instant on AP 11.
30 |
--------------------------------------------------------------------------------
/Cradlepoint/connect.php:
--------------------------------------------------------------------------------
1 | 0) {
15 | $crypt_secret = md5($hexchall . $secret, TRUE);
16 | $len_secret = 16;
17 | } else {
18 | $crypt_secret = $hexchall;
19 | $len_secret = strlen($hexchall);
20 | }
21 |
22 | /* simulate C style \0 terminated string */
23 | $plain .= "\x00";
24 | $crypted = '';
25 | for ($i = 0; $i < strlen($plain); $i++)
26 | $crypted .= $plain[$i] ^ $crypt_secret[$i % $len_secret];
27 |
28 | $extra_bytes = 0;//rand(0, 16);
29 | for ($i = 0; $i < $extra_bytes; $i++)
30 | $crypted .= chr(rand(0, 255));
31 |
32 | return bin2hex($crypted);
33 | }
34 |
35 | $username = $_POST["username"];
36 | $password = $_POST["password"];
37 | $uamip = $_POST["uamip"];
38 | $uamport = $_POST["uamport"];
39 | $challenge = $_POST["challenge"];
40 |
41 | $encoded_password = encode_password($password, $challenge, $uam_secret);
42 |
43 | $redirect_url = "http://$uamip:$uamport/logon?" .
44 | "username=" . urlencode($username) .
45 | "&response=" . urlencode($encoded_password);
46 |
47 | header('Location: ' . $redirect_url);
48 |
49 | ?>
50 |
--------------------------------------------------------------------------------
/Coova Chilli/connect.php:
--------------------------------------------------------------------------------
1 | 0) {
15 | $crypt_secret = md5($hexchall . $secret, TRUE);
16 | $len_secret = 16;
17 | } else {
18 | $crypt_secret = $hexchall;
19 | $len_secret = strlen($hexchall);
20 | }
21 |
22 | /* simulate C style \0 terminated string */
23 | $plain .= "\x00";
24 | $crypted = '';
25 | for ($i = 0; $i < strlen($plain); $i++)
26 | $crypted .= $plain[$i] ^ $crypt_secret[$i % $len_secret];
27 |
28 | $extra_bytes = 0;//rand(0, 16);
29 | for ($i = 0; $i < $extra_bytes; $i++)
30 | $crypted .= chr(rand(0, 255));
31 |
32 | return bin2hex($crypted);
33 | }
34 |
35 | $username = $_POST["username"];
36 | $password = $_POST["password"];
37 | $uamip = $_POST["uamip"];
38 | $uamport = $_POST["uamport"];
39 | $challenge = $_POST["challenge"];
40 |
41 | $encoded_password = encode_password($password, $challenge, $uam_secret);
42 |
43 | $redirect_url = "http://$uamip:$uamport/logon?" .
44 | "username=" . urlencode($username) .
45 | "&password=" . urlencode($encoded_password);
46 |
47 | header('Location: ' . $redirect_url);
48 |
49 | ?>
50 |
--------------------------------------------------------------------------------
/Aruba iAP/README.md:
--------------------------------------------------------------------------------
1 | # Aruba iAP External Captive Portal using Authentication Text
2 |
3 | This is an example of a PHP based external captive portal for Aruba iAP. The code given here can be used to setup a basic captive portal featuring an HTML login form. Aruba iAPs use two types of authentication schemes for external captive portals:
4 |
5 | 1. Authentication Text
6 | 2. RADIUS
7 |
8 | Authentication text is the simplest scheme. In it nothing is POSTed back to the iAP. Instead, the iAP is configured with an "Authentication Text" - a string that the iAP looks out for in the body of the page loaded by the client. If the page contains that string the user is automatically authenticated. In this case we are using the string `Guest_authenticated` configured in `login.php`. The string is hidden so it doesn't affect user experience.
9 |
10 | It is configured on the iAP like this:
11 |
12 | 
13 |
14 | The files `index.php` and `login.php` are for auth text based login. The file `userlogin.html` is for username password based RADIUS login.
15 | It posts the entered username and password to `http://securelogin.arubanetworks.com` which resolves to the IP of the iAP.
16 |
17 | Apache access log:
18 |
19 | ```
20 | "GET /?cmd=login&mac=9c:2e:a1:35:c0:d5&essid=affinect&ip=172.31.98.220&apname=b4%3A5d%3A50%3Aca%3A81%3Aea&apmac=b4%3A5d%3A50%3Aca%3A81%3Aea&vcname=SetMeUp-CA%3A81%3AEA&switchip=securelogin.arubanetworks.com&url=http%3A%2F%2Fconnect.rom.miui.com%2Fgenerate_204 HTTP/1.1"
21 | ```
22 |
--------------------------------------------------------------------------------
/Cisco/README.md:
--------------------------------------------------------------------------------
1 | # Cisco WLC External Captive Portal
2 |
3 | This is an example of a PHP based external captive portal for Cisco WLC. The code given here can be used to setup a basic captive portal featuring an HTML login form. This code is based on the following repository (refer to its README for further details):
4 |
5 | https://github.com/stuartst/cisco-wlc-captive-portal
6 |
7 | Apache Access Log:
8 |
9 | ```
10 | 108.21.227.148 - - [25/Nov/2021:03:32:54 +0000] "GET /cisco-wlc-captive-portal/index.php?switch_url=http://wifi-guest.equinox.com/login.html&ap_mac=00:ea:bd:95:96:20&client_mac=f8:ff:c2:39:ca:71&wlan=Captive&redirect=captive.apple.com/hotspot-detect.html HTTP/1.1" 200 639 "http://captive.apple.com/hotspot-detect.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko)"
11 | ```
12 |
13 | FreeRADIUS Debug Log:
14 |
15 | ```
16 | (0) Received Access-Request Id 0 from 108.21.227.148:32769 to 10.250.201.61:1812 length 239
17 | (0) User-Name = "test123"
18 | (0) User-Password = "test123"
19 | (0) Service-Type = Login-User
20 | (0) NAS-IP-Address = 10.1.10.15
21 | (0) NAS-Port = 1
22 | (0) Cisco-AVPair = "audit-session-id=0a010a0f00000052619f0405"
23 | (0) Framed-IP-Address = 10.255.1.208
24 | (0) Acct-Session-Id = "619f0405/f8:ff:c2:39:ca:71/220"
25 | (0) NAS-Identifier = "wlc"
26 | (0) NAS-Port-Type = Wireless-802.11
27 | (0) Airespace-Wlan-Id = 4
28 | (0) Calling-Station-Id = "f8-ff-c2-39-ca-71"
29 | (0) Called-Station-Id = "00-fd-22-ca-9f-40:Captive"
30 | (0) Message-Authenticator = 0x58f2b7ae1e8a783c72131251c43d59d4
31 | ```
32 |
--------------------------------------------------------------------------------
/TP Link Omada/RADIUS/login.php:
--------------------------------------------------------------------------------
1 | $_SESSION["clientMac"],
11 | "clientIp" => $_SESSION["clientIp"],
12 | "apMac" => $_SESSION["apMac"],
13 | "gatewayMac" => $_SESSION["gatewayMac"],
14 | "ssidName" => $_SESSION["ssidName"],
15 | "vid" => $_SESSION["vid"],
16 | "radioId" => $_SESSION["radioId"],
17 | "originUrl" => $_SESSION["originUrl"],
18 | "authType" => $authType,
19 | "username" => $username,
20 | "password" => $password
21 | ];
22 |
23 | $curl = curl_init();
24 |
25 | curl_setopt_array($curl, array(
26 | CURLOPT_URL => $_SESSION["scheme"].'://'.$target.':'.$_SESSION["targetPort"].'/portal/radius/auth',
27 | CURLOPT_RETURNTRANSFER => true,
28 | CURLOPT_ENCODING => '',
29 | CURLOPT_MAXREDIRS => 10,
30 | CURLOPT_TIMEOUT => 0,
31 | CURLOPT_SSL_VERIFYPEER => false,
32 | CURLOPT_SSL_VERIFYHOST => false,
33 | CURLOPT_FOLLOWLOCATION => true,
34 | CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
35 | CURLOPT_CUSTOMREQUEST => 'POST',
36 | CURLOPT_POSTFIELDS => json_encode($postData),
37 | CURLOPT_HTTPHEADER => array(
38 | 'Content-Type: application/json'
39 | ),
40 | ));
41 |
42 | $response = curl_exec($curl);
43 |
44 | curl_close($curl);
45 |
46 | if ($response !== false) {
47 | $json = json_decode($response, true);
48 | if ($json['errorCode'] == 0) {
49 | echo "Success!";
50 | }
51 | }
52 | else {
53 | die("Error: check with your network administrator");
54 | }
55 |
56 | ?>
57 |
--------------------------------------------------------------------------------
/Coova Chilli/index.php:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 | WiFi Portal
10 |
11 |
12 |
13 |
14 |
19 | Welcome!
20 | Please login to our Wifi service
21 |
22 |
31 |
32 | ";
38 | echo '';
39 | echo "";
40 | }
41 | else {
42 | echo "Log-in successful!
";
43 | }
44 | }
45 | else if ($res === "failed") {
46 | echo "Whoops, failed to authenticate
";
47 | }
48 | else if ($res === "logoff") {
49 | echo "Logging off ...
";
50 | }
51 | else {
52 | echo "Oops!, bad 'res' parameter
";
53 | }
54 | ?>
55 |
56 |
57 |