Hashcat is an important tool to have in your tool belt (on your computer at least ^^). I already wrote several tutorials on how to use Hashcat, but today we’ll stay focus on the installation, especially on a Linux distribution like Ubuntu.
The easiest way to install Hashcat on Ubuntu is to use the package manager (APT), as Hashcat is now available in the default repositories. The installation command would be: sudo apt install hashcat.
If you are used to Linux, you know that it’s rarely that simple, so let’s take a look at each step to install hashcat on your computer.
Install Hashcat on Ubuntu via APT
Start by updating your system
New updates are released every day on Ubuntu, and to avoid conflicts, it’s always a good idea to start by updating your system, to make sure you are using the latest version available for each package.
You can either use the “Ubuntu Software” app, or simply open a terminal and type the following commands:
sudo apt update
sudo apt upgrade
Press “Y” to confirm the upgrade of all the listed packages, and wait a few minutes to get them downloaded and installed on your computer.
If, like on my screenshot, you have plenty of new packages to be upgraded, it’s probably a good idea to restart your system before going further.
Once your system up-to-date, you can simply install Hashcat with apt.
In my case, the version available in the repository is the same as on the website directly:
So, there is no need to install it manually at this point. At least, you should give it a try, and switch to the manual procedure I give later if you experience any issue doing this.
Anyway, for now, just install the main package with:
sudo apt install hashcat
This should install all the dependencies (something like 60 other packages on a fresh Ubuntu installation).
Type your user password and press “Y” to confirm the installation.
Note: If you have an NVIDIA GPU on your computer, you should also install the corresponding package for better performances:
sudo apt install hashcat-nvidia
Use Hashcat on Ubuntu
Hashcat is now installed on your Ubuntu system. You can use the command directly in a terminal:
You can for example run a benchmark to make sure everything is working properly:
I’m testing this procedure on a virtual machine for you, which is not optimized at all, but you get the idea. If you get any error doing this test, you probably need to install additional drivers for your GPU, or just use the CPU which should work natively (it’s generally slower though).
As stated on the hashcat website, each GPU require different prerequisites:
AMD GPUs on Linux require “RadeonOpenCompute (ROCm)” Software Platform (3.1 or later)Source: Hashcat
Intel CPUs require “OpenCL Runtime for Intel Core and Intel Xeon Processors” (16.1.1 or later)
NVIDIA GPUs require “NVIDIA Driver” (440.64 or later) and “CUDA Toolkit” (9.0 or later)
On Ubuntu, it should be a problem as you can easily get them. It might be more difficult on Debian or other systems, as the manufacturers are often not supporting all Linux distributions.
From there, I recommend reading this article to learn how to use hashcat on Ubuntu (or any other system). I explain the different attack modes, and take an example with some MD5 hashes. But the idea is the same with any algorithm once you understand the basics.
Install Hashcat on Ubuntu with the binaries files
If for any reason you prefer to install Hashcat manually on Ubuntu, here is the procedure you can follow instead of using APT:
- Go to the Hashcat website, and get the link to the binaries file.
You can either download it directly from your web browser, or use the command line:
wget https://hashcat.net/files/hashcat-126.96.36.199zDon’t forget to change the file version with the latest one available on the website.
- Extract the file from your file explorer (right-click > extract here):
Or do it from a terminal with:
7z <filename>You may need to install 7zip first, with:
sudo apt install p7zip-full
- Then, open a terminal, and move to the new folder.
Probably something like:
- And run the hashcat benchmark with:
At this point, you’ll likely get an error, as some CPU or GPU runtime will be missing:
The previous installation method with APT will do this for you, but in this case you have to install the missing requirements manually.
In my case, the easiest way to fix this was to use apt to install these two packages:
sudo apt install ocl-icd-libopencl1 pocl-opencl-icdBut the solution will be different if you have an NVIDIA or AMD GPU. Check this page for more details for each scenario.
Anyway, I hope this tutorial was useful, and helped you to get started with Hashcat on Ubuntu.
You should now be ready to experiment cool things with this tool, check my other tutorials for more details: