GO KALI FREE

flashrom

Hardware Hacking

Intermediatelow risk

flashrom is a utility for identifying, reading, writing, verifying and erasing flash chips, commonly used for BIOS/EFI/firmware extraction, backup, and flashing.

Installation

sudo apt install flashrom

Basic Syntax

flashrom [options]

Quick Facts

Full Name
flashrom Utility
License
GPL v2
Language
C
Interface
CLI
Category
Hardware Hacking
Requires
Physical Access / Programmer

Tool Overview

flashrom is a universal flash programming utility used to detect, read, write, verify, and erase flash chips. It supports hundreds of chips, chipsets, and mainboards, making it the standard tool for firmware security research.

Security researchers use flashrom to extract BIOS/UEFI firmware for vulnerability analysis, implant persistent backdoors, recover bricked devices, and analyze embedded device firmware at the hardware level.

Common Commands

flashrom -LList all supported flash chips, programmers, boards, and chipsets
flashrom -p internalProbe the onboard BIOS/UEFI flash via the internal programmer
flashrom -p ch341a_spiProbe the connected chip using a CH341A USB SPI programmer
flashrom -p ch341a_spi -r backup.binRead the flash contents and save them to a backup file
flashrom -p ch341a_spi -c "MX25L6405" -r backup.binForce a specific chip when auto-detection is ambiguous
flashrom -p ch341a_spi -w firmware.binWrite an image to flash (contents are auto-verified afterward)
flashrom -p ch341a_spi -v firmware.binVerify the flash contents against a file
flashrom -p ch341a_spi -EErase the entire flash chip
flashrom -p ch341a_spi -w firmware.bin -nWrite an image but skip the automatic verify step
flashrom -p internal --flash-namePrint the detected flash chip name
flashrom -p internal --flash-sizePrint the detected flash size in bytes
flashrom -p ft2232_spi:type=2232H,port=A -r backup.binRead flash through an FT2232H-based SPI adapter
flashrom -p buspirate_spi:dev=/dev/ttyUSB0 -r backup.binRead flash using a Bus Pirate in SPI mode
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=1000 -r backup.binRead flash through the Linux spidev interface
flashrom -p serprog:dev=/dev/ttyUSB0:4000000 -r backup.binRead flash using a serprog-compatible device

Step-by-Step Guide

  1. 1Determine how you are interfacing with the memory chip
  2. 2Extract and save a complete copy of the existing data before making changes
  3. 3Compile or alter the binary file you intend to upload
  4. 4Flash the new data onto the hardware component
  5. 5Run a validation check to ensure the data wrote correctly

Warnings

Use Cases

Firmware Extraction

Extract BIOS/UEFI firmware for analysis.

Firmware Flashing

Write modified firmware to chips.

BIOS Recovery

Restore corrupted BIOS firmware.

Hardware Implants

Backdoor firmware for persistent access.

Key Features

Related Tools

Arduino

Hardware Hacking

Microcontroller programming.

Binwalk

Forensics

Firmware analysis tool.

Frequently Asked Questions

What is flashrom used for?

flashrom is used to identify, read, write, verify, and erase flash memory chips. It is commonly used for BIOS/UEFI firmware extraction, firmware flashing, and hardware security research.

Can flashrom extract firmware from locked chips?

flashrom can read most flash chips, but some have protection bits or register locks. Physical access via external programmers (CH341A, Raspberry Pi) can bypass some software protections.

What hardware programmers does flashrom support?

flashrom supports internal (on-board) programming and external programmers including CH341A, FTDI FT2232H, Raspberry Pi GPIO, Dediprog, and many more.

Is flashrom safe to use?

Reading is generally safe, but writing incorrect data can permanently brick devices. Always backup the original firmware before making any changes and verify write operations.

Tags

#hardware-hacking#firmware#bios#flash

Output Explanation

Provides terminal updates regarding hardware identification, data transfer percentages, and final checksum verifications.

Ethical Usage Notice

This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.