Captive Portal Defenses - Spotting fake login pages

Captive Portal Defenses

What Is a Captive Portal?

Every time you connect to WiFi at a coffee shop, airport, or hotel, you probably see a login page pop up in your browser. That page is called a captive portal. It intercepts your HTTP traffic and redirects you to a local web page where you accept terms, enter a room number, or pay for access.

Captive portals serve a legitimate purpose. They let network operators control who gets internet access and for how long. The problem is that the mechanism behind them - DNS interception and HTTP redirect - is identical to the mechanism an attacker uses to phish your credentials on a fake network.

If you cannot tell the difference between a legitimate portal and a malicious one, you are vulnerable. And most people cannot tell the difference.

How Fake Captive Portals Work

A malicious captive portal starts with a rogue access point. The attacker sets up a WiFi network - often with a convincing name like "Hilton_Guest" or "Starbucks_WiFi" - and runs a web server locally on the device. When a victim connects, the rogue AP's DNS server resolves all domain lookups to the attacker's local IP address. The victim's browser, trying to load any website, gets redirected to a phishing page instead.

The phishing page can look like anything. Common designs mimic Google's login page, a hotel WiFi portal, or a social media login. The attacker's goal is simple: get you to type credentials into a page you trust.

graph TD
    subgraph "Victim Device"
        A[User opens browser] --> B[DNS query for any domain]
    end
    subgraph "Rogue Access Point"
        B --> C[Rogue DNS server]
        C --> D[Resolves ALL domains to attacker IP]
        D --> E[Local web server]
    end
    subgraph "Phishing Flow"
        E --> F[Serves fake login page]
        F --> G[User enters credentials]
        G --> H[Attacker captures credentials]
        H --> I[Redirects to real internet]
    end

How a malicious captive portal intercepts traffic - DNS hijacking redirects all requests to a local phishing page

The redirect to real internet access after credential capture is a key detail. The victim gets online, assumes the login worked, and never realizes their credentials were stolen. By the time the damage surfaces - unauthorized account access, password reset emails, fraudulent charges - the attacker is long gone.

Red Flags to Watch For

Fake captive portals leave clues. Knowing what to look for makes you significantly harder to fool.

HTTP-only login page. Legitimate captive portals from major providers increasingly use HTTPS with valid certificates. If the login page shows no padlock icon and the URL bar says "http://" or "Not Secure," treat it with extreme suspicion. No reputable hotel chain or airport operator should be serving login pages over unencrypted HTTP in 2025.

Certificate mismatch warnings. If your browser throws a certificate error on a portal page, stop immediately. This means the page is presenting a certificate that does not match the domain it claims to be. Legitimate portals do not trigger certificate warnings because they serve pages from their own domain with a matching certificate - or they use a plain HTTP splash page that the browser does not attempt to validate as HTTPS.

Requests for unrelated credentials. A WiFi login page should ask for a WiFi-specific credential: a room number, an access code, an email for terms acceptance. If a captive portal asks for your Google password, your Facebook login, or your email password, it is a phishing page. No WiFi network needs your social media credentials to grant internet access.

Unusual URL in the address bar. Check the URL. A real Hilton portal might show something like "hilton-portal.com" or an IP address on the local network (192.168.x.x). A fake one might show a random domain, a misspelled brand name, or a suspicious IP address.

graph LR
    subgraph "Legitimate Portal Signs"
        A[HTTPS with valid cert] --> B[Asks for room/access code]
        B --> C[URL matches provider]
        C --> D[No credential requests]
    end
    subgraph "Fake Portal Red Flags"
        E[HTTP only - no padlock] --> F[Asks for email/social login]
        F --> G[Certificate warnings]
        G --> H[Misspelled or random URL]
    end
    A -.->|Compare| E

Comparing legitimate and fake captive portal indicators - check the URL, certificate, and what credentials the page requests

How Your Browser Detects Captive Portals

Modern operating systems have built-in captive portal detection. Each works slightly differently, but the core concept is the same: the OS periodically sends an HTTP request to a known URL and checks the response. If the response is not what it expects, it assumes a captive portal is present and opens a restricted browser window.

Apple (CNA - Captive Network Assistant). Apple devices send a request to captive.apple.com/hotspot-detect.html. The expected response is a specific HTML page. If the response differs - because a captive portal redirected it - macOS or iOS opens a mini-browser window (the CNA sheet) showing the portal page. This mini-browser is intentionally limited: it has no address bar, no extensions, and restricted JavaScript. That limitation is both a security feature and a usability constraint.

Android. Android sends a request to connectivitycheck.gstatic.com/generate_204. It expects an HTTP 204 (No Content) response. If it gets a redirect instead, Android shows a notification prompting the user to sign in. Tapping it opens the portal in a restricted browser context.

Windows (NCSI - Network Connectivity Status Indicator). Windows probes www.msftconnecttest.com/connecttest.txt. The expected response is the text "Microsoft Connect Test." If the response differs, Windows displays a notification that the network requires action.

These detection mechanisms help, but they are not foolproof. A sophisticated attacker can allow the connectivity check URLs to pass through to the real internet (whitelisting Apple, Google, and Microsoft domains) while still intercepting all other traffic. This bypasses portal detection entirely - the OS thinks it has normal internet access while the attacker is selectively intercepting specific domains.

HTTPS Enforcement as Primary Defense

HTTPS is the single most effective defense against malicious captive portals. When you navigate to a website over HTTPS, the browser verifies the server's certificate against a trusted certificate authority. If an attacker tries to intercept the connection and serve a fake page, they cannot present a valid certificate for the domain. The browser throws an error and refuses to load the page.

This is why modern browsers default to HTTPS for all navigation. Chrome, Firefox, Safari, and Edge all attempt HTTPS connections first. If the server does not support HTTPS, the browser falls back to HTTP - but most major sites now require HTTPS.

graph TD
    subgraph "HTTPS Protection Flow"
        A[Browser requests https://bank.com] --> B{Certificate valid?}
        B -->|Yes - matches domain| C[Secure connection established]
        B -->|No - attacker intercept| D[Certificate mismatch error]
        D --> E[Browser blocks the page]
        E --> F[User sees warning - connection not private]
    end
    subgraph "HTTP Vulnerability"
        G[Browser requests http://site.com] --> H[No certificate check]
        H --> I[Attacker serves fake page]
        I --> J[User sees convincing phishing page]
        J --> K[No browser warning at all]
    end

HTTPS vs HTTP on a hostile network - certificate validation blocks fake pages, while HTTP offers no protection

The practical takeaway: if you are on an untrusted network and a website loads without HTTPS, do not enter any information into it. If you see a certificate warning, do not click through it. The browser is telling you that someone may be intercepting your connection.

HSTS (HTTP Strict Transport Security) adds another layer. Websites that use HSTS tell your browser to always use HTTPS for their domain, even if someone tries to redirect you to an HTTP version. Major banks, email providers, and social media platforms all use HSTS. If you have visited these sites before on a safe network, your browser remembers the HSTS policy and will refuse HTTP connections to those domains even on a hostile network.

VPN Before Browsing

A VPN encrypts all traffic between your device and the VPN server. On a hostile network, this means the attacker can see that you are connected and that you are sending encrypted data, but they cannot read the content, redirect your DNS queries, or inject fake pages into your browsing session.

The critical detail is timing. You need to establish the VPN connection before you start browsing. If you browse first and then connect to the VPN, you have already exposed your initial DNS queries and HTTP requests to the network operator. On a malicious network, those first few seconds of unencrypted traffic are enough to capture credentials from any HTTP form submission or redirect you to a phishing page.

Some VPN clients support "always-on" mode, which establishes the VPN connection automatically when the device connects to any network. This eliminates the timing gap. If your VPN supports this feature, enable it - especially on mobile devices that auto-connect to known SSIDs.

One complication: VPN connections often fail behind captive portals because the portal intercepts the VPN handshake. The workaround is to complete the captive portal authentication first (carefully, without entering sensitive credentials), then enable the VPN for all subsequent browsing.

What the Evil Portal Demonstrates

The BLEShark Nano includes an evil portal feature specifically designed to demonstrate this attack surface in a controlled setting. It creates a WiFi network with a captive portal that mimics common login pages. The purpose is educational: it shows how trivially easy it is to build a convincing phishing portal and how most users interact with it without suspicion.

In security training environments, running an evil portal exercise is one of the most effective ways to teach employees about WiFi phishing. Abstract warnings about "fake WiFi networks" do not stick. Watching someone demonstrate - in real time - how a fake Google login page captures your typed password makes the threat concrete and memorable.

The BLEShark Nano makes this kind of demonstration portable and self-contained. No laptop, no complex software stack, no dedicated infrastructure. A device smaller than a credit card can host a complete phishing portal. That portability is exactly what makes this attack vector dangerous in the real world - and exactly why understanding it matters.

Practical Steps to Stay Safe

Defending against malicious captive portals does not require exotic tools or deep technical knowledge. A few habits make a significant difference.

Verify the network name. Before connecting to public WiFi, ask the staff for the exact network name. Do not assume that "CoffeeShop_Free" is legitimate just because you are in a coffee shop. Attackers deliberately choose plausible names.

Watch for HTTPS. After connecting, confirm that HTTPS is working by navigating to a known site (your bank, Google, anything with HSTS). If you get certificate errors, disconnect immediately.

Never enter sensitive credentials on a captive portal page. If a portal asks for your email password, social media login, or any credential unrelated to WiFi access, close the browser and disconnect from the network.

Use a VPN. Connect to your VPN as soon as you have internet access. If the portal blocks VPN traffic, consider whether you really need to use that network.

Forget the network after use. Remove public WiFi networks from your saved networks list. This prevents your device from auto-connecting to a rogue AP using the same SSID in the future.

Use cellular when possible. If you have a mobile data plan, tethering your laptop to your phone is almost always more secure than using public WiFi. The cellular connection is encrypted between your device and the tower, and you are not sharing a local network with strangers.

Captive portals are a fundamental part of how public WiFi works. That same mechanism is trivially easy to abuse. The gap between a legitimate portal and a malicious one is paper-thin, and the defenses - HTTPS, VPN, awareness - are your responsibility, not the network's.

Get the BLEShark Nano - $36.99+
Back to blog

Leave a comment