Captive Portals: How WiFi Authentication Works
A technical examination of captive portal WiFi authentication including how portals work, common implementations, security weaknesses, bypass techniques, and secure deployment practices.
The Gateway Architecture for Public WiFi
A captive portal is a network access control mechanism that intercepts HTTP traffic and redirects it to a web page until the user authenticates, accepts terms, or completes payment. As a key architectural component of public WiFi deployments, captive portals balance accessibility with access control. They are ubiquitous in hotels, airports, coffee shops, and universities.
Prerequisites
How Captive Portals Work
Connection Flow
Technical Mechanisms
# IPtables rules for portal redirection
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -m mac --mac-source AA:BB:CC:DD:EE:FF -j RETURN
Detection
Modern OSes detect captive portals automatically:
# Manual detection
curl -I http://www.gstatic.com/generate_204 | head -n 1
# If redirected (301, 302, 307), captive portal is active
Security Weaknesses
Unencrypted Traffic
Open WiFi with a captive portal provides no transport encryption. All traffic is visible to anyone in range.
MAC Address Bypass
ip link set wlan0 down
ip link set wlan0 address AA:BB:CC:DD:EE:FF
ip link set wlan0 up
Portal Bypass Techniques
DNS Tunneling: If DNS is unrestricted, tunneling provides unauthenticated access.
VPN over Unauthenticated Access: If outbound HTTPS or VPN ports are allowed, a VPN can be established before portal auth.
HTTP CONNECT Proxy: SSH tunneling over HTTP CONNECT may bypass restrictions.
Rogue Captive Portal
Attackers deploy fake portals mimicking the legitimate one to steal credentials:
# Fluxion automates rogue portal deployment
git clone https://github.com/FluxionNetwork/fluxion.git
cd fluxion && ./fluxion.sh
Common Mistakes
Best Practices
Related Tools
Related Articles
Summary
Captive portals provide access control for public WiFi but introduce significant weaknesses including unencrypted traffic, MAC bypass, and credential harvesting. Organizations should use WPA2/3-Enterprise with encrypted portals and VPN requirements for guest networks.