Hack the Virtual Cluster
16 car hacking challenges you can do from a browser tab. The target is a simulated instrument cluster on a simulated CAN bus, so you don't need a car, an adapter or any software.
- 16
- Challenges
- 49
- Objectives
- 905
- Points
First time? Start here
CAN bus in one minute
A modern car is full of small computers called ECUs. They are all connected to the same pair of wires, the CAN bus, and they talk by sending short messages called frames. A frame has an arbitration ID, which tells you what kind of message it is, and up to 8 bytes of data.
Frames are not addressed to anyone and they don't say who sent them. Every ECU receives everything, and any device on the bus can send any ID. The instrument cluster has no way to check where a frame came from, so it shows whatever it is told. These challenges are about using that.
# ID DLC data 123 8 00 00 1A 2B 00 00 05 34
Your target
The simulator is a small car with an engine, a gearbox, four doors, an instrument cluster and one diagnostic ECU. Besides the real traffic it sends about two dozen decoy IDs that mean nothing. The decoys get new IDs every time you start the simulator, so you can't copy them from someone else's notes.
The loop you'll repeat
- 01Listen
Look at the traffic before you send anything.
- 02Isolate
Change one thing in the car and see which bytes change.
- 03Decode
Find the byte or bit, and how the value is scaled.
- 04Inject
Send your own version of that frame.
- 05Verify
Check the cluster. If nothing happened, something else is checked too.
If CAN is new to you, read the introduction to CAN below first. Otherwise skip to launching the simulator.
An introduction to CAN
Some background before you start. None of this is specific to the simulator. Real cars work the same way.
Why cars have a bus
Until the 1980s, two control units that needed to share a signal got their own wire between them. With every new feature the wiring loom got heavier and more expensive. Bosch developed the Controller Area Network to fix that: one shared pair of wires that all control units connect to. The first production cars with CAN appeared in the early 1990s, and it is still in nearly every car built today.
A current car has dozens of ECUs, for the engine, gearbox, ABS, airbags, doors, climate control and so on. Each one puts its own measurements on the bus and reads what it needs from the others. The instrument cluster mostly reads. Speed, RPM, warning lamps and door status all arrive as frames from other ECUs.
Most cars have more than one bus. The engine, gearbox and brakes are on a fast powertrain bus, and things like doors and climate control are on a slower comfort bus. A gateway connects them and passes on only the frames the other side needs. In newer cars the diagnostic port is connected to the gateway as well, so you don't always see the raw bus traffic from there.
Two wires, one conversation
The bus is two wires, CAN-H and CAN-L, twisted together, with a 120 Ω resistor at each end. A bit is sent as a voltage difference between the two wires. Interference from the rest of the car hits both wires equally, so the difference stays readable.
| Bit | Name | On the wire |
|---|---|---|
0 | Dominant | CAN-H pulled up, CAN-L pulled down: a clear difference |
1 | Recessive | Both wires resting at the same level: no difference |
If one ECU sends a 0 while another sends a 1, the bus carries the 0. That is why a 0 is called dominant, and arbitration (explained below) depends on it. Common speeds are 500 kbit/s for the powertrain and 125 kbit/s or lower for comfort functions. On a real car you connect through the OBD-II port under the dashboard, where CAN is on pins 6 and 14. In the simulator you are connected from the start.
Anatomy of a frame
On the wire a frame has seven fields. CAN tools show three of them: ID, DLC and data. The CAN controller chip takes care of the rest.
- ID
- The arbitration ID identifies the type of message, for example wheel speeds or door status. It does not identify the sender or the receiver. Each manufacturer chooses its own IDs and usually keeps them to itself. Standard IDs are 11 bits (
000to7FF). There is also an extended format with 29 bits. - DLC
- The data length code: how many data bytes follow, 0 to 8.
- Data
- The payload, at most eight bytes. One frame often holds several values, and some values take only a single bit.
- CRC
- A checksum for detecting transmission errors. It is not a security feature. Your adapter calculates a correct CRC for every frame you send.
- ACK
- Every ECU that received the frame correctly sets this bit. The sender learns that at least one node heard it, but not which one.
Who gets to talk
No ECU is in charge of the bus, and there is no schedule. An ECU can start sending whenever the bus is idle. When two start at the same moment, each sends its ID one bit at a time and reads the bus back. An ECU that sends a recessive 1 but reads a dominant 0 has lost. It stops and tries again once the bus is free.
This is called arbitration, and the result is that the lowest ID wins. Manufacturers give urgent messages such as braking a low ID and comfort messages a high one. A device that keeps sending a very low ID can block the whole bus, which is the basis of a simple denial-of-service attack.
Everyone hears everything
CAN is a broadcast network. A frame is not sent to a particular ECU. All ECUs receive it, and each one decides whether it needs that ID. A frame doesn't contain a sender either, so a receiver can't tell which ECU it came from.
In 1986 that was fine, because the bus was a closed network and nothing on it was connected to the outside world. Classic CAN therefore has no authentication and no encryption. Anything that can send on the bus can pretend to be any ECU.
Cyclic messages
Most frames are sent at a fixed interval, even when the value hasn't changed. Engine speed might be sent every 20 ms, door status every 100 ms and the odometer once a second. That interval is the cycle time. Some frames are only sent when something happens, such as a button press.
This matters in two ways when you start sending frames yourself:
- A receiver notices when an expected frame stops arriving and usually reports a fault, for example with a warning lamp.
- The real ECU keeps sending. Your spoofed value is replaced by the real one a few milliseconds later, so you have to keep sending yours, and more often than the real ECU does.
From bytes to signals
A value inside a frame is called a signal. To decode one you need to know which bytes it uses, which bits, the byte order and the scaling. Frame data is written in hexadecimal: one byte is two hex digits, from 00 to FF (0 to 255).
| Kind of signal | Example bytes | How to read it |
|---|---|---|
| Flags | 05 | Binary 0000 0101: bit 0 and bit 2 are set. Each bit is one on/off thing. |
| One byte | 5A | 90 in decimal. Often with an offset, for example 90 − 40 = 50 °C. |
| Two bytes, big-endian | 0B B8 | High byte first: 0x0BB8 = 3000. |
| Two bytes, little-endian | B8 0B | Low byte first: also 0x0BB8 = 3000. |
| Scaled value | 0B B8 | Raw 3000 × 0.25 = 750. Scaling stores decimals in whole numbers. |
For a real car you don't get this information. You have to work it out: change one thing in the car, see which bytes change, and repeat. Section 1 is practice in exactly that.
Many safety-related frames also carry an alive counter that increments with every frame and a checksum over the payload. They let a receiver detect a frozen or corrupted sender, and some receivers reject frames where they are wrong.
More than eight bytes: diagnostics
Broadcast frames are how ECUs talk to each other. Workshop testers talk to one ECU at a time, with requests and responses. That needs longer messages, so a transport layer called ISO-TP splits them across several frames. On top of it runs UDS, the diagnostic protocol used to read identification data, fault codes and live values, and to unlock protected functions.
Each ECU listens for requests on one ID and answers on another. The simulator's tool takes care of ISO-TP for you. Section 3 uses UDS.
Launch the simulator
The challenges run in webusb-can, a browser-based CAN tool with a built-in virtual car. Open it in a second window and keep this page next to it.
- 01
- Use Chrome or Edge on a laptop or desktop. If a "WebUSB not supported" notice appears, close it. The simulator works without it.
- 02
- Click Start simulator in the top bar. You don't need Connect device, that is for a real USB adapter.
- 03
- The Simulated car panel appears. Hold Accelerate or Brake, or use the arrow keys: ↑ accelerate, ↓ brake, ← → turn signals.
The interface
Everything the car sends ends up in the large panel on the right. It has two views of the same traffic, Log and Sniffer, and you switch between them at the top.
Example In the screenshot, ID 296 arrives about every 200 ms and none of its bytes are lit, so nothing in it is changing. A row where bytes keep lighting up while you drive is a better place to look.
Example ID 123, DLC 8, data DE AD BE EF 00 00 00 00, then Send. The frame shows up in the Log as TX, as in the screenshot above.
The panel on the left has three tools, one per tab.
Example In the UDS tab, type 3E 00 and click Send request. The ECU answers Positive response. 3E is Tester Present, a request that does nothing except show that you are still there.
For anything you can't do by hand there is a scripting API in the browser console, see the quick reference.
Warm-up: your first five minutes
A quick tour of the tool. There are no points for this part.
- 01
- Watch the log. With the simulator started, every row is one frame: time, direction, ID, length and data.
RXrows come from the car. - 02
- Switch to the Sniffer. Same traffic, one row per ID. Compare the cycle times, and notice that some rows never change while others flicker constantly.
- 03
- Drive. Hold ↑ for a few seconds and watch the Sniffer. Some bytes start moving with the car. Those are the ones worth your attention.
- 04
- Filter. Back in the Log, type an ID you saw into the filter box to follow just that message. Use Pause to freeze it and read at your own pace.
- 05
- Send a frame. In the Send bar at the bottom, enter ID
123, DLC8, dataDE AD BE EF 00 00 00 00and click Send. It appears in the log asTX. Nothing reacts, because no ECU cares about that ID. - 06
- Repeat it. Set the interval to
100ms and click Repeat. The frame now goes out every 100 ms, the same way the car's ECUs send theirs. Click it again to stop.
You will use these four things in every challenge: reading the log, filtering, sending a frame and repeating it.
Choose your route
Pick the short route if you have half an hour. It takes you through reading the bus, sending your own frames and talking to the ECU. The full route has every challenge. You can switch at any time and your progress is kept.
Your score
Tick an objective when you have done it. Your progress is stored in this browser only, and nobody checks your answers.
Your rank
Passenger
0 of 0 objectives done
Cluster Overlord
All objectives done. Nice work.
Section 1
Listen
In this section you only watch. Start the simulator, open the Sniffer and drive the car around. If the decoy traffic gets in the way, switch off Bogus traffic in the Simulated car panel. Only the real frames are left.
Challenge 01 // First contact
Start the simulator and look at the traffic. There are dozens of IDs and each has its own cycle time. Some carry real signals, but most are decoys.
Done when the Sniffer is filling up and you can point at the IDs that keep returning.
Hint 1
Use the Sniffer, not the Log: it keeps one row per ID and shows how often each one arrives.
Hint 2
The cycle time column is the gap in milliseconds between two frames of the same ID. Small number means fast.
Show full solution
Click Start simulator, then open the Sniffer tab. Each row is one arbitration ID with a count and a cycle time. The fastest real frames arrive about every 20 ms; the slowest, like the odometer, about once a second (1000 ms).
What just happened
You now know the difference between the Log (every frame, in order) and the Sniffer (one row per ID). Reading the bus this way is the first thing anyone does on a real car.
Challenge 02 // Signal from noise
Decoy frames stay the same whatever the car does. Real frames change when you drive. Accelerate, brake and coast, and watch which bytes follow.
Done when you can name the IDs for speed, RPM and the pedals.
- Which ID carries vehicle speed?
- Which ID carries engine RPM?
- Which ID reports your pedals and gear?
Hint 1
Hold the accelerator and watch which rows in the Sniffer start changing. Let go and watch which ones freeze.
Hint 2
Speed keeps rising for a moment after you lift off; RPM drops at every gear change. A byte that flips the instant you press a key is the pedal, not the result.
Show full solution
Drive with the arrow keys and watch the Sniffer. Speed is on 244 (a value that climbs and falls smoothly), RPM is on 0AA (jumps at gear changes), and the pedals and gear are on 1D0 (one byte flips to 0xFF the moment you hold the accelerator).
What just happened
You separated signal from noise by changing one input at a time and watching what moved. On a real car, where nothing is labelled, this is exactly how a bus gets mapped.
Challenge 03 // Decode the dials
Now work out how the bytes map to the numbers on the dials. Speed is one 16-bit number in bytes 3 and 4 of the speed frame (counting from 0, high byte first). RPM is a single byte, byte 4 of the RPM frame. The odometer is the only frame with 3 data bytes, and those 3 bytes are one number. Convert the hex to decimal and compare it with the cluster.
Done when you can turn the raw bytes of the speed and RPM frames into the numbers on the dials.
- By what number do you divide the raw speed value to get km/h?
- How many RPM does one count of the RPM byte represent?
- By what number do you divide the raw odometer value to get km?
Hint 1
Two bytes that change together are usually one 16-bit number. Read the high byte first (big-endian).
Hint 2
Pick a steady RPM, read the raw byte as a decimal number, and divide the RPM on the dial by it. The answer is a round number.
Show full solution
For speed, bytes 3 and 4 of 244 are one big-endian number equal to km/h times 100 (so 27 10 = 10000 = 100 km/h). For RPM, byte 4 of 0AA times 32 gives the RPM. The odometer on 5C8 is a 24-bit big-endian number equal to km times 10.
What just happened
Decoding a signal is always the same four questions: which bytes, which bits, what byte order, what scale. You will reuse the speed and RPM maps when you start sending frames in Section 2.
Challenge 04 // Read the VIN
Every car has a 17-character Vehicle Identification Number. This car broadcasts it on the bus. 17 characters don't fit in one frame, so it is split over several.
Done when you have read all 17 characters of the VIN off the bus.
- Which ID broadcasts the VIN?
- What is the full 17-character VIN?
Hint 1
The Sniffer has an ASCII column on the right. Look for a row whose bytes read as letters and digits.
Hint 2
It arrives in three frames. The first byte of each frame is a 0, 1 or 2 that tells you the order; the other seven bytes are text.
Show full solution
On 65D the first data byte is an index (0, 1, 2) and the next seven bytes are ASCII. Stitch the three chunks together in order to get WVWZZZ1KZAW123456. You can also read it later over UDS with 22 F1 90.
What just happened
A value too big for eight bytes gets split across several frames with an index byte. That multi-frame idea is the whole reason the UDS transport layer in Section 3 exists.
Challenge 05 // Count and check
Look at the last two bytes of the speed frame. They change on every frame, even when the car is standing still. Byte 6 is a counter and byte 7 is a checksum over bytes 0 to 6. Real ECUs add these so a receiver can spot a stuck or corrupted sender.
Done when you can predict the last two bytes of a speed frame before it is sent.
- What is the highest value the counter reaches before it wraps back to 0?
- Which one-byte operation over the first seven bytes produces the checksum?
Hint 1
Pause the Log and line up three frames with the same ID. One of the last two bytes steps by exactly one each time.
Hint 2
The counter is byte 6 and runs 0..15 (one nibble). The checksum is byte 7, and it is not an addition. Try combining the first seven bytes with exclusive-or.
Show full solution
Byte 6 is an alive counter that counts 0 to 15 and wraps. Byte 7 is the XOR of bytes 0 to 6. The cluster in this simulator does not check either, but real ECUs often reject frames whose counter is stale or whose checksum is wrong.
What just happened
Counters and checksums are how a receiver spots a dead or lying sender. Where they are enforced, a naive replay of a captured frame fails, because the counter you replay is soon out of date.
Section 2
Speak
Now you send frames yourself. The cluster accepts what you send, but it falls back to the real value after a fraction of a second. For most of these challenges you need a frame that keeps repeating.
Challenge 06 // Turn signals
Some IDs are only sent when something happens. The frame for the indicator arrows is one of them, so you won't see it while the car is idle.
Done when you can light the left arrow, the right arrow and both, using only frames you send.
- Which ID drives the indicator arrows?
Hint 1
This ID is silent while the car is idle, so you cannot find it by watching. Make it appear first.
Hint 2
Press the left arrow key and watch for an ID that was not there a moment ago. Left and right are two separate bits in the same byte.
Show full solution
Press ← to make 188 appear. Byte 0 bit 0 is the left arrow and bit 1 is the right. Repeat 188: 01 for left, 188: 02 for right, and 188: 03 for both (hazards). Send it every 100 ms or so.
What just happened
Some frames are event-driven and never show up on an idle bus. To find them you have to trigger the function first, then look.
Challenge 07 // Doors
The door frame is always on the bus. Open a door with the on-screen buttons and see what changes. Then send the frame yourself instead of using the buttons.
Done when the cluster shows all four doors open, then only the rear-left, from frames you send.
Hint 1
Open the doors one at a time with the on-screen buttons and watch which bit in the door frame changes.
Hint 2
All four doors live in the low nibble of one byte. Front-left, front-right, rear-left, rear-right are bits 0, 1, 2, 3.
Show full solution
The door frame is 19B, and byte 2 holds the doors in its low nibble. Send 19B: 00 00 0F for all four open, and 19B: 00 00 04 (bit 2) for only the rear-left.
What just happened
One byte, read as four bits, is a compact way to pack four on/off signals. Reading a byte in binary is a habit worth keeping.
Challenge 08 // Silence the warnings
Two warning lamps are on from the start: immobilizer and airbag. Those two modules are missing from this bus, and the cluster reports a fault when it doesn't hear from them. You have one piece of documentation to go on: the immobilizer sends on 3D0, the airbag on 050, and a frame with only zeros means there is no fault.
Done when both warning lamps stay dark while your frames keep arriving.
- About what is the longest interval, in milliseconds, that still keeps a lamp off? (nearest 10 ms)
Hint 1
One frame is not enough. The cluster wants to keep hearing from these modules, so your frame has to repeat.
Hint 2
Use the Signals tab to run 3D0 and 050 at the same time, both with all-zero data. Then slow one down until its lamp flickers.
Show full solution
Both modules report “no fault” as all zeros. Add two repeating signals, 3D0: 00 00 00 00 00 00 00 00 and 050: 00 00 00 00 00 00 00 00, at about 100 ms. The lamp starts to flicker once the gap passes roughly 200 ms, which is how long the cluster waits before it assumes the module is gone.
What just happened
A missing heartbeat is itself a fault to the cluster. This is why you cannot just send a value once: safety functions expect a steady stream.
Challenge 09 // Pin the RPM
In Challenge 03 you decoded the RPM frame: byte 4 times 32 is the RPM. Now send one yourself. Divide the RPM you want by 32, convert that to hex and put it in byte 4, with zeros in the other bytes. The engine ECU keeps sending the real value, so repeat yours every 20 ms.
Done when the rev needle sits where you put it, not where the engine wants it.
Hint 1
Reuse what you found in Challenge 03: byte 4 of the RPM frame, times 32.
Hint 2
The engine keeps sending its own value, so repeat yours faster than it does, every 20 ms.
Show full solution
RPM is byte 4 of 0AA. For the red zone send 0AA: 00 00 00 00 F0 (0xF0 = 240, times 32 = 7680). For a steady idle send byte 4 = 19 (25 times 32 = 800). Repeat every 20 ms so the engine's own frame never wins.
What just happened
Writing a frame is the same as reading one, in reverse: take the number you want, undo the scaling, place it in the right byte. Winning against the real sender is only a matter of sending more often.
Challenge 10 // Speedometer
Try the same with the speed frame and the needle stays at zero. The cluster compares the speed with the wheel speeds, which are sent in a separate frame, and ignores values that don't match. Drive around and look for a frame with four nearly identical 16-bit values. Send that frame and the speed frame together, with the same value in both.
Done when the speedometer holds a believable speed, not zero.
Hint 1
Spoofing 244 alone shows 0. The cluster is comparing your speed against another frame and ignoring the mismatch.
Hint 2
While driving, look for a frame with four near-identical values that track the speed. That is the wheel-speed frame; send it to match.
Show full solution
The cluster cross-checks 244 against the wheel speeds on 4A0, four big-endian values in km/h times 100. Send both with matching numbers, for example 244: 00 00 00 32 C8 and 4A0: 32 C8 32 C8 32 C8 32 C8 for 130 km/h. For the steps, change the value in both frames: 50 km/h is 13 88, 100 is 27 10 and 150 is 3A 98.
What just happened
A plausibility check compares two sources that should agree. Beating it means keeping every related signal consistent, which is a realistic obstacle on modern vehicles.
Challenge 11 // Clock the miles
Odometer fraud normally means lowering the mileage. Here you do the opposite and add kilometres to a parked car. The odometer is on the bottom line of the cluster display.
Done when the odometer climbs while the needle stays at 0.
Hint 1
The needle has the plausibility check from Challenge 10. Does the odometer use the same check?
Hint 2
The odometer integrates the raw speed value, not the displayed one. Think about the largest number two bytes can hold.
Show full solution
Send only 244 at a very high value, for example 244: 00 00 00 FF FF (about 655 km/h), with no matching 4A0. The needle reads 0 because the plausibility check fails, but the odometer still integrates the raw speed and climbs about 0.18 km per second.
What just happened
Different consumers of the same signal can trust it differently. One display rejected your value while another quietly used it, which is exactly the kind of inconsistency that makes odometer fraud possible.
Challenge 12 // Fuzz responsibly
Clusters often respond to frames that aren't in any documentation. Your notes list three more IDs without a description: 350, 412 and 4F0. Use the Fuzzer to send random data to one of them at a time and watch the cluster. Each one reacts to a single byte, either the first or the last.
Done when you have found three undocumented reactions, including the exact byte that changes the display.
- Which byte value in ID
412makes the display change? (the value of byte 0)
Hint 1
Fuzz one ID at a time: fixed ID, random data, 8 bytes, a short gap. Watch the cluster, not the log.
Hint 2
When something reacts, pause and look at the frames you just sent. Then narrow it to a single byte with the Send bar.
Show full solution
350 with byte 7 = FF lights the oil lamp; 4F0 with byte 0 = A5 lights the check-engine lamp; 412 with byte 0 = 42 shows a message on the display. Fuzz each ID on its own, then confirm the exact byte in the Send bar.
What just happened
Hardware often reacts to messages that appear in no documentation. Fuzzing one input at a time, then narrowing down, is how you find them without turning the whole thing into noise.
Section 3
Diagnose
A workshop tester doesn't listen to broadcast traffic. It sends requests to one ECU and reads the responses, using a protocol called UDS (Unified Diagnostic Services). Open the UDS tab and type a request in hex. The tool takes care of the transport. A positive response starts with your service byte plus 0x40. A negative response starts with 7F and ends with a reason code.
Challenge 13 // Hello, ECU
Start by reading some data. Service 22, Read Data By Identifier, returns the value of a two-byte DID. To read DID F190 you send 22 F1 90. The identification data you need is between F186 and F195. Live values use F4 followed by the OBD-II PID number, and the PID for engine RPM is 0C.
Done when the ECU answers your reads and you can name the DIDs you used.
- Which two DIDs return the part number and the software version?
- Which DID returns live engine RPM?
Hint 1
Open the UDS tab. A positive answer echoes your service byte plus 0x40, so a reply to 22 starts with 62.
Hint 2
Walk the identification range F180 to F19F by hand. An unknown DID is refused with reason 31. Live values often mirror the OBD-II PID numbers in the F4xx range.
Show full solution
Send 22 F1 90 for the VIN, 22 F1 87 for the part number 1K0907115AB, and 22 F1 95 for the software version SW 1.4.2. Live engine RPM is 22 F4 0C: divide the returned 16-bit value by 4 and it matches the dial.
What just happened
UDS is request and response to one ECU, unlike the broadcast traffic in Sections 1 and 2. Read Data By Identifier is the safe way to enumerate what an ECU knows about itself.
Challenge 14 // Trouble codes
An ECU stores a Diagnostic Trouble Code when it detects a fault. Service 19 reads the stored codes and service 14 erases them. A code comes back as three bytes. The first two give the code itself: 01 23 is P0123 and C1 23 is U0123.
Done when you have read the trouble codes, decoded them, and cleared them.
- Decode the stored codes. Write them in the usual letter-and-digits form.
Hint 1
Read them with 19 02 FF. Each stored code is three bytes plus one status byte.
Hint 2
The top two bits of the first byte choose the letter: 00 is P, 01 is C, 10 is B, 11 is U. The remaining bits are the digits.
Show full solution
19 02 FF returns two records: 03 01 00 decodes to P0301 (cylinder 1 misfire) and C1 00 00 decodes to U0100 (lost communication). Erase them with 14 FF FF FF, then read again to confirm the list is empty.
What just happened
Reading a trouble code is one service, erasing it is another. Being able to clear faults is useful in a workshop and is also how a fault can be hidden before a sale.
Challenge 15 // Sessions
An ECU starts in the default session, where only harmless services work. The interesting ones need the extended session, and the ECU drops you back to default if you go quiet for too long.
Done when you can enter the extended session, keep it alive, and let it drop on purpose.
- Roughly how many seconds of silence before the session drops back to default?
Hint 1
The services you need, 10, 3E and 11, are all in the preset dropdown.
Hint 2
Read the active session back with 22 F1 86. Any request resets the idle timer, not just Tester Present.
Show full solution
Send 10 03 to enter the extended session, then 22 F1 86 to confirm (it returns ...03). Stop sending and after about 5 seconds it falls back to ...01. Tick Tester Present (3E 00 every 2 s) to hold it open. 11 01 resets the ECU and triggers the cluster's bulb check.
What just happened
An ECU only exposes its sensitive services in a non-default session, and it closes that session when the tester goes quiet. Keeping the session alive is a prerequisite for the final challenge.
Challenge 16 // Security access
One DID between 1300 and 13FF contains a flag. The ECU only returns it after Security Access, service 27: you request a seed, calculate the matching key and send it back. The algorithm is in the ECU's firmware. On a real ECU you would have to extract that firmware and reverse engineer it. Here the ECU is a JavaScript file called sim-ecu.js that your browser has already downloaded.
256 DIDs is too many to try by hand. Paste this into the DevTools console of the simulator tab. It asks for every DID in the range and prints the ones that are not simply unknown.
let did = 0x1300; const ask = () => api.send({ id: 0x7E0, data: [0x03, 0x22, did >> 8, did & 0xFF, 0, 0, 0, 0] }); api.onFrame(0x7E8, d => { // d[3] is the refusal reason. 0x31 means "no such DID". if (d[3] !== 0x31) console.log(did.toString(16), 'reason', d[3].toString(16)); if (++did <= 0x13FF) ask(); }); ask();
Done when you have unlocked the ECU and read the secret it was guarding.
- Which DID is refused with “security access denied” rather than “out of range”?
- What 32-bit value is combined with the seed to make the key? (hex)
- What is the flag?
Hint 1
You must be in the extended session from Challenge 15 before 27 will give you a seed.
Hint 2
Run the script from the challenge text in the console of the simulator tab. A protected DID is refused with reason 33, not 31.
Hint 3
The algorithm is in the ECU's firmware, and here the firmware is a JavaScript file your browser already downloaded. Open DevTools, go to Sources and open js/sim-ecu.js. Search for 27 or for the word key.
Show full solution
In the extended session, 27 01 returns a four-byte seed. The key is the seed combined with a fixed 32-bit mask using XOR; read it out of the ECU source. Send 27 02 followed by your four key bytes, then read the protected DID 22 13 37. If you send three wrong keys you are locked out for ten seconds, but 11 01 (ECU reset) clears the lockout at once.
What just happened
Security Access is a seed-and-key challenge: the strength is entirely in the secret algorithm. Once that algorithm leaks, as it does whenever firmware can be extracted, the lock is open. That is the central lesson of the whole page.
Quick reference
Reading a frame
| Term | Meaning |
|---|---|
| ID | Arbitration ID in hex, 11 bits (000 to 7FF). Lower wins the bus. |
| DLC | Number of data bytes, 0 to 8. |
| Byte 0 | The leftmost data byte. Bit 0 is the least significant bit. |
| Big-endian | High byte first: 32 C8 is 0x32C8 = 13000. |
| Cycle time | Milliseconds between two frames with the same ID. |
UDS services on this ECU
| Request | Service |
|---|---|
10 xx | Diagnostic Session Control (01 default, 03 extended) |
11 01 | ECU Reset |
14 FF FF FF | Clear Diagnostic Information |
19 02 FF | Read DTC Information, by status mask |
22 hh ll | Read Data By Identifier |
27 01 / 27 02 kk kk kk kk | Security Access: request seed / send key |
3E 00 | Tester Present |
Negative response codes
A refusal looks like 7F <service> <reason>. The reason tells you what to fix.
| Code | Meaning |
|---|---|
11 | Service not supported |
12 | Sub-function not supported |
13 | Incorrect message length or format |
24 | Request sequence error |
31 | Request out of range |
33 | Security access denied |
35 | Invalid key |
36 | Exceeded number of attempts |
37 | Required time delay not expired |
7F | Service not supported in active session |
Scripting from the console
Open DevTools in the simulator tab (F12) and use api. Listeners only see frames from the car, never your own.
// send one frame api.send({ id: 0x123, data: [0x00, 0x01, 0x02] }); // repeat a frame, stop it later const r = api.sendRepeat({ id: 0x123, data: [0, 0, 0, 0, 0, 0, 0, 0], intervalMs: 50 }); r.stop(); // listen to one ID, or to everything const off = api.onFrame(0x123, data => console.log(data)); api.onAnyFrame(({ id, data }) => { /* ... */ }); off(); // a short UDS request by hand: [length, service, ...] to 7E0, answer on 7E8 api.onFrame(0x7E8, data => console.log([...data].map(b => b.toString(16).padStart(2, '0')).join(' '))); api.send({ id: 0x7E0, data: [0x03, 0x22, 0xF1, 0x90, 0, 0, 0, 0] });
Troubleshooting
"WebUSB not supported" covers the page
That notice is about real USB adapters. Close it and click Start simulator. Chrome and Edge give the best experience.
My frame works for a blink, then the cluster snaps back
The car keeps sending its own values and the cluster forgets yours after a fraction of a second. Tick Repeat or add the frame under Signals, and keep the interval short.
I spoof the speed frame but the needle reads 0
That is expected, see Challenge 10. The cluster compares your speed with another frame.
Lamps flicker or timing goes wrong when I switch tabs
Browsers slow down timers in background tabs. Keep the simulator in its own visible window next to this page.
The ECU answers 7F ... 7F or forgot my session
The extended session ends after a few seconds of silence. Tick Tester Present in the UDS tab, or enter the session again.
Every lamp lit up at once
That's the bulb check the cluster runs when it powers up or the ECU resets. It passes in a second or two.
The IDs I wrote down are gone after a restart
The decoy IDs are reshuffled on every start. The real ones never move.
Going deeper
- webusb-can on GitHub: the tool and simulator. Plug in a candleLight USB adapter and the same page talks to a real bus.
- Hack the cluster: these techniques on a real instrument cluster on a bench.
- ICSim: the Linux instrument cluster simulator that inspired this one, for practising with
can-utils. - The Car Hacker's Handbook by Craig Smith: the standard introduction.
- Training and workshops: run this as a guided session for your team, meetup or conference.