Skip to content
Crypto Write-up Advanced

Phantom Fob — Rolling-Code Key Recovery via Cross-Frame Correlation Leads to Unauthorized Unlock | TryHackMe

The rolling-code key for a car key fob was derived from a cleartext value broadcast on an unrelated CAN ID, allowing an attacker to forge any command, including an unlock command the fob does not expose. A high-speed sweep of all possible command bytes within the roughly one-second code window achieved an unauthorised unlock.

Roshan Rajbanshi Follow

Published on meetcyber.net

A key fob that can lock a car and sound its horn but has no unlock button looks, at first glance, like a manufacturer being careful. It is not.

Roshan Rajbanshi, on meetcyber.net

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the rolling-code key was derived from a value that was also broadcast in cleartext on an unrelated, unauthenticated CAN ID, so the secret was observable on the bus.

Impact

An attacker with access to the CAN bus could forge any command, including an unlock command never exposed by the physical fob, and unlock the doors within the roughly one-second code window.

What the attacker needed

Network access to the socketcand port; ability to send and receive CAN frames; knowledge of the fob's frame layout

The fix

Keying material should never be derived from a value broadcast on a shared, unauthenticated bus; instead, authenticate the full frame with a MAC using a key that is never transmitted.

How it was found

  1. Discover the socketcand service on port 29536 and connect to the CAN bus in raw mode.
  2. Capture baseline CAN traffic and identify the event-driven fob ID and the slow external broadcast ID.
  3. Press each of the four fob buttons and diff frames to isolate the fob's eight-byte payload layout.
  4. Fire all four buttons rapidly within one external broadcast tick and group the fob frames to spot the identical leading bytes.
  5. Recover the key by testing modular addition and XOR against the known counter and command bytes.
  6. Forge frames for all 256 command values and send them back-to-back within the roughly one-second window to unlock the doors.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A car key fob sends a changing code each time a button is pressed so that an attacker cannot simply copy an old signal. Here, part of the secret used to build that code was also being broadcast openly on the car's internal network, so anyone listening could work out the secret and create their own valid signals. That let the attacker send an unlock command even though the physical fob has no unlock button.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More by Roshan Rajbanshi

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.