Published on Jan 04, 2025
Last updated on Apr 11, 2025
How to Use Binwalk on Kali Linux for Firmware Analysis

Binwalk is one of the tools often used in the world of cybersecurity to perform firmware analysis. Binwalk is used to extract files contained in firmware, be it disk images, binary files, or other hardware. This tool is very useful for cybersecurity professionals and researchers in performing reverse engineering and security analysis of firmware-based devices.
In this article, we will discuss how to use Binwalk on Kali Linux, the steps for installation, and some basic techniques for using it.
Installing Binwalk on Kali Linux
Before starting to use Binwalk, make sure that you have installed this tool on Kali Linux. Kali Linux is an operating system that is already equipped with many tools for security analysis, including Binwalk. However, if Binwalk is not installed, you can follow these steps to install it:
- Update repositories
Make sure your Kali Linux system is updated by running the following commands:
sudo apt update
sudo apt upgrade
- Installing Binwalk
To install Binwalk, simply run the command:
sudo apt install binwalk
- Verifying Installation
Once the installation is complete, you can verify that Binwalk has been installed correctly by running:
binwalk --version
If successful, you will see the version of Binwalk installed on your system.
Basic Binwalk Usage
Binwalk is used to analyze firmware files and binary files. To get started, you need to have the firmware file you want to analyze. Usually the file has the extension .bin
, .img
, or other formats used by the hardware or software.
Once you have the firmware file, here are some basic ways to use Binwalk:
- Show File Structure
To see the file structure of your firmware, run the command:
binwalk firmware.bin
This command will display various information about the firmware file, including offsets, data types, and possible components contained in the file, such as compressed data or system files.
- Extract Files from Firmware
One of Binwalk’s main features is its ability to extract files from the firmware. If you want to extract the components detected in the firmware file, you can use the -e
option as follows:
binwalk -e firmware.bin
Binwalk will extract the files into a separate directory, with a structure that is easier to analyze later.
- Viewing Text Strings in Firmware
If you want to search for text strings contained in a firmware file, you can use the command:
binwalk -S firmware.bin
This will help you find texts contained in the firmware, which can be very useful for finding information such as passwords, device names, or other metadata.
Advanced Binwalk Options
In addition to basic usage, Binwalk also has some advanced options that allow you to perform more in-depth analysis. Here are some of the options you can use:
- Analyzing File Headers
To analyze the header of a file in the firmware, you can use the -A
option:
binwalk -A firmware.bin
This option will try to check the format of the file headers contained in the firmware and provide information about the type of file or other components contained.
- Checking Encryption and Compression
Binwalk can also detect whether the firmware is compressed or encrypted. To do this, you can use the --dd
option followed by the type of data you want to search for:
binwalk --dd='gzip' firmware.bin
This option will search for and extract any gzip compression detected in the firmware.
- Using Verbose Mode
To get more detailed information about the analysis process, you can use the -v
option to run Binwalk in verbose mode:
binwalk -v firmware.bin
This verbose mode will provide more details about each step that Binwalk performs during the analysis process.
Binwalk Use Case Example
Let’s look at an example of using Binwalk on a firmware file from an IoT device. For example, you have a firmware file named router_firmware.bin
and you want to analyze it.
The first step is to display the basic structure of the file with the command:
binwalk router_firmware.bin
Binwalk will show the components contained in the firmware, such as compressed data or certain file systems.
Then, to extract the detected files, run:
binwalk -e router_firmware.bin
As a result, Binwalk will create a folder named router_firmware.bin.extracted
containing the detected files and ready for further analysis.
If you want to search for deeper system or compression files, you can use additional options such as --dd
or -A
to analyze more deeply.
Conclusion
Binwalk is a very powerful tool for analyzing firmware and other binary files in Kali Linux. With features such as automatic extraction, header search, and the ability to detect encryption or compression, Binwalk is very useful for security professionals and researchers in analyzing hardware and software.
Using Binwalk effectively can help you find vulnerabilities, as well as understand how a device or firmware functions. However, to truly harness its potential, it is important for you to continue honing your analytical skills and understand more in-depth reverse engineering techniques.
That’s all the articles from Admin, hopefully useful… Thank you for stopping by…