Skip to content

Lesson 3 of 13 · 20m

Dumping Firmware: SPI Flash and Physical Access

A $10 programmer, a Pomona clip, and flashrom read the real firmware off the board — which is the only copy of it you can actually verify.

The chip is the truth

The vendor's download is a promise. The 8-pin SPI NOR on the board is the fact. A W25Q128 holds 16 MB containing the descriptor, the ME region, and the BIOS region exactly as the machine runs them — including whatever a previous owner, an implant, or a failed update left behind. Every firmware audit starts by getting that chip's contents off the board.

The standard rig is a CH341A USB programmer (~$10) and a Pomona 5250 SOIC-8 clip. flashrom -p ch341a_spi -r dump1.bin reads the chip in-circuit. Two details separate a dump from garbage. First, voltage: most of these flashes are 3.3 V parts, newer boards increasingly use 1.8 V parts, and cheap CH341A boards drive their signal lines harder than 3.3 V unless modified — a 1.8 V chip needs an adapter, and a mis-leveled read produces flaky, shifting data. Second, contact: the clip sits on eight legs you cannot see clearly, and in-circuit the board's own power planes fight the programmer. Read three times. sha256sum all three. Two identical reads is data; three different reads is an electrical problem. If flashrom cannot even identify the chip, pass -c with the exact part (-c "W25Q128.V") after checking the marking — auto-detect fails often on the 1.8 V parts. Dediprog SF100 and Tigard boards are the more reliable alternatives when the CH341A rig fights you, and they are worth it once you are doing this weekly. Two more traps worth naming before the first clip: many unmodified CH341A boards feed a 3.3 V chip roughly 5 V signal levels — the resistor/level fix is a documented, five-minute rework — and WSON-8 packages have no legs for a clip at all, so they mean a socket adapter or desoldering. And a 16 MB part is minutes of patience per read on that programmer, which is why the three-read checksum habit matters: a torn read discovered at the end of a long job is normal pain, not bad luck.

You will know instantly when a read is bad: real dumps are dense and varied, failed reads come back as pages of 0xFF or 0x00 — a floating MISO line reads as ones.

The wrong mental model

"The update package is the firmware." A vendor update is a UEFI capsule: an authenticated envelope around changed volumes and blocks, applied by the capsule update path at reboot. It is not a byte-for-byte image of the chip, it contains no ME region, and it tells you nothing about what is on the board right now. Only a dump does that.

The opposite error is assuming flashrom -p internal gets you the same thing. It does not. The flash descriptor grants the host CPU access to the BIOS region and locks it out of ME and (usually) GbE — the reads fail by design. chipsec_util spi dump has the same limits. For a complete image you go external: clip on the chip with the board unpowered (or held in reset — an in-circuit read against a board that keeps trying to boot gives you torn data), or desolder to a socket when the clip will not seat. One legitimate middle path: flashrom -p internal --ifd -i bios -r bios.bin reads just the BIOS region through the descriptor's own permissions, which is enough for most DXE auditing even though ME stays unreachable.

Protection bits, or why implants stick

The descriptor also carries the write side. PR0–PR4 registers declare protected ranges, FLOCKDN locks them, and BIOS_CNTL carries BIOSWE, BLE, and SMM_BWP. The combination that matters: BLE=1 raises an SMI on BIOS-region writes so an SMM handler can arbitrate, and SMM_BWP=1 restricts writes to SMM entirely. With SMM_BWP=0, ordinary ring-0 code can rewrite the BIOS region. That is the precise misconfiguration LoJax used in 2018 to persist on machines whose disks were then reimaged. chipsec_main -m common.bios_wp reports all of it; common.spi_lock covers FLOCKDN and the PRx setup. Run it on a representative machine before you assume the fleet is write-protected.

What to actually do

Clip, three reads, checksum, then compare against the vendor image in UEFITool — the extracted volume list should match modulo NVRAM state. Keep the dump; it is your baseline and your rollback. If you maintain hardware: populate the flash socket on dev boards, standardize the CH341A rig, and check SMM_BWP/FLOCKDN in factory QA — a board that ships writable ships implantable.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.