An embedded device assessment starts where network testing stops: with the physical device on the bench. The board tells you what the software hides: debug headers left populated, a UART console that drops to a root shell, flash chips readable in circuit, bootloaders that accept unsigned images, and keys stored in cleartext. This skill covers a repeatable methodology for authorized lab work: teardown and board analysis, safe debug access over UART and JTAG or SWD, firmware extraction from flash and update files, and review of hardware rooted trust including secure boot, key storage, and debug lockdown. Work only on devices you own or have written permission to test. Photograph and label everything before you modify it, and keep a device that must stay working intact.
Quick Workflow
- Record the device as received: model, firmware version, serial number if present, and photos of all sides and labels.
- Do external recon first: open ports, web panels, update files, and mobile apps, before opening the case.
- Open the case carefully, photograph the board, and identify the main processor, flash, RAM, and debug headers.
- Map power and ground with a multimeter before connecting any adapter, and confirm voltage levels (3.3 V versus 1.8 V).
- Find the UART console, capture the full boot log, and check for bootloader and shell access.
- Identify JTAG or SWD pins, confirm with a debug scan, and use debug access only where the scope allows it.
- Extract firmware from flash or update files, verify the dump, and inventory its contents.
- Review hardware rooted trust: secure boot chain, signature checks, key storage, and whether debug ports are locked.
- Write findings per layer (board, bootloader, firmware, trust) with the exact commands and evidence for each.
1. Teardown and board analysis
Teardown is evidence collection, not destruction. Every marking you record now saves an hour of guessing later, and a clean photo set lets you reassemble the device if a test goes wrong.
# Lab notes template: fill in one file per device, before powering it
cat > lab_device_notes.md << 'EOF'
# Device under test
- Model and revision:
- Firmware version (from label, UI, or boot log):
- Main processor (markings):
- Flash chip (part number, size, package):
- RAM chip (part number, size):
- Debug headers and test points (labels, pin counts):
- Power input and measured rail voltages:
- Photos taken (file names):
EOF
cat lab_device_notes.md
# Identify chips from markings with a quick reference check
# Search vendor datasheets by the exact part number on the chip
echo "Look up each part number in the vendor datasheet before probing"
Identify the flash chip type before choosing an extraction method: SPI NOR flash is usually an 8 pin SOIC chip readable with a clip, NAND flash needs a dedicated reader and error correction, and eMMC storage needs a different adapter entirely. If the flash is under a shield or ball grid package, note that and plan for a software extraction path first.
2. UART console access
The UART console is the most common debug path on IoT hardware. Find the transmit pin by watching for boot text, then capture the whole boot log before interacting with the console.
# List serial adapters on the lab host
ls /dev/ttyUSB* /dev/ttyACM* 2>/dev/null
# Try common baud rates against the suspected TX pin
# Connect adapter GND to board GND, adapter RX to board TX only
for baud in 115200 57600 38400 9600 230400; do
echo "=== trying $baud ==="
timeout 4 picocom -b $baud --imap lfcrlf /dev/ttyUSB0 2>/dev/null | head -5
done
# Once the baud rate is known, capture the full boot log
picocom -b 115200 --imap lfcrlf /dev/ttyUSB0 2>&1 | tee boot_log.txt
Read the boot log for: bootloader name and version, kernel command line, filesystem type, services started, and any login prompt or shell. Try interrupting the bootloader with the key it names (usually a keypress during a countdown), and check whether the console gives a shell, a login prompt, or nothing at all. If the console drops to a shell, record the user and privilege level, and do not change persistent settings on a device that must be returned in working order.
3. JTAG and SWD debug access
JTAG and SWD let a debugger halt the processor, read registers, and dump memory. They are powerful and risky: halting a running device can corrupt state, so use them on lab devices, with a saved firmware image to restore from.
# Scan for a debug target with OpenOCD (adjust interface and target)
openocd -f interface/ftdi/ft2232h.cfg \
-f target/stm32f4x.cfg \
-c "init; scan_chain; exit" 2>&1 | tee jtag_scan.txt
# Halt the CPU and read a memory region you are authorized to read
openocd -f interface/ftdi/ft2232h.cfg \
-f target/stm32f4x.cfg \
-c "init; halt; dump_image lab_ram.bin 0x20000000 65536; resume; exit"
# Verify the dump is not empty and record its hash
ls -la lab_ram.bin
sha256sum lab_ram.bin
xxd lab_ram.bin | head -10
If the scan finds no target, check the pinout first: swapped TDI and TDO, a missing ground, or a wrong voltage level are more common than a locked device. If the scan finds a target but access is denied, that is itself a finding about debug lockdown: record the exact error, since locked debug ports are a positive control worth reporting. Never force voltage into a pin you have not identified.
4. Firmware extraction
Extract firmware the easy way first: official update files, then UART or debug access, then direct flash reading. Each path needs the same verification step: read twice, compare hashes, and only then analyze.
# Path A: unpack an official update file
file vendor_update.bin
binwalk vendor_update.bin | head -20
binwalk -e -C fw_extract vendor_update.bin
find fw_extract -maxdepth 3 | head -30
# Path B: read SPI flash in circuit with a clip programmer
flashrom -p ch341a_spi -r flash_dump_1.bin
flashrom -p ch341a_spi -r flash_dump_2.bin
sha256sum flash_dump_1.bin flash_dump_2.bin
cmp flash_dump_1.bin flash_dump_2.bin && echo "dumps match"
# Carve the verified dump and inventory what it contains
binwalk flash_dump_1.bin | head -30
binwalk -e -C flash_carved flash_dump_1.bin
find flash_carved -maxdepth 4 -type f | head -40
# List readable filesystems and check for credentials and keys
grep -ri "password\|passwd\|secret\|private key" \
flash_carved/ 2>/dev/null | grep -v Binary | head -20
Treat anything found in extracted firmware as sensitive: hard coded credentials, private keys, API tokens, and backend URLs all belong in the report in redacted form, with the file path and offset where each was found. A single hard coded credential that works across the fleet is a fleet finding, not a device finding.
5. Hardware rooted trust review
Hardware rooted trust is the chain that decides what the device will run: a boot ROM verifies the bootloader, the bootloader verifies the kernel, and each stage refuses unsigned or modified images. Review each link and test what happens when one is broken, on lab devices only.
# Inventory the trust chain from the boot log and firmware analysis
grep -iE "secure boot|verified boot|signature|hash|trust|fuse" \
boot_log.txt | head -30
# Check firmware images for signatures and version metadata
binwalk -e -C fw_extract vendor_update.bin 2>/dev/null
find fw_extract -type f -name "*.sig" -o -name "*manifest*" \
-o -name "*.json" | head -20
# Check for rollback protection: does the device record a version
# counter, and does it refuse an older signed image?
# Record the version field found in the image header or manifest
python3 - << 'PY'
import struct
with open("vendor_update.bin", "rb") as fh:
header = fh.read(64)
print("header hex:", header.hex())
print("first 16 bytes as words:", struct.unpack("<4I", header[:16]))
PY
Test the chain deliberately: try booting a modified image on a lab device and record whether it boots, refuses, or bricks. Check key storage separately: are keys in a secure element or trusted platform module, in one time programmable fuses, or in readable flash? Check debug lockdown last: are UART consoles disabled in production builds, are JTAG fuses blown, and does the bootloader still accept unsigned commands? A device with signed firmware but an open root console has no effective trust chain, and the report should say so plainly.
# Trust review evidence checklist
# 1. Boot ROM verification: present, absent, or unknown
# 2. Bootloader signature check: enforced or bypassable
# 3. Firmware update signature check: enforced, with rollback guard
# 4. Key storage: secure element, fuses, or readable flash
# 5. Debug ports: open, password protected, or fused off
# 6. Modified image test: booted, refused, or bricked (lab only)
ls -la boot_log.txt flash_dump_1.bin fw_extract/ 2>/dev/null
Edge cases
- Voltage mismatch destroys boards: a 5 V adapter on a 1.8 V or 3.3 V UART pin can damage the target, so measure rails with a multimeter before connecting anything.
- In circuit flash reads can fail while the processor runs: if flashrom reads garbage or the hashes differ, hold the processor in reset or power the flash independently before retrying.
- Some devices brick on modified images: only test modified boot images on devices you can restore, with a verified firmware dump saved first.
- Boot logs can be disabled in production builds: silence on UART is not proof of security, so check JTAG lockdown and firmware signing separately.
- Encrypted firmware limits analysis: measure entropy and check for a key in a secure element or update manifest before assuming the image is unanalyzable.
- Desoldering is destructive: prefer clip reads and software extraction, and get explicit approval before removing any chip.
- Evidence handling matters: keep original dumps read only, work on copies, and record hashes so findings can be reproduced.
Key references
- OpenOCD user guide, covering interface configuration, target configuration, scan chain inspection, and memory dump commands.
- flashrom documentation, covering supported programmers, SPI flash operations, and verification workflows.
- binwalk documentation, covering signature scanning, carving, and filesystem extraction from firmware images.
- NIST SP 800-193, Platform Firmware Resiliency Guidelines, covering firmware protection, detection, and recovery.
- ARM Platform Security Architecture and Trusted Board Boot documentation, covering secure boot chains and key provisioning.
- OWASP IoT Top 10 and IoT Security Testing Guide, covering hardware assessment methodology and common device weaknesses.
- Vendor datasheets for the specific processor and flash parts under test, which are authoritative for pinouts and voltages.
