Skip to content
All modules
AdvancedModule 23 of 27120 minutes

Firmware, hardware and signals

Find the filesystem inside a firmware blob, read a debug interface off a board, and decode a captured signal back into bytes.

Assumes21. Reverse engineering

By the end you can

  • Locate and extract an embedded filesystem from a firmware image by signature and entropy
  • Identify the architecture and endianness of an embedded binary before disassembling it
  • Read a UART, SPI or I2C capture from a logic analyser back into framed bytes
  • Recognise what a JTAG or SWD interface offers, and why a challenge hands you one
  • Decode a captured RF or infrared transmission into its underlying symbols
  • Find hardcoded credentials and keys in an image, and explain why they cannot simply be rotated

1. Read

2. Use the tools

In the order they come up while solving. Read what each one does, or go straight to the workspace tab that runs it.

3. Try one now

Generated in your browser and checked in your browser. No account, nothing to download, and a fresh one whenever you want another.

4. Practise on the real thing

Real picoCTF challenges that use these techniques, easiest first. 16 match in total - see the full index.

Common mistakes

The wrong turns this topic reliably produces. Written as the mistake rather than the rule, because the rule is easy to agree with and easy to walk straight past.

  • Extracting a firmware image and stopping at the first filesystem. Images routinely carry several, plus a bootloader and a kernel, and the interesting one is rarely first.
  • Disassembling embedded code as x86 because the tool defaulted to it. ARM, MIPS and RISC-V all appear, and the entropy plot will not tell you which.
  • Reading a logic capture as data before setting the framing. Baud rate, bit order and idle level decide what the bytes are, and all three are guesses until confirmed.
  • Accepting whatever the unpacker extracted. It reports what it recognised, and the gap between the image size and the extracted bytes is an encrypted or unknown partition that nothing warned you about.
  • Writing up a hardcoded key as 'rotate the credential'. It is present in every device already shipped, so the honest remediation is a firmware update and a key that is not the same everywhere.

Checkpoint

From a firmware image, extract the root filesystem, find the credential or key it ships with, and state the offset and format of the container it came from.

Teaching note

Hardware challenges look inaccessible without hardware, which is untrue and worth saying in the first minute: the capture, the blob and the dump are the challenge, and they are all files. Start from a supplied capture, not from a board.

Go deeper

The lessons above are written to get you through a challenge. These are the chapters to read when you want the subject instead - each one named so you can check it rather than take our word for it. Nothing here is affiliate-linked or sold by us.

  • Practical IoT Hacking - Fotios Chantzis, Ioannis Stais, Paulino Calderon, Evangelos Deirmentzoglou, and Beau Woods

    Chapter 7, UART, JTAG, and SWD Exploitation

    What each debug interface gives you and how it is found on an unlabelled board.

  • Practical IoT Hacking - Fotios Chantzis, Ioannis Stais, Paulino Calderon, Evangelos Deirmentzoglou, and Beau Woods

    Chapter 8, SPI and I2C

    The two bus protocols behind most logic-analyser challenges, framed as captures to decode.

  • Practical IoT Hacking - Fotios Chantzis, Ioannis Stais, Paulino Calderon, Evangelos Deirmentzoglou, and Beau Woods

    Chapter 9, Firmware Hacking

    The extraction and analysis workflow this module's tools automate, done by hand once.

  • Rootkits and Bootkits - Alex Matrosov, Eugene Rodionov, and Sergey Bratus

    Chapter 16, UEFI Firmware Vulnerabilities

    Firmware as an attack surface rather than as a container, on hardware you probably own.