Advanced WiFi Attacks using Commodity Hardware

Mathy Vanhoef (Postdoctoral Researcher · KU Leuven)

BruCON 0x0A · Day 1

Overview

In this compelling talk at BruCON, Mathy Vanhoef, a postdoctoral researcher at KU Leuven, demonstrates how sophisticated, low-layer Wi-Fi attacks, previously thought to require expensive specialized hardware, can be executed using readily available and inexpensive commodity Wi-Fi devices. The presentation delves into the mechanisms behind these advanced attacks, including selfish behavior, continuous jamming, and selective jamming, showcasing their surprising effectiveness. A significant portion of the talk is dedicated to explaining how these low-layer manipulations can be leveraged to facilitate more complex attacks against higher-layer Wi-Fi protocols, notably the Key Reinstallation Attack (KRACK) against WPA2.

Watch on YouTube

Visual summary for Advanced WiFi Attacks using Commodity Hardware by Mathy Vanhoef
Visual summary for Advanced WiFi Attacks using Commodity Hardware by Mathy Vanhoef

Key moments

  1. 0:00 Introduction: Advanced Wi-Fi attacks with commodity hardware
  2. 4:00 Cheap USB dongles enable advanced selfish and jamming attacks
  3. 8:30 Implementing selfish Wi-Fi behavior by modifying firmware
  4. 19:00 Continuous jammer: queuing infinite packets with circular list
  5. 25:00 Real-world impact: jamming baby monitors, cars, security systems
  6. 30:00 Technical details of the selective jammer implementation
  7. 40:00 How low-layer attacks facilitate the KRACK WPA2 attack
  8. 50:00 Nonce reuse enables WPA2 decryption in KRACK attack

Advanced WiFi Attacks using Commodity Hardware

Speakers: Mathy Vanhoef, Postdoctoral Researcher, KU Leuven

Conference: BruCON

YouTube: https://www.youtube.com/watch?v=L-ohPuPBle4

Overview

In this compelling talk at BruCON, Mathy Vanhoef, a postdoctoral researcher at KU Leuven, demonstrates how sophisticated, low-layer Wi-Fi attacks, previously thought to require expensive specialized hardware, can be executed using readily available and inexpensive commodity Wi-Fi devices. The presentation delves into the mechanisms behind these advanced attacks, including selfish behavior, continuous jamming, and selective jamming, showcasing their surprising effectiveness. A significant portion of the talk is dedicated to explaining how these low-layer manipulations can be leveraged to facilitate more complex attacks against higher-layer Wi-Fi protocols, notably the Key Reinstallation Attack (KRACK) against WPA2.

Vanhoef's research fundamentally challenges the long-held assumption that robust Wi-Fi jamming or manipulation necessitates high-cost equipment. By revealing the capabilities of cheap USB Wi-Fi dongles – costing as little as $10-$20 – to perform these disruptive actions, the talk highlights a critical security blind spot. The implications extend beyond traditional network disruption, impacting a wide array of devices from security cameras and baby monitors to car key fobs and industrial control systems, all of which often share the same frequency bands as Wi-Fi.

The core message underscores the urgent need for defenders to recognize and adapt to this evolving threat landscape. The ability for an attacker to reliably manipulate encrypted traffic and undermine Wi-Fi security protocols with minimal investment necessitates a re-evaluation of current detection and mitigation strategies. This article provides a comprehensive technical deep dive into Vanhoef's findings, exploring the methodologies, practical demonstrations, and critical defensive implications of these advanced commodity hardware-based Wi-Fi attacks.

Background

▶ Watch: Introduction: Advanced Wi-Fi attacks with commodity hardware (0:00)

The foundational assumption in Wi-Fi network operation is that all devices adhere to a fair behavior protocol. This means that before transmitting, a Wi-Fi client listens to the air to detect ongoing transmissions. If the channel is busy, it waits for the current transmission to complete, followed by specific time intervals: the Short InterFrame Space (SIFS), the Arbitration InterFrame Space Number (AIFSN), and a random backoff interval. SIFS allows receivers to process frames, AIFSN prioritizes traffic (e.g., voice over data), and the backoff interval prevents collisions when multiple stations want to transmit. This cooperative mechanism ensures fair bandwidth distribution and minimizes data collisions.

However, attackers have long sought to subvert these rules. Traditionally, advanced low-layer Wi-Fi attacks, such as selective jamming, were believed to necessitate highly specialized and expensive hardware. For instance, Software Defined Radios (SDRs) like USRPs, costing around $3,000 to $4,000, were considered essential for tasks like decoding a Wi-Fi packet header mid-transmission and then jamming its remaining contents. The high barrier to entry in terms of equipment cost meant that these sophisticated attacks were not widely perceived as a serious, widespread threat.

The problem, as highlighted by Vanhoef, was a gap in understanding: while the theoretical possibility of such attacks was known, the practical accessibility using commodity hardware was largely unexplored. This talk directly addresses this gap, demonstrating that the cost barrier for executing advanced Wi-Fi manipulation and jamming attacks has effectively been removed, significantly increasing the potential threat surface for Wi-Fi networks and related technologies.

Key Findings

▶ Watch: Implementing selfish Wi-Fi behavior by modifying firmware (8:30)

Mathy Vanhoef's research unveils several critical findings that redefine the landscape of Wi-Fi security:

  • Commodity Hardware for Advanced Attacks: The most significant finding is that expensive, specialized equipment is not required for advanced Wi-Fi attacks. Instead, cheap USB Wi-Fi dongles, costing as little as $10 or $20, can be repurposed to perform sophisticated low-layer manipulations.
  • Selfish Behavior: Attackers can modify the firmware of these cheap devices to disable fair access mechanisms like the backoff interval and set the AIFSN to zero. This allows an attacker to transmit almost instantly after another device, significantly increasing their uplink throughput. In lab setups, this strategy boosted throughput from 14 Megabits per second (Mbps) to 37 Mbps.
  • Continuous Jamming: The talk demonstrates the ability to create a highly effective continuous jammer using commodity hardware. This jammer operates by disabling carrier sense and queuing an "infinite" stream of dummy Wi-Fi packets using a circular linked list in memory. This effectively silences all other Wi-Fi devices within range, as they perceive the channel as constantly busy. This jamming capability can extend up to 80 meters in clear line of sight, and 120 meters with a cheap amplifier.
  • Selective Jamming: Perhaps the most surprising finding is the implementation of a selective jammer on commodity hardware. This advanced technique allows an attacker to decode the header of a Wi-Fi frame while it is still being transmitted, identify specific target packets (e.g., based on MAC addresses), and then jam only the remaining portion of that specific packet. This causes the target packet to be dropped due to a corrupted Cyclic Redundancy Check (CRC).
  • Facilitation of Higher-Layer Attacks: These low-layer jamming and manipulation techniques are not just disruptive on their own; they can reliably facilitate more complex, higher-layer attacks. Specifically, Vanhoef shows how they can be used to make the Key Reinstallation Attack (KRACK) against WPA2 significantly easier to execute by enabling precise manipulation and blocking of handshake messages, leading to nonce reuse.
  • Mobile Phone Jamming: Recent research updates, building on Vanhoef's work, indicate that similar jamming techniques can now be implemented on mobile phones (e.g., Nexus 5) using projects like Nexmon, further lowering the barrier to entry for these attacks.
  • Widespread Impact: The attacks are not limited to Wi-Fi. They can disrupt any device operating on the same 2.4 GHz or 5 GHz frequency bands, including Bluetooth, ZigBee (used in home automation, IoT), and potentially even some industrial control systems, security cameras, and car key fobs.

Technical Deep Dive

▶ Watch: Real-world impact: jamming baby monitors, cars, security systems (25:00)

The technical ingenuity of these attacks lies in exploiting low-level hardware capabilities of commodity Wi-Fi devices.

Selfish Behavior

The foundation of selfish behavior involves manipulating the Distributed Coordination Function (DCF), the core access method for Wi-Fi. Normally, a device waits for the channel to be idle for a SIFS interval, then an AIFSN interval (which depends on traffic priority), and finally a random backoff interval to avoid collisions. The attack modifies these parameters:

  1. Disabling Backoff: This is achieved by modifying specific memory-mapped registers within the Wi-Fi dongle's firmware. The firmware, often open-source, allows for direct manipulation of these hardware registers.
  2. Setting AIFSN to Zero: Similar to disabling backoff, the AIFSN interval can be set to zero via firmware modification, allowing the device to skip the priority-based waiting period.

Experiments showed that disabling backoff and setting AIFSN to zero provided the optimal strategy, increasing uplink throughput from 14 Mbps to 37 Mbps. Interestingly, reducing the SIFS interval, though seemingly beneficial for speed, actually led to lower throughput. This is because SIFS is crucial for receivers to properly demodulate and copy frames to memory. A reduced SIFS interval results in receivers not being ready for the next packet, leading to significant packet loss. It's important to note that this attack primarily affects the uplink (client to access point) direction because the attacker typically does not control the access point.

The ability to modify these low-level parameters stems from the architecture of the Wi-Fi dongles. They typically comprise two chips: a radio chip (handling physical signal processing) and a CPU (for USB communication and overall control). To manipulate parameters like backoff or AIFSN, the code needs to run on the dongle's CPU itself, requiring firmware modification, rather than just driver-level changes on the host computer.

A peculiar side effect of multiple selfish stations competing is the capture effect. When two selfish stations transmit simultaneously, the receiver often decodes the packet with the stronger signal quality and lower bitrate. This leads to a "cat-and-mouse" game where competing selfish stations continually lower their bitrates to increase their signal robustness and "win" the collision, effectively treating the other station's transmission as background noise.

Continuous Jammer

Implementing a continuous jammer requires two main capabilities:

  1. Disabling Carrier Sense: The attacker's device must transmit regardless of whether the channel is busy. This is achieved by disabling the carrier sense mechanism through firmware modification and register manipulation.
  2. Continuous Packet Transmission: To ensure constant channel occupancy, the device needs to transmit an uninterrupted stream of packets. Given the limited memory on cheap Wi-Fi dongles, simply queuing an infinite number of packets is not feasible. The elegant solution involves turning the linked list of frames awaiting transmission into a circular linked list. This allows the radio chip to continuously transmit the same small set of dummy packets without interruption, using minimal memory.

The effect of this continuous transmission is not just collision; it actively silences other devices. Because legitimate Wi-Fi devices still operate fairly, they detect the constant "transmission" (even if undecodable due to high speed) and wait for it to finish, effectively ceasing their own transmissions. Experiments showed this jammer could silence devices over a range of 80 meters (clear line of sight), extending to 120 meters with a cheap amplifier. While the jammer transmits valid Wi-Fi packets (albeit with dummy content), their rapid succession prevents other Wi-Fi devices in monitor mode from successfully decoding them, making the channel appear completely unusable.

Selective Jammer

The selective jammer is the most technically complex, requiring precise timing and hardware interaction:

  1. Detecting Transmission and Decoding Header: The primary challenge is to decode the initial part of a Wi-Fi frame (the header, containing MAC addresses) while the rest of the frame is still being transmitted over the air. This is possible because the radio chip uses Direct Memory Access (DMA) to write decoded bytes directly into the dongle's memory. The CPU on the dongle can continuously poll specific memory locations. Once it detects changes from pre-initialized values, it knows the radio chip is actively receiving and writing a frame.
  2. Real-time Header Analysis: A while loop on the CPU monitors this memory. As soon as enough bytes constituting the MAC header are written, the CPU can inspect them (e.g., to check if it's a beacon frame or a probe request, and to read source/destination MAC addresses).
  3. Aborting Reception: If the header matches the attacker's criteria for jamming, the CPU immediately aborts the ongoing reception. This is done by setting a specific bit in a memory register, often named RX abort (receive abort).
  4. Switching to Transmit Mode and Injecting Noise: After aborting reception, the antenna quickly switches from receive to transmit mode. The CPU then instructs the radio chip to transmit a dummy packet. This is achieved by providing the radio chip with a pointer to the dummy packet in memory and then setting a TX enable (transmit enable) bit in another register. This injected packet corrupts the remaining bytes of the original target frame, specifically the CRC checksum. Any Wi-Fi receiver, upon encountering a corrupted CRC, will drop the entire packet, effectively achieving a selective jam.

The reaction time of this selective jammer is critical. For 2.4 GHz beacons sent at 1 Mbps, jamming could reliably start at position 52 of the frame. For faster 5 GHz transmissions, jamming started at position 88. While effective for medium to small packets, very small packets might be fully transmitted before the jammer can react. The reliability is not 100%, as environmental noise can sometimes prevent the jammer from even detecting a transmission.

Facilitating the KRACK Attack

The selective jammer's ability to precisely block or delay specific messages is crucial for the KRACK attack against WPA2. KRACK exploits a vulnerability in the 4-way handshake, which negotiates a Pairwise Transient Key (PTK) (session key) and initializes a nonce (packet number) to zero.

  1. Channel-Based Man-in-the-Middle (MITM): First, the attacker establishes a channel-based MITM. If the legitimate AP is on channel 6, the attacker clones the network on channel 1. The continuous jammer is then used to jam channel 6, forcing the victim client to connect to the attacker's cloned network on channel 1. Once connected, the jammer is stopped, and the attacker forwards traffic between the victim (on channel 1) and the legitimate AP (on channel 6).
  2. Nonce Reuse Trigger: During the 4-way handshake, the client installs the PTK after receiving message 3 and sending message 4. The attacker, acting as MITM, blocks message 4 from reaching the AP. The AP, expecting message 4, retransmits message 3. The client, receiving the retransmitted message 3, again sends message 4 (often encrypted, despite the standard suggesting otherwise) and, crucially, reinstalls the PTK and resets its nonce to zero.
  3. Key Stream Reuse and Decryption: This reset means that subsequent data packets from the client will reuse nonce values (starting from 1) that were already used before the PTK reinstallation. Since the same PTK and nonce produce the same key stream, this results in key stream reuse. By capturing the original packet (with nonce 1) and the subsequent packet (also using nonce 1 after reset), and knowing that the contents of certain predictable frames (like ARP or DHCP requests) are often similar, an attacker can XOR these two frames to recover the key stream. Once the key stream for a given nonce is known, any other packet encrypted with that same nonce can be decrypted.

Demo / Proof of Concept

▶ Watch: Technical details of the selective jammer implementation (30:00)

Vanhoef's presentation included several compelling demonstrations, primarily via video, to illustrate the practical effectiveness of these attacks.

  1. Capture Effect (FM Radio): To explain the concept of the capture effect, a video demonstration showed an FM radio receiver picking up different stations depending on the listener's proximity, illustrating how a stronger signal "wins" in a collision scenario. This analogy was used to explain how two selfish Wi-Fi stations would compete.
  1. Continuous Jammer: A live video demonstration showcased the continuous jammer in action. A Wi-Fi device was put into monitor mode, and Wireshark was used to capture network traffic. Initially, various Wi-Fi packets were observed. Upon activating the continuous jammer, the Wireshark capture immediately showed a complete halt in legitimate Wi-Fi traffic, confirming that the jammer effectively silenced other devices. When the jammer was disabled, normal network traffic resumed. The speaker also mentioned that this specific jammer implementation is supported on a Raspberry Pi, allowing for a portable, battery-powered jamming device.
  1. Selective Jammer: Another video demonstration illustrated the selective jammer. Similar to the continuous jammer demo, a Wi-Fi device in monitor mode initially received beacon frames correctly. When the selective jammer was activated, Wireshark, by default, showed no beacon frames. However, by configuring Linux to display packets with a bad CRC, Wireshark then revealed a stream of beacon frames, all marked with an "incorrect CRC." This visually confirmed that the selective jammer was successfully corrupting the target beacon frames, causing them to be dropped by the operating system.

The source code for the selective jammer was made publicly available via a URL, provided as a virtual machine image for easy setup and experimentation. However, the continuous jammer's code was intentionally not publicly released due to its potential for widespread disruption and the lack of robust countermeasures at the time. It is made available to legitimate researchers upon request.

Defensive Implications

▶ Watch: Nonce reuse enables WPA2 decryption in KRACK attack (50:00)

The implications of these findings are significant for network defenders and device manufacturers. The shift from expensive, specialized hardware to cheap, commodity devices for advanced Wi-Fi attacks drastically lowers the barrier to entry for malicious actors.

  • Detection of Selfish Clients: While a research prototype for detecting selfish clients was mentioned, widespread deployment and effectiveness against evolving attack strategies are crucial. Defenders need robust mechanisms to identify clients that deviate from fair Wi-Fi protocols and take action, such as kicking them off the network or isolating them.
  • Vigilance for Connection Loss: The ability to jam Wi-Fi and related frequency bands (Bluetooth, ZigBee, IoT) means that critical devices relying on these wireless connections are vulnerable. This includes security webcams, baby monitors, and potentially industrial control systems. Users and administrators must be alerted immediately if a connection is lost, as it could indicate a deliberate jamming attack rather than a simple malfunction or battery depletion.
  • Beyond Wi-Fi: The attacks extend to any device using the 2.4 GHz or 5 GHz spectrum. This includes numerous Internet of Things (IoT) devices, home automation systems using ZigBee or Bluetooth, and even some vehicular systems. For instance, car key fobs that operate on these frequencies can be jammed to prevent locking signals from reaching the car. Real-world examples of cheap jammers already exist for this purpose, enabling car theft by blocking the "lock" command.
  • Anti-Theft System Defeat: More sophisticated attackers might use jammers to defeat anti-theft systems in vehicles, such as GPS trackers or cellular data communication. The example of robbers cutting phone lines, disabling security systems, and jamming mobile communications before a heist underscores the real-world application of such multi-layered jamming strategies.
  • Robustness Against KRACK: The demonstration of how low-layer jamming facilitates the KRACK attack against WPA2 highlights the need for implementations to be robust against message manipulation. While WPA2 has been updated, ensuring all devices have patched firmware and are not susceptible to nonce reuse vulnerabilities is paramount.
  • Physical Security and Spectrum Monitoring: Given the ease of implementing these jammers, physical security around critical wireless infrastructure becomes more important. Additionally, organizations might consider deploying spectrum monitoring solutions to detect unusual radio frequency activity that could indicate jamming attempts.

Key Takeaways

  • Affordable Advanced Attacks: Sophisticated low-layer Wi-Fi attacks, including continuous and selective jamming, can be performed using readily available, cheap commodity USB Wi-Fi dongles ($10-$20), significantly lowering the barrier for attackers.
  • Beyond Simple Jamming: These attacks go beyond crude signal interference, enabling precise manipulation like decoding packet headers mid-transmission to selectively corrupt specific frames.
  • Widespread Disruption: The continuous jammer can effectively silence all Wi-Fi and co-frequency devices (e.g., Bluetooth, ZigBee, IoT) over considerable ranges (80m, 120m with amplifier), posing a threat to security cameras, baby monitors, and industrial systems.
  • Facilitating WPA2 Attacks: Low-layer jamming techniques are crucial enablers for higher-layer attacks like the KRACK attack against WPA2, by allowing reliable manipulation of handshake messages to force nonce reuse and decrypt traffic.
  • Mobile Phone Threat: Emerging research indicates that similar jamming capabilities are now possible on mobile phones (e.g., Nexus 5 with Nexmon), further democratizing these advanced attack vectors.
  • Urgent Defensive Action Needed: Defenders must implement robust detection mechanisms for unfair client behavior and connection loss, and ensure critical wireless systems are designed to withstand sophisticated, low-cost jamming and manipulation attempts.

About the Speaker(s)

Mathy Vanhoef is a distinguished Postdoctoral Researcher at KU Leuven, a renowned institution for cybersecurity research. He is widely recognized in the security community for his groundbreaking work on Wi-Fi security, most notably for discovering and co-disclosing the Key Reinstallation Attack (KRACK), a critical vulnerability in the WPA2 protocol. His research consistently explores the practical security implications of Wi-Fi protocols and hardware, pushing the boundaries of what is considered possible with readily available tools.

Reviews

  • Dr. Zero (Offensive Security Researcher) — MUST SEE ★★★★★
  • Heather Calloway (CISO) — MUST SEE ★★★★★

→ Top-rated talks at BruCON 0x0A

All talks from BruCON 0x0A