Pixiwps: Exploiting Weak WPS Implementations with the Pixie Dust Attack

pixiwps: A tool for exploiting weak WPS pins on routers using Pixie Dust attack

The first time I successfully ran a Pixie Dust attack against a test router with a vulnerable WPS chipset, I was genuinely surprised how fast it was — seconds instead of the hours a brute-force PIN attack would take. Pixiwps is the tool that makes this possible, and it’s a great example of how a single implementation flaw can undermine an entire security mechanism. Here’s my complete guide.

What Is Pixiwps?

Pixiwps is a small, focused C-based tool used to perform the Pixie Dust attack against WPS (Wi-Fi Protected Setup) enabled routers with weak random number generation. Rather than brute-forcing all possible WPS PIN combinations online (which can take hours and often gets locked out by the router), Pixiwps recovers the PIN offline by exploiting predictable or weak entropy in certain vulnerable WPS chipsets — most notably older Ralink, Realtek, and Broadcom implementations.

Architecture and Internal Working

WPS’s PIN exchange relies on a cryptographic handshake using values called E-Hash1, E-Hash2, E-Nonce, and PKR/PKE (public keys), which are exchanged between the access point and a client during registration. In a properly implemented WPS stack, the router’s secret nonce (E-S1/E-S2) used to compute these hashes should be generated with strong randomness, making brute-forcing the actual 8-digit PIN the only option.

The Pixie Dust attack, discovered by Dominique Bongard, exploits the fact that many router chipsets generate these nonces using weak or even fully predictable pseudo-random number generators — in some cases seeded with easily guessable values like the current timestamp.

Pixiwps works as follows:

  1. It’s fed the handshake values (E-Hash1, E-Hash2, E-Nonce, PKE, PKR, and the Authkey) which are typically captured using reaver or bully in “offline” mode.
  2. It then attempts to reconstruct the router’s secret nonce values based on known weaknesses in specific chipset PRNGs.
  3. Using the recovered nonce, it re-derives the actual WPS PIN entirely offline — no further packets need to be sent to the router.
  4. The recovered PIN is then used to retrieve the actual WPA/WPA2 passphrase through the standard WPS registration process.

This is why the attack is so much faster than brute-forcing: it’s not guessing the PIN, it’s mathematically deriving it from a flawed random number generator.

Installation

Pixiwps comes pre-installed on Kali Linux, usually alongside reaver. To build from source:

git clone https://github.com/wiire-a/pixiewps.git
cd pixiewps/src
make
sudo make install

Verify installation:

pixiewps --version

Basic Syntax

pixiewps [options]

Practical Command Examples (Your Own Router / Authorized Lab Only)

1. Capturing the required handshake data with reaver first:

sudo reaver -i wlan0mon -b <BSSID> -c <channel> -vv -K 1

This runs reaver in Pixie Dust mode (-K 1), which automatically calls Pixiwps internally once it captures the needed values. Sample output:

[+] WPS PIN: '12345670'
[+] WPA PSK: 'MyHomeNetworkPassword'
[+] AP SSID: 'HomeLab_5G'

2. Running Pixiwps manually with captured values (if you extracted them yourself via Wireshark/airodump-ng):

pixiewps -e <PKE> -r <PKR> -s <E-Hash1> -z <E-Hash2> -a <Authkey> -n <E-Nonce>

Sample output on success:

[+] WPS pin: 12345670

3. Specifying a known vulnerable chipset mode for faster computation:

pixiewps -e <PKE> -r <PKR> -s <E-Hash1> -z <E-Hash2> -a <Authkey> -n <E-Nonce> -m <manufacturer-mode>

4. Using verbose mode for troubleshooting:

pixiewps -e <PKE> -r <PKR> -s <E-Hash1> -z <E-Hash2> -a <Authkey> -n <E-Nonce> -v 3

Key Options

FlagPurpose
-eEnrollee public key (PKE)
-rRegistrar public key (PKR)
-sE-Hash1 value
-zE-Hash2 value
-aAuthkey value
-nE-Nonce value
-mForce a specific chipset/manufacturer mode
-vVerbosity level for debugging
--forceForce computation even without full checksum validation

Real-World Use Cases

Integration with Other Tools

Performance Optimization

Troubleshooting

Best Practices

Common Mistakes

  1. Assuming every WPS-enabled router is vulnerable — Pixie Dust only works against specific PRNG weaknesses in certain chipsets.
  2. Running reaver/Pixiwps against networks without authorization — this is illegal in most jurisdictions.
  3. Not disabling WPS after confirming vulnerability on your own equipment, leaving the weakness exposed.
  4. Manually mistyping long hex values (PKE, PKR, hashes) when running Pixiwps standalone instead of letting reaver automate the handoff.

FAQ

Does Pixiwps work on every router? No — it only succeeds against access points using specific, known-weak WPS chipset implementations. Modern routers with properly seeded random number generators are not vulnerable to this attack.

Is Pixie Dust the same as WPS PIN brute-forcing? No — brute-forcing tries all ~11,000 possible PIN combinations online (slow, often rate-limited). Pixie Dust mathematically derives the PIN offline in seconds by exploiting weak randomness, once the handshake is captured.

Can Pixiwps recover a WPA2 passphrase directly? Not directly — it recovers the WPS PIN. That PIN is then used through the standard WPS registration protocol (typically via reaver) to retrieve the actual WPA/WPA2 passphrase.

How do I protect my own router from this attack? Disable WPS entirely in your router’s settings. If disabling isn’t possible, update your router’s firmware, as many vendors patched their PRNG implementations after Pixie Dust was disclosed.

Lab Example

  1. Use an older router model known to have a vulnerable WPS chipset (many early Ralink/Realtek-based consumer routers) as your own isolated test device.
  2. Enable WPS on the test router.
  3. From a Kali machine with a monitor-mode-capable adapter, run: sudo reaver -i wlan0mon -b <BSSID> -c <channel> -vv -K 1
  4. Observe reaver capturing the handshake and automatically invoking Pixiwps to recover the PIN and WPA passphrase.
  5. Disable WPS on the test router afterward and repeat the test to confirm the attack no longer succeeds.

Summary

Pixiwps is a focused, highly effective tool for demonstrating just how damaging a weak random number generator can be to an otherwise cryptographically sound protocol. By exploiting predictable nonce generation in vulnerable WPS chipsets, it turns what should be a brute-force-resistant PIN exchange into a near-instant offline calculation. For defenders, the takeaway is simple: disable WPS unless you specifically need it, and keep router firmware updated.

References

Exit mobile version