Courses3 levels
Level 1 · Foundations11 courses
Level 2 · Core5 courses
Level 3 · Advanced5 courses
Labs8 topics
Library Practice exams AI Range Pricing Start free

Practice library / Wireless attacks

Lab · Medium · 1.5 hoursFree account

Bypassing Wi-Fi Captive Portals

MAC spoofing, DNS tunnelling, and other captive portal evasion techniques.

  • wi-fi
  • captive-portal
  • mac-spoofing
  • dns-tunneling
On this page 8 sections
  1. ·Build the target
  2. 1Map the portal enforcement
  3. 2Find an authenticated client's MAC
  4. Locked: Bypass with MAC spoofing
  5. Locked: Tunnel through DNS
  6. Locked: Test ICMP tunnelling
  7. Locked: Defence and Detection
  8. Locked: Check Your Work

Before you start

A captive portal is the login page that public Wi-Fi networks show before they let a client reach the internet. Attackers bypass these portals by cloning an authenticated client's MAC address or by tunnelling IP traffic inside DNS and ICMP packets the firewall still allows. Hotel, airport, and corporate guest networks are commonly vulnerable to these techniques. The lab tests three bypass methods and shows which portal design choices stop each one.

What You'll Learn

  • Map how a captive portal enforces network access at each layer
  • Identify an authenticated client and clone its MAC address to bypass the portal
  • Tunnel traffic through DNS when only port 53 is open before authentication
  • Test ICMP tunnelling as a second exfiltration path
  • Assess the strength of a captive portal implementation
  • Recommend controls that make each bypass technique fail

Build the target

KaliRange hosts no targets, no virtual machines and no wireless range. Build and run this captive portal on your own equipment. The SSID, addresses and passwords below are the example values of this lab; replace them with your own.

Your own lab needs

  • An access point you set up and own, broadcasting an open Wi-Fi network with a captive portal. The SSID KaliRange-Guest used in the commands below is the name you give your own access point, not a network that KaliRange provides.
  • A portal firewall that lets DNS (port 53) and ICMP through before login, and blocks HTTP/HTTPS until a client accepts the portal page.
  • A DNS server you control on your lab network (10.0.0.1) running iodined.
  • One lab client (your own phone or VM) already authenticated through the portal. This is the MAC you will clone.

Machine and tools

  • Kali Linux 2025.x attacker VM or host.
  • A wireless adapter in managed mode (monitor mode is not needed for most steps).
  • macchanger 1.7.0.
  • iodine 0.7.0 (DNS tunnel client and server).
  • icmptunnel or hans (ICMP tunnel).
  • nmap and curl for connectivity tests.

Build the access point and portal from free, legal parts: a Linux host running hostapd for the Wi-Fi radio, dnsmasq for DHCP and DNS, and a captive-portal daemon such as nodogsplash for the login redirect and firewall rules, on your own router or a spare machine with a Wi-Fi card. Isolate it from the internet. Take a snapshot of each virtual machine (or note the container state) before Step 1.

Authorised scope only. Run every command only against your own access point and your own lab client. Never on production or a network you do not own.

Step 1: Map the portal enforcement

1

Before you bypass a portal, understand what it blocks and what it allows. Most portals use firewall rules keyed on the client's MAC or IP. Some leave DNS (port 53) open so the portal redirect works.

Connect to the open network and check what you can reach before authenticating.

sudo iwconfig wlan0 essid "KaliRange-Guest"
sudo dhclient wlan0
ip addr show wlan0
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
    inet 10.0.0.102/24 brd 10.0.0.255 scope global dynamic wlan0

You have an IP. Test outbound connectivity.

curl -sI http://example.com
nmap -sU -p 53 10.0.0.1
nmap -p 80,443 10.0.0.1
HTTP/1.1 302 Found
Location: http://10.0.0.1/portal/login.html

PORT   STATE SERVICE
53/udp open  domain

PORT    STATE    SERVICE
80/tcp  open     http
443/tcp filtered https

The HTTP request is redirected to the portal. DNS on port 53 is open. HTTPS is filtered. This is the common pattern: the firewall allows DNS so the redirect can work, but blocks everything else until the client authenticates.

Step 2: Find an authenticated client's MAC

2

The portal tracks which MACs have authenticated. If you use the MAC of an already-authenticated client, the firewall lets your traffic through. First find that MAC.

Put your adapter into monitor mode briefly to see associated clients.

sudo airmon-ng check kill
sudo airmon-ng start wlan0
sudo airodump-ng -c 1 --bssid AA:BB:CC:DD:EE:03 wlan0mon
 BSSID              STATION            PWR   Rate   Lost  Frames  Notes  Probes

 AA:BB:CC:DD:EE:03  11:22:33:44:55:AA  -28   54e-54      0    310
 AA:BB:CC:DD:EE:03  11:22:33:44:55:BB  -45   54e-54      0     42

Station 11:22:33:44:55:AA has a strong signal and many frames. It is likely authenticated. Note this MAC and stop monitor mode.

sudo airmon-ng stop wlan0mon
sudo systemctl start NetworkManager

Sign in to continue

5 more sections are for signed-in members. It is free: sign in with Google.

Related