How to Install Binwalk on Ubuntu 20.04 [Step-by-Step Guide]
Designed for professionals in cybersecurity and firmware analysis, Binwalk lets you uncover and inspect binary data buried inside embedded systems. Whether you’re exploring a router firmware or inspecting embedded systems, Binwalk helps you extract and inspect hidden data. In this guide, we’ll show you how to install Binwalk on Ubuntu 20.04 step-by-step.
Prerequisites:
A non-root user with Sudo privileges.
To set up, follow our Initial server setup on Ubuntu 20.04.
[inline_post]
Install Binwalk On Ubuntu 20.04
Binwalk was developed as an open-source program and it is something between software and hardware. To analyze binary files, you can use this simple Linux tool. Binwalk extracts all the files it finds within the firmware image automatically. It is not difficult to install Binwalk. It is pre-installed on the Kali Linux Operating system. In the following steps, we’ll walk you through installing Binwalk on Ubuntu 20.04.
Before Installation Binwalk
While Binwalk supports Python 2.7 – 3.x., it does run faster in Python 3. However, most systems have Python 2.7 set as their default Python interpreter. So, you will find the installation procedures for both here:
# Python2.7
sudo python setup.py install
# Python3.x
sudo python3 setup.py install
Binwalk Quick Installation on Ubuntu 20.04
First, you need to run the command below to download Binwalk from Github.
wget https://github.com/ReFirmLabs/binwalk/archive/master.zip
unzip master.zip
Then, to install Binwalk type the following commands:
sudo apt update
sudo apt install binwalk
If you have a previously installed version of Binwalk, you are recommended to uninstall it before upgrading. So, run:
cd /binwalk-master
sudo python setup.py uninstall
sudo python3 setup.py install
Binwalk Dependencies
Binwalk doesn’t require any special dependencies to install, just make sure you have Python set up properly. There are also some optional dependencies you might need during runtime. The python-lzma module helps Binwalk perform more accurate signature scans, especially when dealing with compressed files.
Note: python-lzma module is included by default in Python 3, but you need to install it separately for Python 2.7.
sudo apt-get install python-lzma
However, Debian/Ubuntu users can use the following command to install all dependencies automatically
sudo ./deps.sh
How to install the Binwalk IDA Plugin
You can install the Binwalk IDA plugin if IDA is installed on your system.
python setup.py idainstall --idadir=/home/user/ida
Uninstall IDA plugin
also, you can uninstall the Binwalk IDA plugin by running the command below:
python setup.py idauninstall --idadir=/home/user/ida
[inline_post]
How to uninstall Binwalk on Ubuntu 20.04
If you have installed Binwalk to a standard system location like setup.py install, you can remove it by running the following commands. But it will not remove any of the manually installed dependencies.
# Python2.7
sudo python setup.py uninstall
#Python3
sudo python3 setup.py uninstall
Otherwise, use the command below to remove the packages from Linux Operating System.
sudo apt-get remove binwalk
Also, you can run the following command to remove the Binwalk package along with its dependencies:
sudo apt-get remove --auto-remove binwalk
In this way, you can remove Binwalk and all its dependent packages which are no longer needed in the system.
How to remove Binwalk with all configuration files
The command below removes the Binwalk with all configuration files and data, so you must use it with care since it is not recoverable.
sudo apt-get purge binwalk
The following command could also be used:
sudo apt-get purge --auto-remove binwalk
Conclusion
That’s it! You’ve successfully installed Binwalk on Ubuntu 20.04. You can now use it to analyze firmware files and extract embedded content like a pro.
🔐 Want a secure environment for firmware analysis? Explore our Linux VPS plans, optimized for reverse engineering and malware analysis professionals.