Category Archives: cracking

How to run hashcat on Windows Subsystem for Linux

If you don’t know how to run hashcat on Windows Subsystem for Linux, meaning that you want to use the Linux bash command line interpreter directly on your Windows desktop, there is a possibility to get the full potential out of hashcat and the OpenCL acceleration of your GPU (nVidia, AMD) .

This tutorial assumes that you already have the Windows Subsystem for Linux installed on your Windows 10 system.

If you don’t have it, just do the following:

  • Click the Windows 10 start button
  • Search for “turn Windows features on or off”. Open it.
  • Locate “Windows subsytem for Linux”. Check it.
  • Click, OK/Apply
  • Reboot
  • Go to the Windows Store and search for Ubuntu, Kali Linux or any other Linux distro you find there.
  • Install it!
  • You are ready to continue.
Installing the Windows subsytem for Linux.
Installing the Windows subsytem for Linux.

Now, truth be told, there are simpler ways to run hashcat: directly on a Linux or Windows host.

This can be achieved by downloading and installing the latest hashcat release from the hashcat website and by installing the latest nVidia or AMD driver.

So, if you just like to over-complicate things or you need something to work on (like me), just follow along.

The first step that I did, as any normal Linux user would, I installed hashcat and the nVidia drivers directly from the bash shell:

sudo apt install hashcat nvidia-384 

The installation went smoothly, but hashcat would not recognize the GPU and this was not acceptable to me because the GPU (GTX 1060 M) is 10 times faster than my Intel i9 CPU.

So what I ended up doing was to download the latest hashcat release directly to my Windows Desktop. Unpack the archive (using 7zip).

And now comes the weird part. Did you know that the Windows Subsystem for Linux can run Windows binaries out of the box? I didn’t. Until now.

So what I ended up doing was to run the Windows hashcat binary directly from bash. Confusing, isn’t it?

Here’s me navigating to the Windows hashcat binary folder and running the crack session:

cd /mnt/c/Users/nixware/Desktop/hashcat-5.1.0
./hashcat64.exe -a 0 -m 5100 C:/Users/nixware/Desktop/hashcat-5.1.0/test.hash d:/wordlists/wordlist.txt -w 3 --status
Running hashcat on the Windows subsytem for Linux.
Running hashcat on the Windows subsytem for Linux.

As you can see, you will find your C: or D: drives in /mnt directory of the Windows Subsystem for Linux.

As for the cracking speed of the GPU via the subsytem and bash, I can confirm that there is no difference between running directly on a Linux/Windows guest system and the Windows Subsystem for Linux.

If you receive an “Token length exception” error, please check this article.

And that is it. Happy cracking session

Posted in BASH, cracking, hashcat, How to. Tagged with , .

Token length exception – no hashes loaded in hashcat

Trying to crack any kind of hash (SHA1, MD5, etc) and you receive the “Token length exception – no hashes loaded” error in hashcat?

The easiest way to fix this error is to edit the file that contains the hashes, with a text editor like Sublime for Linux or Notepad++ on Windows, use the “Save with encoding” option (Sublime) and specify UTF-8 as the encoding.

This should fix the error and get you underway with your hashcat cracking session, regardless of the hashing algorithm or the attack mode (bruteforce, wordlist, etc).

If this doesn’t work, then you might have blank spaces at the end of each hash line, so delete those spaces.

Happy cracking session!

Posted in cracking, hacking.