Hardware Hacking
When network and firmware analysis aren't enough, hardware-level access can provide root shells, memory dumps, and complete device compromise through debug interfaces.
Physical Access Required
Hardware Attack Decision Tree
Scroll sideways to see the whole diagram
Essential Equipment
Basic Kit ($50-100)
- USB-TTL UART adapter (FTDI/CH340)
- Multimeter
- Precision screwdriver set
- Jumper wires (dupont)
- Soldering iron + accessories
- Magnifying glass/loupe
Advanced Kit ($200-500+)
- Logic analyzer (Saleae or clone)
- JTAG adapter (J-Link, Bus Pirate)
- SPI/I2C programmer (CH341A)
- Hot air rework station
- USB microscope
- Oscilloscope (for glitching)
| Interface | Pins | Purpose | Difficulty |
|---|---|---|---|
| UART | TX, RX, GND | Serial console / shell | Easy |
| JTAG | TDI, TDO, TCK, TMS | Debug / memory dump | Medium |
| SPI | MOSI, MISO, CLK, CS | Flash chip read/write | Easy |
| I2C | SDA, SCL | EEPROM / config read | Medium |
| eMMC | CLK, CMD, DAT0-7 | Full storage dump | Hard |
Buy the adapter before the rework station. A USB-TTL adapter and a multimeter answer most of the questions on this page for the price of a cable, and the probe order follows the cost of finding out: each cheaper interface either succeeds or tells you that the next one is needed. The rework station comes last in practice because it is the only step that can destroy the unit.
UART (Universal Asynchronous Receiver-Transmitter)
UART is the most common debug interface on IoT devices. It often provides direct console access, sometimes with root privileges.
Identifying UART Pins
UART typically has 4 pins:
+-------------------------------------+
| VCC (3.3V or 5V - don't connect) |
| GND (Ground - always connect) |
| TX (Transmit - connect to RX) |
| RX (Receive - connect to TX) |
+-------------------------------------+
Identification methods:
1. Look for 4-pin headers (may be unpopulated)
2. Look for test pads labeled TX/RX/GND
3. Use multimeter to find GND (continuity to shield)
4. TX often shows fluctuating voltage on boot# Finding UART pins with multimeter:
# 1. Set multimeter to continuity mode
# 2. Find GND (continuous with metal shield/ground plane)
# 3. Set to DC voltage mode
# 4. Power on device, measure each pin vs GND:
# - VCC: Steady 3.3V or 5V
# - TX: Fluctuates during boot (data being sent)
# - RX: Steady high (3.3V) or floating
# Using logic analyzer to identify:
# Connect all unknown pins and watch during boot
# TX will show serial data patternsFinding the pins is a measurement rather than a guess: GND by continuity to the shield, then the two lines that move on boot. A pin sitting at a steady 3.3 V may be RX or an unused pull-up, and the boot log is the discriminator — the line that emits data during boot is TX on the device, so it goes to RX on the adapter. Photograph the header with the probes in frame, because a report that cannot show which pad was probed cannot be reproduced.
Connecting to UART
# Wire connections (USB-TTL adapter to device):
# Adapter GND -> Device GND
# Adapter RX -> Device TX (cross-connect!)
# Adapter TX -> Device RX
# DO NOT connect VCC (power device separately)
# Find baud rate (common rates: 9600, 19200, 38400, 57600, 115200)
# Using baudrate.py
python baudrate.py
# Or try common rates manually with minicom/screen
# Connect with screen
screen /dev/ttyUSB0 115200
# Connect with minicom
minicom -D /dev/ttyUSB0 -b 115200
# Connect with picocom (recommended)
picocom -b 115200 /dev/ttyUSB0
# Windows: Use PuTTY
# Serial line: COM3 (check Device Manager)
# Speed: 115200Cross the data lines and leave the power alone. The adapter's RX goes to the device's TX and the adapter's TX to the device's RX, while VCC stays disconnected so the device keeps its own supply; feeding a 5 V adapter into a 3.3 V rail is a quick way to end the engagement. The baud rate is discovered rather than assumed — sweep the common rates and keep the one that produced clean output, since a wrong rate gives readable-looking noise rather than nothing.
UART Exploitation
# Common scenarios after UART connection:
# 1. Direct root shell (best case)
# Device boots directly to:
# root@device:~#
# 2. Bootloader access (U-Boot common)
# Interrupt boot with key press, then:
U-Boot> printenv # Show environment variables
U-Boot> setenv bootargs init=/bin/sh # Boot to shell
U-Boot> boot
# 3. Login prompt
# Try default credentials:
# root:root, admin:admin, root:(blank), admin:password
# 4. Boot log only (no interaction)
# Still valuable - shows services, IPs, kernel version
# Breaking into locked bootloader
# Some bootloaders allow command injection:
U-Boot> setenv bootargs 'init=/bin/sh'
U-Boot> run bootcmdThe four outcomes are graded differently. A root prompt is a shell-access finding; a bootloader prompt is stronger still, because it can change the boot arguments or reflash the image; a login prompt is a credential question rather than an access one; and a boot log with no prompt is disclosure, which is worth recording anyway because it names the kernel, the services and often the cloud endpoint the device expects. Read the uid before calling any shell root.
JTAG (Joint Test Action Group)
JTAG provides low-level chip access for debugging, memory access, and firmware extraction. More powerful than UART but harder to use.
JTAG Pinout
Standard JTAG pins:
+-------------------------------------+
| TDI - Test Data In |
| TDO - Test Data Out |
| TCK - Test Clock |
| TMS - Test Mode Select |
| TRST - Test Reset (optional) |
| GND - Ground |
| VCC - Reference voltage |
+-------------------------------------+
Common JTAG headers:
- 20-pin ARM standard
- 14-pin TI
- 10-pin Cortex
- Unpopulated pads (need to solder)# Finding JTAG pins
# Use JTAGulator hardware
# Or use OpenOCD with trial and error
# OpenOCD configuration example
openocd -f interface/ftdi/ft232r.cfg -f target/stm32f1x.cfg
# Common OpenOCD commands
> halt # Stop processor
> reg # Show registers
> mdw 0x08000000 # Read memory (word)
> dump_image flash.bin 0x08000000 0x100000 # Dump flash
> load_image new_fw.bin 0x08000000 # Write flash
# Using JTAGulator to find pins
# Connect all potential pins
# JTAGulator will try combinations to identify JTAG
# ARM debugging with GDB
arm-none-eabi-gdb
(gdb) target remote localhost:3333
(gdb) monitor halt
(gdb) x/100x 0x08000000 # Examine memoryJTAG is the interface to reach when UART gives a log and no prompt. It stops the processor, so it reads memory the running system never exposes and dumps the flash without removing the chip, at the cost of a pinout that has to be discovered rather than read: the combination sweep is what JTAGulator automates, and an unpopulated pad array is the usual place the pins turn out to be. Confirm detection before reading anything, and log the target configuration that worked.
SPI Flash Extraction
Many IoT devices store firmware on SPI flash chips. These can be read directly to extract firmware.
The flash chip is usually the most readable part of the board: an eight-pin SOIC with a documented pinout and a programmer that costs less than the screwdriver set. Read it twice and compare the hashes before trusting the result, because an in-circuit read can come back with bits held by a neighbouring component, and a corrupted dump that still lists files is the most expensive kind of wrong. Record the offset and length of the region read, so a partial read is not mistaken for a full image.
Identifying SPI Flash
# Common SPI flash chips:
# - Winbond W25Q series (W25Q32, W25Q64, W25Q128)
# - Macronix MX25L series
# - Spansion S25FL series
# - Look for 8-pin SOIC packages
# SPI pinout (8-pin):
# Pin 1: CS (Chip Select)
# Pin 2: DO (Data Out / MISO)
# Pin 3: WP (Write Protect)
# Pin 4: GND
# Pin 5: DI (Data In / MOSI)
# Pin 6: CLK (Clock)
# Pin 7: HOLD
# Pin 8: VCCReading SPI Flash
# Method 1: In-circuit reading (chip stays on board)
# May have issues with other components interfering
# Using flashrom with CH341A programmer
flashrom -p ch341a_spi -r firmware_dump.bin
# Using Bus Pirate
flashrom -p buspirate_spi:dev=/dev/ttyUSB0 -r dump.bin
# Method 2: Chip removal (more reliable)
# Use hot air to desolder chip
# Place in SOIC8 clip or socket
flashrom -p ch341a_spi -r firmware.bin
# Verify read (read twice and compare)
flashrom -p ch341a_spi -r firmware1.bin
flashrom -p ch341a_spi -r firmware2.bin
md5sum firmware1.bin firmware2.bin
# If using Raspberry Pi
# Enable SPI: sudo raspi-config
flashrom -p linux_spi:dev=/dev/spidev0.0 -r dump.binI2C / eMMC
I2C EEPROM
# I2C uses 2 wires: SDA (data) and SCL (clock)
# Common for small configuration storage
# Using Bus Pirate for I2C
# Connect SDA, SCL, GND
screen /dev/ttyUSB0 115200
# Enter I2C mode: m4
# Scan for devices: (1)
# Read EEPROM: [0xA0 0x00][0xA1 r:256]
# Using i2c-tools on Linux/Pi
i2cdetect -y 1 # Scan bus 1
i2cdump -y 1 0x50 # Dump device at 0x50
i2cget -y 1 0x50 0x00 # Read single byteeMMC Extraction
# eMMC is common in newer devices (like SD card but soldered)
# Requires eMMC reader or careful soldering
# Using eMMC adapter (requires chip removal or adapter board)
# Mount as block device
lsblk
sudo dd if=/dev/sdb of=emmc_dump.img bs=4M status=progress
# Some devices have eMMC test points
# Check for CLK, CMD, DAT0 pads near chip
# Alternative: Use device's own interface
# Some devices expose eMMC via USB in special boot modes
# Check for "download mode" or "recovery mode"eMMC is the point where the equipment changes. Reading it needs a socket, an adapter board or a removal, and the result is a full storage image rather than a flash region, which is the same caution at a larger scale: verify the hash and know what range you read. Some devices expose the same storage over USB in a recovery mode, which is worth checking before any soldering, and a storage dump carries user data as well as firmware, so the handling rules agreed for the engagement apply to the copy from the moment it exists.
Voltage Glitching
Advanced technique to bypass security by causing processor faults. Can bypass secure boot, authentication, and encryption checks.
Advanced Technique
# Basic concept:
# 1. Identify target operation (e.g., signature check)
# 2. Determine timing of operation
# 3. Inject voltage glitch at precise moment
# 4. Glitch causes instruction skip or incorrect result
# Tools:
# - ChipWhisperer (hardware + software framework)
# - Custom FPGA glitchers
# - PicoEMP (electromagnetic fault injection)
# ChipWhisperer example workflow:
# 1. Connect target and capture power traces
# 2. Identify vulnerable code section
# 3. Configure glitch parameters (width, offset)
# 4. Iterate until successful bypass
# Common targets:
# - Secure boot signature verification
# - Password/PIN checks
# - Encryption key verification
# - Debug lock bitsA glitch result is a rate before it is a finding. One successful fault injection proves a fault was possible once, and what a reader needs is how many attempts produced it out of how many, on which build, with which parameters. Short of that the result describes the attempt rather than the device, and a secure-boot bypass that only appears on a bench unit with the clock slowed is a different claim from one that works on deployed hardware.
An Interface Plus an Artefact
A hardware finding is an interface plus an artefact, and the interface is the half a reader cannot reconstruct. Name the pads or the header, the adapter, the baud rate or clock that worked and how GND was established, because a console session the client's own engineer cannot repeat is a story rather than a result. The board revision matters as much as the model: a later PCB can move a header, change the flash package or omit the test points altogether.
Access level is a separate claim from access. A boot log with no prompt, a bootloader prompt, an unprivileged shell and a root shell are four outcomes, and reading the uid is what separates the last two. Where a header exists but the shipping firmware leaves it inert, the honest note is a design observation: debug interfaces left on production boards are a decision, and one that is disabled is a decision in the other direction.
Record what you changed, including the parts that are easy to forget: solder, clips, a reflash, a restored bootloader and the state the unit went back in. A board pulled from a drawer is a different unit with possibly different firmware, so hash both before comparing them, and a console produced by QEMU is not the hardware at all. Photographs close the file — board overview, header close-up and probe placement — because they are what lets the next engineer follow the same path.
Hardware Checklist
Initial Assessment
- ☐ Open device and photograph PCB
- ☐ Identify main chips (SoC, flash, RAM)
- ☐ Look for debug headers (UART, JTAG)
- ☐ Check FCC photos for component IDs
UART
- ☐ Locate UART pins (GND, TX, RX)
- ☐ Determine baud rate
- ☐ Connect and capture boot log
- ☐ Attempt shell access or bootloader interrupt
Flash Extraction
- ☐ Identify flash chip model
- ☐ Attempt in-circuit read
- ☐ Desolder and read if needed
- ☐ Verify dump integrity
Hardware Hacking Labs
Practice hardware debugging interfaces and chip extraction.
Evidence Collection
Device and board: Make, model, PCB revision, and the SoC and flash part numbers from the silkscreen.
Interface used: UART, JTAG, SPI, I2C or eMMC, with the pad or header location, the adapter, and the baud rate or clock that worked.
Captured artefact: Boot log, memory dump or flash image, hashed, with the offset range read.
Access level: Console, bootloader prompt or read-only dump, and the uid the shell ran as.
Modification record: What was soldered, clipped or reflashed, and how the device was restored or retained.
Photo reference: Board overview, header close-up and probe placement, matched to the timeline.
False Positives
- Read-only console: A boot log with no prompt is disclosure, not shell access.
- Header present, debug disabled: An inert header on shipping firmware is a design note.
- Emulated interface: A QEMU console is not the hardware.
- Dump from a spare unit: A drawer board may carry a different build; hash both.
- A single successful glitch: One success needs repetition and a stated rate.
Interface Checklist
Open and identify
- ☐ Photograph the board before touching anything, including the shielding.
- ☐ Record SoC, flash, and RAM part numbers from the silkscreen.
- ☐ Note every header, test pad, and unpopulated footprint.
Connect
- ☐ Find GND by continuity, never by guesswork, and leave VCC disconnected.
- ☐ Sweep baud rates on UART and record the one that produced clean output.
- ☐ Confirm JTAG detection before reading memory, and log the OpenOCD target used.
Extract
- ☐ Read flash twice and compare hashes before trusting the dump.
- ☐ Record the offset and length of the region read.
- ☐ Restore or retain the device as agreed, and photograph the final state.
Remediation
Hardware design
- • Omit or disable debug headers on production boards, and set debug lock bits as part of manufacture rather than as an optional step.
- • Where a header must stay for service, protect it with a physical barrier and a documented access process.
Firmware and boot
- • Enable secure boot with signature verification, and store keys off the readable filesystem.
- • Require authentication on the serial console and disable bootloader interrupts in release images.
Network
- • Treat a device recovered from a console shell as compromised: rotate its credentials and check its cloud identity before it returns to service.
Verification schedule
- • Confirm debug lock bits on a sample from each hardware batch, and re-test one unit after any PCB revision.