Skip to content

Lesson 3 of 14 · 20m

Reading the Chip: SPI NOR, eMMC, and NAND

Clip a CH341A onto SPI NOR, dd an eMMC block device, and survive the OOB trap in NAND dumps.

When the console is dead or the pads aren't cooperating, skip the software layer completely: read the storage chip. On most Linux-based embedded devices the firmware in flash is just bytes — no encryption, no authentication. If you can put the chip on a programmer, you have the entire image the vendor ships, including everything they forgot was in it.

SPI NOR: the easy one

The dominant flash on small embedded gear is 25-series SPI NOR — Winbond W25Q64/W25Q128, MX25L, GD25 — in an 8-pin SOIC package. The standard tooling is a CH341A USB programmer plus a SOIC-8 test clip that grabs the chip legs without desoldering.

With the board unpowered and the clip seated:

flashrom -p ch341a_spi -r dump.bin -V

Read it twice and hash both dumps — clip contact noise corrupts reads, and a corrupt dump wastes hours downstream. flashrom identifies the chip itself; if it reports "no EEPROM/flash device found," reseat the clip before anything else.

Two practical traps. Back-powering: the programmer's VCC can energize the SoC through shared rails, and a half-awake SoC fights you on the SPI bus — reads come back as noise. Fix is to desolder the chip, or hold the SoC in reset while you read. And board power: never clip a powered board.

eMMC: a disk, not a bus

eMMC is not SPI. It's an 8-bit parallel interface and you can't clip it the same way — BGA packages, dedicated readers (Allsocket-type adapters) exist but are specialty tools.

The realistic path is software: eMMC presents as a normal block device, so once you have UART root, dd if=/dev/mmcblk0 or mount it and copy the partitions off. If the board exposes USB mass-storage or a recovery mode that mounts eMMC, that's often the fastest extraction of all.

NAND: where dumps lie to you

Raw NAND — still common on bigger embedded gear — has a structural gotcha that bites everyone once. Each page carries an out-of-band (OOB) spare area: ECC bytes and bad-block markers interleaved through the data. A linear chip dump includes all of it. Carve a filesystem out of a raw dump and you get garbage every few hundred bytes.

The fix: strip OOB per page, skip blocks the bad-block table marks, then parse. Filesystem extractors help — jefferson for JFFS2, ubireader for UBIFS — but they expect sane input. UBIFS specifically wants the UBI volume structure, so extract at the volume layer, not raw pages.

What lands in your hands

A clean dump is the firmware: bootloader, kernel, root filesystems, config partitions, U-Boot environment — exactly what an analyst would download if the vendor published images, except vendors frequently don't, or publish partial update blobs. This is the acquisition path when the download page is empty or the "firmware" is a differential container.

It's also the honest baseline: the dumped image is what actually runs on the hardware, not what the release notes describe.

The wrong model this kills

"Flash" sounds opaque, like chip internals. It isn't. SPI NOR read over a programmer is a file. Every secret burned into that firmware — keys, accounts, URLs — is sitting there unencrypted on a part that costs two dollars to read. If the security story assumes the attacker can't see the image, the story already ended.

Encryption exists at this layer — ESP32 flash encryption, some eMMC schemes — but most Linux-based consumer devices never enable it, because it costs manufacturing steps and key management. Assume public until proven otherwise.

Practice

Identify the flash part from the chip marking (the part number decodes the capacity and bus). Clip or desolder, dump twice, verify hashes, run binwalk on the result. If the chip is NAND, budget the extra step for OOB stripping — and if it's eMMC, plan on getting a shell first and pulling the block device from software instead.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.