Lion Cipher Lab

Decode USB keyboard keystrokes from a usbmon capture: read the raw HID reports and reconstruct exactly what was typed

Why it matters

When a suspicious USB device is plugged into a machine, the only way to prove what it actually TYPED is to read the USB traffic itself. A BadUSB device — a thumb drive or cable that secretly claims to be a keyboard — works because the operating system obeys anything that says 'I am a keyboard' and injects keystrokes faster than a human could. At the wire, those keystrokes are plain 8-byte reports. Learning to capture and decode them is exactly how a forensic analyst reconstructs a malicious device's payload, and it makes the HID trust problem concrete: the computer never checks whether a…

What you'll learn

Steps in this lab

  1. What we're doing, and the words you need first
  2. Authorization first — this captures literal keystrokes
  3. Load the usbmon module
  4. Find which bus your external keyboard is on
  5. Start capturing — Wireshark or tshark
  6. Type a known short word on the external keyboard
  7. Isolate the HID Interrupt IN reports
  8. Learn the 8-byte report layout and the codes
  9. Decode your reports back into the typed text
  10. Confirm your decode matches what you typed
  11. Do it better — scripts, other dumpers, and Windows

Open the full interactive lab →