The Hak5 WiFi Pineapple is one of the most iconic tools in a pentester's kit. It's also $200. I wanted to understand how it actually worked at every layer β hostapd, dnsmasq, iptables, captive portals β not just buy a black box and point it at networks. So I built my own.
The HardwareThe build runs on a Raspberry Pi 4 (1GB RAM) with an AR9271-based USB WiFi dongle as a second radio. The Pi's onboard BCM43455 chip handles the rogue AP, while the AR9271 dongle runs in monitor mode for passive scanning. An ethernet cable connects the Pi to my laptop, which shares internet to the Pi and doubles as the management channel for SSH and the dashboard. Both WiFi interfaces are completely free for auditing work.
One key research finding before building: the BCM43455 has a firmware crash bug in concurrent STA+AP mode on kernel 6.12 (Trixie). Staying on Bookworm was essential.
What It DoesPiNAPPLE broadcasts a rogue access point that target devices connect to. When they do, dnsmasq assigns them an IP and hijacks all DNS queries back to the Pi. A captive portal served by nginx intercepts all HTTP/HTTPS traffic and presents one of three portal variants β a credential capture page, a hotel-style login, or a simple splash page. All traffic can optionally be forwarded to the real internet via NAT so targets stay connected.
A custom Flask dashboard running on port 8080 ties everything together. It shows live connected clients, nearby WiFi networks from the AR9271 monitor scan, captured portal credentials, AP controls, and toggle switches for DNS hijacking, internet passthrough, and portal redirect. Everything runs as systemd services and auto-starts on boot.
What I LearnedBuilding this taught me more about WiFi security in one night than months of reading. Understanding why KARMA attacks work, how captive portals hijack browsers at the DNS level, and how iptables chains intercept and redirect traffic β none of that clicks until you build it yourself.
Intended UseHome lab testing, CTF competitions, and authorized pentesting practice only. The project includes clear documentation on ethical and legal use requirements.
GitHub: github.com/Doge128/PiNAPPLE





Comments