Important: This article has been deprecated. Please read Building a Password Cracking Rig for Hashcat - Part III for updated information on building modern Hashcat rigs.

In this article, we will be walking through the steps for setting up the software on your password cracking rig. If you have questions about the hardware, please refer to the first article: Building a Password Cracking Rig for Hashcat

Though there are many different configurations one could choose, we are going to make a few assumptions for this rig. For instance, we are going to use a GNU/Linux OS for this build. There are a lot of compelling reasons to do so, including increased developer support, greater number of complementary utilities for analysis and processing, and superior resource management (to name just a few items). Ubuntu is the most popularly supported GNU/Linux OS for hashcat (the main authors code on Ubuntu as well) so it only makes sense to use it here.

Additionally, I am going to cover the steps for installing both AMD and NVIDIA drivers for the sake of information, however I would strongly encourage you to use NVIDIA cards in your builds. The AMD driver stack is pretty terrible and can often be a serious pain to deal with. The new AMD cards are pretty much garbage to use for password cracking anyway. You really can't use anything passed an R9 290X. At this point, NVIDIA is really the way to go.

The rest of this article will be split into the following sections:

  • Installing Ubuntu
  • Post-Install Configuration
  • AMD Drivers
  • NVIDIA Drivers
  • Installing Hashcat

Installing Ubuntu

You can grab an ISO from Ubuntu's website and either burn a CD or copy to a USB stick for installation. When you are downloading, make sure you get the Ubuntu 14.04 x86_64 Server edition.

You might ask why 14.04, since later versions of Ubuntu exist. It all comes down to the fact that 14.04 is an LTS release (Long-Term Support), which means less things are going to break over time for your rig. This is definitely something we want. The next LTS won't be until 16.04, so there's a bit of time before you need to update.

When you boot up from your installation media, a pop-up window should open asking you to select a language. Go ahead an select English to continue.

Select install from the next screen.

Select Install

Ubuntu should now pull-up the main installation manager. You can simply follow the prompts, choosing the defaults for most options. A few notable exceptions are listed next.

Encryption for your home directory - You don't need to select this option, but feel free to do so if you'd like.

After choosing "guided - use entire disk and setup LVM" in the disk partitioning, it will ask you:

Write the changes to disks and configure LVM?

Select Yes (there may be two such messages).

Write the changes to disks? Yes

Eventually you will arrive at the package selection screen. Select the OpenSSH server (by hitting space bar), and then press enter to continue.

Select OpenSSH

After installing Grub, the system will reboot, and your new system will come up.

Post-Install Configuration

Log into your new system. The first thing you should do is update all of your system packages.

$ sudo apt-get update && apt-get upgrade

Once updating, we are going to install our system prerequisites

$ sudo apt-get install -y build-essential p7zip unrar unzip

AMD Drivers

If you are installing NVIDIA cards, you can skip ahead to the next section.

Unfortunately, AMD drivers depend on the X window system. Let's install that and the rest of the dependancies for this now.

Try not to restart your system until this guide explicitly says to. Doing so prematurely could create some complications with the install process. If you do, booting to single user mode is probably the easiest way to bypass these issues until the Catalyst drivers are installed.

$ sudo apt-get install -y xserver-xorg x11-xserver-utils xinit unity-greeter lightdm openbox dh-modaliases execstack debhelper roxterm

We may as well make sure the display is set on login

$ echo 'export DISPLAY=:0' >> ~/.bashrc

Create the lightdm configuration file /etc/lightdm/lightdm.conf, and add the following lines:

Note: remember to replace $USER with your actual username

[SeatDefaults]
greeter-session=unity-greeter
user-session=openbox
autologin-user=$USER
autologin-user-timeout=0

Next, add yourself to the nopasswdlogin group to tell lightdm that it's okay for your user to login automatically.

Note: This group is only used by lightdm, it will not affect OpenSSH logins.

$ sudo usermod -a -G nopasswdlogin $USER

Download the latest AMD video drivers (at the time of this writing, that is 15.12).

Do not download the .deb files. They can often be unstable. Let's stick with the .run files instead.

$ curl --referer "http://support.amd.com/en-us/download/desktop?os=Linux+x86" -o radeon-crimson-15.12-15.302-151217a-297685e.zip http://www2.ati.com/drivers/linux/radeon-crimson-15.12-15.302-151217a-297685e.zip

Unpack the archive and run the installer.

$ unzip radeon-crimson-15.12-15.302-151217a-297685e.zip
$ sudo ./fglrx-15.302/amd-driver-installer-15.302-x86.x86_64.run

The AMD Proprietary Driver Installer will uncompress, start-up, and prompt you with the following choices:

AMD  Proprietary Driver 15.302
1) Generate Distribution Specific Driver Package (Recommended)
2) Install Driver 15.302 on X.Org 6.9 or later 64-bit
Please choose the product to install, or Q to quit.  [1]

You should press 2 and hit enter. The install will go through, and eventually put you back at a prompt when it is complete.

If you run into the error "No write permission to h??", then you have probably rebooted your machine too soon. This issue generally arises when X is running while the installer tries to run. You can try to stop your display manager, but the easiest fix is to reboot into single user mode and try again.

Our final step is to initialize our Xorg config with settings for our GPUs.

$ sudo amdconfig --adapter=all --initial -f

At this point, you should now reboot your box!

$ sudo reboot

When it comes back up you should be presented with a blank screen and a mouse cursor. Use SSH to log back in, then run xhost to allow access to your console resources remotely.

$ xhost +

At this point, we should check your GPUs using clinfo.

$ clinfo

If all you see is your CPU, then something went wrong with your install and you must correct it before you can proceed. You should have more than one OpenCL compute device. This is usually due to a problem with the driver or a misconfiguration with Xorg. For example, perhaps you are using a slightly older GPU but trying to use the Crimson drivers.

NVIDIA Drivers

If you are installing AMD cards, feel free to skip this section.

We will start by downloading the latest GeForce drivers.

$ curl -o NVIDIA-Linux-x86_64-352.21.run http://us.download.nvidia.com/XFree86/Linux-x86_64/352.21/NVIDIA-Linux-x86_64-352.21.run

Then we will run the binary we just downloaded.

$ sudo bash NVIDIA-Linux-x86_64-352.21.run

Accept the license that will pop-up and follow the prompts.

If it asks you to register the kernel module with DKMS you can feel free to do so.

The NVIDIA installer will build for a while, and may present the following message when it finishes:

WARNING: Unable to find a suitable destination to install 32-bit compatibility libraries. Your system may not be set
         up for 32-bit compatibility. 32-bit compatibility files will not be installed; if you wish to install them, 
         re-run the installation and set a valid directory with the --compat32-libdir option.

Just click Ok to continue.

Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the
NVIDIA X driver will be used when you restart X?  Any pre-existing X configuration file will be backed up.

Choose YES for this prompt as well.

When this is finished, we can reboot!

Installing Hashcat

Download the latest Hashcat. (If you are installing AMD, replace cudaHashcat in the following examples with oclHashcat)

$ wget http://hashcat.net/files/cudaHashcat-2.01.7z

unpack

$ 7zr x cudaHashcat-2.01.7z

Let's just change into our hashcat directory and see if we can run a benchmark to test it.

$ cd cudaHashcat-2.01/

I like to make a link to the main binary (just to type less later).

$ ln -s cudaHashcat64.bin hc

And now we can try to run our benchmark.

$ ./hc -b

If everything was successful, the benchmark should begin. It takes about a half hour to finish to completion.

Once everything is setup, Hashcat should now be ready to play!

I have additional articles on this site on how to use Hashcat for those who need it. Happy hacking! (And please be responsible).