WiFi Direct, AirDrop & Proximity Protocols
Bluetooth & Wireless Attack Surfaces · Mobile Advanced Security track
10 min read
In this module
WiFi Direct
WiFi Direct (sometimes branded WiFi P2P) lets two devices stand up a direct WiFi link without an access point in the middle. One device plays Group Owner (GO) — effectively a software access point — and the other connects as a client. Screen mirroring (Miracast), file transfer, printing, and gaming all ride on it.
WPS Vulnerabilities
WiFi Direct uses WiFi Protected Setup (WPS) to bootstrap the connection. WPS has a long, well-documented history of weaknesses:
- WPS PIN brute-force: The 8-digit PIN is validated in two halves (first 4 digits, then last 3 digits plus a checksum). That cuts the brute-force space from 100 million down to roughly 11,000 attempts. Reaver and Bully automate it.
- Push Button Configuration (PBC): A two-minute free-for-all where any device can connect by pressing a button. Within range during that window? You're in the group.
WiFi Direct Security Implications
The moment a WiFi Direct link is up, both devices share an IP network. Services exposed on either side (DLNA media servers, debug interfaces, web servers) become reachable to the peer. The connections also have a habit of lingering in the background, and many devices auto-reconnect to anything they've paired with before.
WiFi Direct stands up a peer-to-peer IP network between devices, using WPS for setup. The WPS PIN flaw (11,000 effective combinations) opens the door to brute force. Once you're connected you share a network with the peer, and any service listening on a reachable interface is fair game. WiFi Direct groups also work as a pivot — slip into the group, then walk through services on the GO's other network interfaces.
Apple Wireless Direct Link (AWDL)
AWDL is Apple's proprietary protocol for peer-to-peer chatter between Apple devices. It's the plumbing under AirDrop, AirPlay, Sidecar, and the rest of the proximity stack. It runs on WiFi but lives off-grid from the normal infrastructure network, riding a channel-hopping sequence the peers negotiate between themselves.
AWDL Architecture
AWDL forms a mesh between nearby Apple devices. Each one periodically enters an availability window where it listens on the AWDL channel for peers. Synchronisation frames coordinate timing across the mesh, and election frames pick a master that drives the channel sequence.
When AirDrop fires off a file, AWDL builds a direct WiFi link between sender and receiver. The transfer itself rides a mix of HTTPS and a proprietary Apple protocol on top.
AWDL Vulnerabilities
AWDL has been a juicy target for years:
- CVE-2020-3843 (Ian Beer, Project Zero): A buffer overflow in the AWDL driver, fixed in early 2020 and written up in full that December, that yielded zero-click remote code execution on any iPhone within WiFi range. No taps, no prompts, no warning. Just AWDL radio range — roughly 30 to 100 metres — and you were in. Beer showed it could go worm-like, with each compromised device reaching out and infecting neighbours.
AWDL isn't normally running all the time: iOS brings the interface up on demand, when AirDrop, AirPlay or a similar feature wants it. What made Beer's exploit nasty is that he didn't need to wait for that. Spoofed Bluetooth LE advertisements, the same kind AirDrop uses to find nearby contacts, persuaded the target to switch AWDL on, even on a locked phone whose owner wasn't using any proximity feature.
AirDrop Privacy
AirDrop's discovery mechanism leaks. Open the AirDrop share sheet and the device starts broadcasting BLE advertisements that carry short fragments of hashes of the user's phone number and Apple ID email, and the full hashes follow over AWDL.
The Discovery Protocol
Discovery happens in two phases:
- BLE Discovery: The sender broadcasts BLE adverts carrying just the first two bytes of the SHA-256 hashes of its contact identifiers (phone number, email). Nearby receivers set to "Contacts Only" use those prefixes as a quick filter against their own contacts.
- AWDL Authentication: The sender then sends a discovery request over AWDL and TLS that carries its full contact-identifier hashes. A receiver that recognises the sender (or is set to "Everyone") answers with its own full hashes.
The Privacy Problem
Researchers at TU Darmstadt showed that both phases leak identifying information:
- Phase 1 (BLE): Two bytes of hash can't be reversed to one number; with 10 billion candidates and 65,536 possible prefixes, about 150,000 numbers share each one. On its own this phase only gives away that someone is sharing.
- Phase 2 (AWDL): The full hashes are the real leak. They're unsalted SHA-256, and phone numbers carry very little entropy — for a given country code there are maybe 10 billion possibilities. A precomputed table of phone-number hashes turns a full hash back into the number almost instantly.
Type a number in (the default is a UK drama number that belongs to nobody) and look at the two highlighted bytes the BLE advert would carry. Then compare how many numbers share that prefix with how long it takes to hash every number in the country.
Phone-number hash calculator
Hashed as +447700900123: a plus sign and digits. Apple's exact input format isn't public; any fixed format gives an attacker the same shortcut. Nothing leaves your browser.
SHA-256
…
The highlighted 2 bytes are what AirDrop puts in its BLE advertisement. The full hash follows over AWDL.
Keyspace
10,000,000,000
10^10: every combination of ten digits.
Hash every number
1 s
At ~10 billion/s. A table of number plus full hash takes 372.53 GiB.
Numbers per prefix
about 152,588
10,000,000,000 / 2^16. The prefix alone narrows the field; the full hash pins one number.
Full hash to number
One lookup
Unsalted, so the table is built once and reused against every victim.
So an attacker who sits in range as an AirDrop receiver gets the full hashes of anyone who opens the share sheet nearby, and learns their phone number. Going the other way, an attacker acting as sender gets a target's hashes if the target has the attacker in their contacts. No user interaction needed in either case. This isn't theoretical: in January 2024 a Beijing forensic institute, in a notice published by the city's justice bureau, said it had used exactly this rainbow-table approach to identify people who'd AirDropped material in public.
Apple was told about this. The protocol hasn't been fundamentally redesigned. The researchers floated PrivateDrop, which uses Private Set Intersection to do contact matching without revealing identifiers, but Apple hasn't shipped it. Apple's main mitigation went elsewhere: since iOS 16.2, receiving from "Everyone" switches itself back to Contacts Only after 10 minutes, which limits drive-by sharing but doesn't touch the hash leak.
Google Nearby Share / Quick Share
Google's proximity file-sharing protocol (originally Nearby Share, rebadged to Quick Share after the Samsung partnership) takes a different architectural route from AirDrop.
Protocol Architecture
Quick Share runs a multi-transport pipeline:
- Discovery: BLE advertisements for the initial handshake, much like AirDrop.
- Bandwidth negotiation: Devices haggle over the best available transport — WiFi Direct, WiFi LAN (if they share one), WiFi hotspot, or Bluetooth.
- Transfer: Files travel end-to-end encrypted with a key derived from UKEY2, Google's authenticated key-exchange protocol.
Security Model
Quick Share diverges from AirDrop in a few places:
- Visibility modes: Hidden, Contacts Only, Everyone — with an "Everyone for 10 minutes" option that auto-reverts.
- Contact verification: Backed by Google account info, sidestepping the hash-reversal trap AirDrop fell into.
- End-to-end encryption: UKEY2 supplies authenticated key exchange, bound to Google account identifiers.
- Vulnerabilities: In 2024, researchers landed CVE-2024-38271 and CVE-2024-38272 — bugs that allowed unauthorised file writes to the target device and could shove the device onto an attacker-controlled WiFi access point.
UWB (Ultra-Wideband)
Ultra-Wideband is a radio technology that fires very short pulses across a wide frequency band — typically 3.1 to 10.6 GHz, with consumer devices clustering around 6.5 GHz and 8 GHz channels. The trick UWB pulls off is precise ranging: distance measurement between devices accurate to within a few centimetres.
UWB in Mobile Devices
UWB ships in iPhone 11 and later (Apple's U1/U2 chip), Samsung Galaxy S21 and later, Pixel 7 Pro and later, and a growing list of other Androids. Typical use cases:
- Precision Finding: Locating AirTags, SmartTags, and similar trackers with directional guidance.
- Digital car keys: Unlocking and starting a car when the phone's in range.
- Spatial awareness: Devices knowing exactly where the others are sat in the room.
- Access control: Hands-free entry to buildings and rooms.
Ranging Security
UWB's ranging security plays a fundamentally different game from BLE or NFC proximity:
- Time-of-flight measurement: It clocks signal round-trip with sub-nanosecond resolution. Radio travels at roughly 30 centimetres per nanosecond, so the distance reading lands within a few centimetres.
- Relay attack resistance: Any relay tacks on delay proportional to the extra distance. A relay 10 metres away adds about 33 nanoseconds each way — visible to UWB's timing window.
- IEEE 802.15.4z: The secure-ranging standard layers in Scrambled Timestamp Sequence (STS), a cryptographic challenge baked into the ranging signal. Without the shared key, an attacker can't predict or forge the STS, which kills early-detect/late-commit tricks.
Work through the four scenarios below. Drag the relay processing down to 0 ns and watch the car still refuse to unlock, then switch to early commit and flip STS on and off to see which half of the defence does what.
UWB distance bounding and relays
A car checks how far your phone is by timing a challenge and response, as UWB digital keys such as CCC Digital Key 3.0 do. Timings and attacker figures here are illustrative.
The car sends a challenge, the phone waits a fixed reply time and answers. The car knows that reply time, subtracts it, and turns what's left into distance. Light covers about 0.3 m per nanosecond, so each nanosecond of round trip is about 15 cm.
- Over the air
- Reply time (not to scale)
Every segment in nanoseconds
| Challenge in flight | 5.0 ns |
| Phone's reply time | 200.0 ns |
| Response in flight | 5.0 ns |
| Round trip the car measures | 210.0 ns |
(210.0 ns − 200.0 ns) × c / 2 = 1.50 m
- Phone really is
- 1.50 m away
- Car measures
- 1.50 m
- Unlock rule
- measured ≤ 2.00 m
Car unlocks
UWB delivers relay-resistant distance measurement through time-of-flight at sub-nanosecond resolution. IEEE 802.15.4z bolts on cryptographic security via Scrambled Timestamp Sequence (STS), embedding a shared-secret-derived challenge into the ranging signal itself. The two together make faking proximity far harder: a relay shows up as measurable delay, and massaging the ranging signal without the key should produce nonsense timestamps. Should, because implementations matter: the Ghost Peak attack (Leu et al., USENIX Security 2022) still shortened measured distances against real 802.15.4z HRP chips by exploiting how receivers detect the first path.
Cross-Protocol Attacks
Modern phones run a half-dozen wireless stacks side by side, and that density opens the door to cross-protocol attacks — using one protocol to break into another.
WiFi-to-BLE
An attacker sitting on the same WiFi network as the target may reach BLE management services exposed on local interfaces. Plenty of IoT hubs publish BLE-device-management APIs over plain HTTP on the LAN.
BLE-to-WiFi
A compromised BLE device that also has WiFi (a smart plug, say) makes a tidy pivot. Compromise it over BLE, then ride its WiFi connection into the local network.
NFC-to-WiFi/BLE
Malicious NFC tags can carry WiFi configuration records that auto-join a rogue access point, or Bluetooth pairing records that kick off pairing with a malicious device. One tap, and your network connectivity has been reconfigured for you.
AWDL-to-WiFi
Ian Beer's CVE-2020-3843 showed where this leads at the high end: a zero-click AWDL exploit owns the iPhone, and from there the attacker walks straight onto every other interface the device touches — including its WiFi link to the local network.
Here are those pivots as one graph, with the WiFi Direct route from earlier added. Turn on "Bluetooth off when unused" and notice that the AWDL route survives, because the owner can still bring AWDL up by using AirDrop. Then find the smallest set of defences that cuts the attacker off from the local network.
Cross-protocol pivots
Each arrow is one hop from one radio protocol into another. Switch defences on and watch which routes survive.
Defences
Sensitive hosts on the local network: reachable in 2 steps
- (arrow 5)
- (arrow 6)
Tap a box or a numbered arrow to read about it.
Nothing selected yet.
What each defence does
- NFC off, unknown tags ignored. Treat a strange NFC tag the way you'd treat a USB stick in the car park.
- Bluetooth off when unused.
- WiFi off when unused.
- Everything patched. Most of these bugs are implementation flaws that OS and firmware updates fix. It only covers bugs that have been fixed.
- Network segmented. IoT kit and guests on their own segment, away from sensitive machines.
The routes come from this lesson. A defence only appears on an arrow the lesson says it stops.
Defence
Defending against the cross-protocol mess comes down to four habits:
- Switch off wireless protocols (WiFi, Bluetooth, NFC, AirDrop) when you aren't actively using them.
- Stay patched. Most of these bugs are implementation flaws, and most get fixed in OS updates.
- Segment the network so compromised IoT kit can't roam onto sensitive resources.
- Treat unknown NFC tags the way you'd treat a strange USB stick in the car park. Don't tap.
Modern mobile devices simultaneously operate five or more wireless protocols (cellular, WiFi, BLE, NFC, UWB, AWDL). Each protocol is an independent attack surface, and compromising one can provide a pivot to attack through others. A malicious NFC tag can reconfigure WiFi settings. A compromised BLE device can attack the local network. A zero-click AWDL exploit can compromise the entire device. Defence requires minimising active protocols, prompt patching, and network segmentation.