One bash script: open fake AP + DHCP/DNS + NAT for lab traffic sniffing

For authorized Wi‑Fi security labs I wanted a minimal setup to stand up an **open rogue AP**

and capture what connected devices leak (DNS queries, DHCP hostnames, plain HTTP, TLS SNI, etc.)

without dragging in full Evil Twin frameworks.

This repo is a single bash script that:

- creates the AP interface and starts **hostapd** (open SSID, nl80211)

- runs **dnsmasq** (DHCP + DNS forwarding, query logging)

- enables **NAT** to an uplink so clients get real connectivity while you sniff on the AP iface

- prints **connected clients** live (MAC / lease info)

- **cleans up** on Ctrl+C (hostapd, dnsmasq, iptables, interface)

Requirements: Linux, root, WiFi card with AP mode (`iw phy`), hostapd + dnsmasq + iptables.

**Legal:** only on networks and devices you own or have written permission to test.

Repo (MIT): https://github.com/RiccardoCataldi/access-point

If you use a different workflow (airbase-ng, bettercap, etc.) I’m curious what you prefer for lab APs.

Posted Jun 3, 2026, 1:17 PM UTC

30
Loading comments…