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.

Quick Reference Commands

Verified quick-reference commands for flashrom
CommandPurpose
flashrom -RPrint version information.
flashrom -LList supported chips and programmers.
flashrom -p dummy:emulate=W25Q128FV -r test.binRead an emulated chip for offline learning.
flashrom -p ch341a_spiProbe through a CH341A programmer after wiring validation.
flashrom v1.8 manual

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
flashrom -p internal --ifd -i bios -r bios.binRead only the BIOS region using the Intel Flash Descriptor layout
flashrom -p internal --fmap -i COREBOOT -r coreboot.binRead a region defined by an embedded fmap
flashrom -p internal -l layout.txt -i bios -w firmware.binWrite only the region named bios from a custom layout file
flashrom -p ch341a_spi -l layout.txt -xExtract each region defined by the layout into its own file
flashrom -p ch341a_spi --progress -w firmware.binShow a progress percentage while writing
flashrom -p ch341a_spi -o flashrom.log -r backup.binLog the full operation output to a file
flashrom -p internal --wp-statusShow the current write protection status
flashrom -p internal --wp-disableDisable flash write protection
flashrom -p internal --wp-range=0x0,0x80000Set a write-protected range on the chip
flashrom -p dummy:emulate=W25Q128FV -r test.binExercise flashrom against an emulated chip with the dummy programmer
flashrom -p ch341a_spi -V -r backup.binRead with verbose output for debugging

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

Arduino IDE and tools for programming microcontrollers used in hardware hacking, BadUSB attacks, and IoT testing.

Binwalk

Forensics

Learn how to use Binwalk to scan a firmware image, read the signature table, extract embedded filesystems, and spot encrypted regions — a beginner tutorial for Kali Linux.

MSFVenom

Exploitation

MSFVenom is a standalone payload generator and encoder utility within the Metasploit Framework, first introduced in Metasploit 4.0 (2015) to replace the legacy msfpayload and msfencode tools with a single unified interface. It enables security professionals, penetration testers, and students to create, customize, and encode payloads for multiple platforms including Windows, Linux, macOS, Android, and PHP. MSFVenom is widely used in CTF competitions, security training labs, authorized penetration testing engagements, and red team operations to generate reverse shells, Meterpreter payloads, shellcode, and encoded executables. Understanding MSFVenom helps both offensive and defensive security professionals learn payload construction techniques, encoding methods, and detection strategies used in modern cybersecurity.

ADB

Reverse Engineering

ADB, or Android Debug Bridge, is a versatile command-line tool that acts as a client-server program, facilitating communication between your development machine (the client) and an Android device (running the adbd daemon) via a server process binding TCP port 5037. It ships as part of the Android SDK Platform Tools, and on Kali Linux, it's available as the `android-tools-adb` package. ADB is the standard device bridge for Android mobile pentesting and forensics, enabling actions like deploying Frida servers, pulling APKs, and capturing detailed logcat output for analysis.

ExifTool

Forensics

ExifTool is a platform-independent tool for reading, writing, and editing metadata in a wide variety of files including images, audio, and video.

Frida

Reverse Engineering

Frida is a dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers. It allows you to inject snippets of JavaScript or your own library into native apps on various platforms — making it the industry standard for runtime analysis and mobile app security testing.

Related Cybersecurity Guides

Ethical Hacking · Intermediate

Reverse Engineering for Beginners: Learn to Analyze Binaries with Ghidra & GDB

Learn reverse engineering from scratch: analyze binaries with Ghidra and GDB, read assembly, crack a practice binary, and build a starter toolkit.

Security · Beginner

Social Engineering Awareness: Understanding and Defending Against Human Hacking

Learn about social engineering attacks including phishing, pretexting, and manipulation techniques with defense strategies.

Web Security · Intermediate

API Hacking Guide: How to Test APIs for Security Flaws (BOLA, JWT & GraphQL)

Learn API hacking step by step: discover endpoints, test authentication and authorization, find BOLA flaws with a worked crAPI example, test JWTs and GraphQL, and report findings — with tools, a cheat sheet and a checklist.

Security · Intermediate

Brute Force Attacks: How They Work and How to Defend

Learn about brute force attacks, their variations, tools used, and comprehensive defense strategies including rate limiting, lockouts, and password policies.

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.