#Why this matters
Connected devices sit inside homes, factories, and hospitals, often running unattended for years. Unlike a cloud server, an IoT device exposes physical silicon, local flash storage, short-range radios, and remote cloud APIs at once. Assessing or defending these systems requires understanding how hardware, firmware, and networks fit together: a hardcoded credential in flash can compromise a cloud fleet, while an exposed debug header on a board can bypass network firewalls completely.
#Four-layer IoT architecture
Most IoT products follow a four-layer model where weaknesses at one layer often unlock another:
- 4Cloud & Companion AppsWeb APIs, mobile apps, update servers
- 3Network & TransportWi-Fi, Ethernet, BLE, MQTT, CoAP, TLS
- 2Firmware & OSBootloader, RTOS or Embedded Linux, daemons
- 1Hardware & SiliconMCU or MPU, flash memory, sensors, debug pins
For example, a shared secret in Layer 2 firmware may grant access to Layer 4 cloud APIs, while unencrypted Layer 3 wireless traffic can expose commands sent to Layer 1 actuators.
#Microcontrollers vs. Embedded Linux
Embedded devices fall into two main hardware classes: microcontrollers (MCUs) and microprocessors (MPUs) running Embedded Linux.
| Property | Microcontroller (MCU) | Embedded Linux (MPU / SoC) |
|---|---|---|
| Example cores | ARM Cortex-M, ESP32, AVR | ARM Cortex-A, MIPS, RISC-V (with MMU) |
| Memory isolation | No MMU (flat space or basic MPU) | Full MMU with per-process virtual memory |
| Storage & RAM | Internal flash (KB-MB), SRAM | External SPI flash/eMMC, DRAM (MB-GB) |
| Software stack | Bare-metal or RTOS (FreeRTOS, Zephyr) | Bootloader (U-Boot), Linux kernel, BusyBox |
| Common risks | Unprotected flash readout, flat memory | Outdated daemons, default root accounts |
An MCU runs bare-metal code or an RTOS directly from internal flash. Without a full MMU isolating processes, a memory corruption bug in one task can overwrite data across the firmware unless hardware memory protection regions are enabled. An Embedded Linux SoC initializes external DRAM via a bootloader such as U-Boot, boots a Linux kernel, and mounts a read-only root filesystem such as SquashFS, where risks often stem from legacy daemons and default /etc/shadow credentials.
#Reading datasheets and PCB markings
In an authorised lab, disconnect external power and let capacitors discharge before opening an enclosure.
Inspect the printed circuit board (PCB) and match markings to official datasheets:
- Main processor: Printed part numbers identify the silicon family (for example, STM32 Cortex-M or MediaTek MIPS).
- Flash chips: Small 8-pin or 16-pin SOIC packages near the SoC are often SPI NOR flash storing the bootloader and root filesystem.
- Unpopulated headers: Rows of 3 to 6 pads frequently expose UART serial consoles or JTAG/SWD debug ports.
- Operating voltage: Check VCC in the datasheet before attaching probes; most embedded boards use 3.3V or 1.8V logic, and 5V adapters can destroy pins.
#First-pass firmware triage
Once you extract a firmware image or obtain a lab update package, start with passive inspection on your workstation. Standard Linux utilities quickly reveal CPU architecture, endianness, and embedded strings without executing untrusted code.
$ file firmware_update.bin sensor_daemon
firmware_update.bin: Squashfs filesystem, little endian, version 4.0, compression:xz, size: 4194304 bytes
sensor_daemon: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, not stripped
$ readelf -h sensor_daemon | grep -E "Class|Data|Machine|Entry"
Class: ELF32
Data: 2's complement, little endian
Machine: ARM
Entry point address: 0x104c0Look closely at those outputs. firmware_update.bin is a little-endian SquashFS filesystem, which tells you the target runs Embedded Linux rather than a bare-metal MCU loop. sensor_daemon is a 32-bit little-endian (LSB) ARM ELF executable that is not stripped, meaning function names and debug symbols remain intact for analysis.
When file reports only data for a raw microcontroller .bin file, strings can still uncover RTOS version banners, debug log formats, or API hostnames:
$ strings -n 8 mcu_flash_dump.bin | grep -iE "rtos|mqtt|lab\.local"
FreeRTOS V10.4.6
mqtt://telemetry.lab.local:1883#Common mistakes and defensive design
- Assuming 5V logic: Connecting a 5V serial adapter or programmer to a 3.3V or 1.8V board burns out GPIO pins. Always check the datasheet and measure with a multimeter first.
- Confusing MCU blobs with Linux filesystems: Expecting
/etc/passwdinside a 256 KB Cortex-M binary wastes time; bare-metal images hold vector tables, code, and constants in one flat image. - Leaving debug symbols and consoles in production: Shipping
not strippedbinaries and active local shells makes reverse engineering and local takeover trivial. - Defences: Enable flash read-out protection (RDP) on MCUs, enforce Secure Boot with cryptographic signatures on bootloaders, strip unnecessary utilities from Embedded Linux images, and segregate IoT devices onto restricted network VLANs.
#Summary
IoT devices span four tightly coupled layers: hardware silicon, firmware or OS, network protocols, and cloud services. Microcontrollers typically run bare-metal code or an RTOS from internal flash without an MMU, whereas Embedded Linux microprocessors boot a full kernel and user space from external storage and DRAM. Careful chip identification using datasheets and passive triage with file, readelf, and strings quickly establish what target you are analysing and where its risks lie.