Binwalk is a fast tool for searching a given binary image for embedded files and executable code. It is easy to use for analyzing, reverse engineering and extracting firmware images. Binwalk is compatible with magic signatures created for the Unix file utility. Also, it includes a custom magic signature file that contained improved signatures for files. Binwalk is under MIT License and supports most platforms such as Linux, OSX, Cygwin, FreeBSD, and Windows. You will be able to install Binwalk on all of them very easily. In This article, you will learn How To Install Binwalk On Ubuntu 20.04. If you have not prepared your own Ubuntu VPS, have a look at available packages on Eldernode to find what you wish due to your needs.
Table of Contents
Tutorial Install Binwalk On Ubuntu 20.04 | Ubuntu 18.04
In this tutorial, we are trying to learn How To Install Binwalk On Ubuntu 20.04. To let this tutorial work better, please consider the below Prerequisites:
A non-root user with Sudo privileges.
To set up, follow our Initial server setup on Ubuntu 20.04.
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. So, let’s see how is the process of installation Binwalk on Ubuntu.
Before Installation Binwalk
While Binwalk supports Python 2.7 – 3.x., it does run faster in Python 3. However, the most of 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.
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
Besides a Python interpreter, there are no installation dependencies for Binwalk. But there are some optional run-time dependencies. The “python-lzma” module is using to improve the reliability of signature scans.
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
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 need 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
In this article, you learned How To Install Binwalk On Ubuntu 20.04. You have installed an important tool for a forensic analyst. If you know someone who plays CTFs, they might use this tool to analyze the files they find. Complete your Ubuntu knowledge and discuss it with your friends on Eldernode Community.
It’s misspelled:
sudo apt install binwalk ===> cd /binwalk-master; sudo python3 setup.py install.
Thanks for your attention. It was corrected.