Skip to content
Pwnversity
OT-HARDWAREadvanced · 5 min · upd. 2026-10

Hardware hacking (UART, JTAG)

Physical access to an embedded device’s hardware opens debug interfaces (UART, JTAG/SWD) and memory chips that often grant full access: a root console, firmware dumping, and memory read/write. It’s the starting point of many IoT analyses (IoT pentest, Firmware analysis).

  • The attacker owns the device: they can buy it, open it, and solder wires to it; hardware is never “out of scope”.
  • Unprotected factory interfaces: UART/JTAG left active in production give a root shell or processor control without authentication.
  • Unencrypted flash: dumping the SPI flash reveals the full firmware with its secrets (Firmware analysis).
  • Cleartext secrets: keys and credentials in memory or flash, not in a secure element.
  • One compromised device = compromised model: what’s learned on one unit is reused against the whole fleet.
  • UART: serial console (TX/RX/GND); often gives a root SHELL or the boot log. You identify the pins and baud rate and connect a USB-TTL adapter.
  • JTAG: debug and boundary scan (TDI/TDO/TCK/TMS); full processor control.
  • SWD: 2-pin variant of JTAG (typical on ARM Cortex-M).
  • Locating the pins: PCB inspection, chip datasheet, and tools like JTAGulator or a logic analyzer.
  • SPI flash: stores the firmware; can be DUMPED with a SOIC clip + programmer (CH341A) in-circuit or by chip-off, reading it with flashrom.
  • eMMC/NAND: larger storage; more complex to dump (needs a specific reader or desoldering).
  • Dumping the flash equals obtaining the firmware for analysis (Firmware analysis).
flowchart TB
    A["Open and inspect the PCB (datasheets)"]
    B["Locate UART/JTAG/SWD (test points, JTAGulator)"]
    C["UART: find baud rate → console/boot log"]
    D["Direct root shell?"]
    E["Dump SPI flash (clip + flashrom)"]
    F["JTAG/SWD (OpenOCD): read/write memory"]
    G["Firmware → analysis"]
    A --> B --> C --> D
    B --> E --> G
    B --> F --> G
    D -->|"yes"| G
  • Adapters: USB-TTL (UART), Bus Pirate, JTAG adapters compatible with OpenOCD.
  • Diagnostics: multimeter, logic analyzer (Saleae or clones), JTAGulator to map pins.
  • Memory: SOIC8 clip, SPI programmer (CH341A), flashrom.
  • Software: OpenOCD (JTAG/SWD), minicom/screen (serial), Ghidra for the binaries (Static reversing).
  • Recon the PCB: identify the SoC, the flash, and the test points from datasheets before soldering anything.
  • UART first: usually the fastest path to a console; find the baud rate and connect USB-TTL.
Ventana de terminal
# connect to the serial console (UART) from Linux
screen /dev/ttyUSB0 115200
# alternative
minicom -D /dev/ttyUSB0 -b 115200
  • Dump the SPI flash with flashrom to extract the firmware.
Ventana de terminal
# dump a SPI flash with a CH341A programmer (your own device)
flashrom -p ch341a_spi -r dump.bin
binwalk -e dump.bin # extract the rootfs and continue in Firmware analysis
  • JTAG/SWD with OpenOCD to read/write memory, bypass protections, or debug.
  • Chain: a root shell via UART or a flash dump feeds the firmware analysis and, from there, the jump to the cloud (IoT pentest).
  • Disable or blow fuses on UART/JTAG in production, or protect them with authentication.
  • Encrypt the firmware in flash and use secure boot (dumping the flash must not reveal secrets).
  • Per-device secrets in secure elements (TPM/secure element), not in cleartext flash.
  • Tamper detection on high-value devices.
  • Countless devices give a root shell via UART without authentication (a de-facto physical backdoor).
  • Dumping SPI flash to extract firmware and keys: routine in IoT research.
  • Bypassing secure boot via JTAG or implementation flaws has broken consoles and closed devices.
  • Open and document the PCB; identify chips (datasheets)
  • Locate UART/JTAG/SWD (test points, JTAGulator)
  • UART: find baud rate and access console/boot log
  • Dump the SPI flash (clip + programmer) → firmware (Firmware analysis)
  • JTAG/SWD with OpenOCD: read/write memory
  • Look for secrets and protections (secure boot, flash encryption)
  • All on your own device / with authorization