flashrom
Theory
Flashrom is an open-source tool used for reading, writing, verifying, and erasing flash memory chips. It supports a wide range of chipsets and is primarily used for flashing BIOS, firmware, and embedded systems. Flashrom is essential for penetration testers and hardware hackers, as it enables low-level access to the firmware of devices, allowing for potential vulnerabilities to be identified and exploited.
Key Features
Cross-Platform
Available on Linux, Windows, and macOS.
Wide Chip Support
Compatible with various flash chips and devices.
Read/Write Operations
Allows for easy backup and flashing of firmware.
Verification
Ensures that the flashing process was successful by comparing the written data with the source.
Live Flashing
Can be used to flash a system while it is running.
Cheat Sheet
Installation
To install Flashrom on different platforms, you can follow these commands:
Usage
Detecting the Chip
To detect the flash chip on a device, use:
Replace <programmer>
with the appropriate programmer (e.g., linux_spi
, internal
, etc.).
Example Bus Pirate:
Reading the Flash
To read the flash memory and save it to a file:
Writing to the Flash
To write a new firmware image to the flash:
Expected Output
When the command executes successfully, you might see output similar to the following:
Important Notes
Always ensure you have a valid backup of the current firmware before attempting to flash a new image.
Incorrectly flashing firmware can lead to bricking the device, making it inoperable.
Consult the Flashrom documentation for more detailed information and supported hardware.
Resources
https://www.flashrom.org/ https://github.com/flashrom/flashrom
Last updated