Kali Linux 1.0.7 kernel 3.14 install NVIDIA driver kernel Module CUDA and Pyrit – CUDA, Pyrit and Cpyrit-cuda
In this guide, I will show how to install NVIDIA driver kernel Module CUDA, replace stock Pyrit, and install Cpyrit. The main problem with new Kali Linux 1.0.7 running Kernel 3.14 was that it broke Pyrit and cudaHashcat. When you try to run pyrit command, you get this error
ERROR: could not insert ‘nvidia_uvm’: Invalid argument
. I will show how to install all the necessary drivers, modules and also fix this error. At the end of this guide, you will be able to use GPU acceleration for enabled applications such as cudaHashcat, Pyrit, crunch etc.CUDA Toolkit
The NVIDIA® CUDA® Toolkit provides a comprehensive development environment for C and C++ developers building GPU-accelerated applications. The CUDA Toolkit includes a compiler for NVIDIA GPUs, math libraries, and tools for debugging and optimizing the performance of your applications. You’ll also find programming guides, user manuals, API reference, and other documentation to help you get started quickly accelerating your application with GPUs. You can read a lot more here in NVIDIA Developers official webpage:
Prerequisites
Following are the prerequisite before you start following this guide:
NOTE: This guide does not apply to VMWare, VirtualBox users. GPU Acceleration doesn’t work on Virtual environment.
Prerequisite 1: add Official Kali Linux repository.
I’ve added the correct Kali Official repositories and issued the following commands to update, upgrade and dist-upgrade my Kali Linux.
apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y
Prerequisite 2: Install proprietary NVIDIA driver on Kali Linux
I’ve installed the correct official proprietary NVIDIA driver on Kali Linux – NVIDIA Accelerated Linux Graphics Driver using the previous guide:
- Kali Linux 1.0.7 kernel 3.14 – Install proprietary NVIDIA driver – NVIDIA Accelerated Linux Graphics Driver
If you’ve completed both, move to next instruction.
Step 1: Install NVIDIA CUDA toolkit and openCL
At first we need to install NVIDIA CUDA toolkit and NVIDIA openCL
aptitude install nvidia-cuda-toolkit nvidia-opencl-icd
This will install CUDA packages in your Kali Linux. The total package is pretty large including dependencies, (282MB something), you be patient and let it finish.
Step 2: Download Pyrit and Cpyrit
Download Pyrit and Cpyrit from the official website:
Save them in your
/root
folder. Alternatively you can just run the wget commands I’ve used below:wget https://pyrit.googlecode.com/files/pyrit-0.4.0.tar.gz
wget https://pyrit.googlecode.com/files/cpyrit-cuda-0.4.0.tar.gz
Step 3: Install Pyrit
Follow the instructions below to install Pyrit and it’s prerequisites.
Step 3.a: Install Pyrit prerequisites
apt-get install python2.7-dev python2.7-libpcap libpcap-dev
Step 3.b: Remove existing installation of Pyrit
Remove stock Pyrit using the following command:
apt-get remove pyrit
We used to get a message stating that it will also remove
kali-linux-full
package. Seems on Kali Linux 1.0.7 it’s fixed.If you are not using a clean install of Kali (not recommended), you may need to issue the following command:
rm -r /usr/local/lib/python2.7/dist-packages/cpyrit/
Step 3.c: Install new Pyrit
Copy paste the following commands to extract downloaded Pyrit in your Kali Linux
/root
directorytar -xzf pyrit-0.4.0.tar.gz
cd pyrit-0.4.0
Now build the package
python setup.py build
Once build is complete, you can install Pyrit.
python setup.py install
Up to this point, you shouldn’t receive any errors.
Step 4: Install CPyrit-cuda
Copy paste the following commands to extract downloaded CPyrit-cuda in your Kali Linux
/root
directorytar -xzf cpyrit-cuda-0.4.0.tar.gz
cd cpyrit-cuda-0.4.0
Now build the package
python setup.py build
Once build is complete, you can install CPyrit-cuda.
python setup.py install
Again, you shouldn’t receive any errors, if there’s error, go back and review each steps.
Step 5: Fixing ERROR: could not insert ‘nvidia_uvm’: Invalid argument
Now that we’ve installed NVIDIA driver kernel Module CUDA and Pyrit on Kali Linux, we should be able to test it. The best way to test is by issuing the following command:
pyrit list_cores
This gave me an error
ERROR: could not insert ‘nvidia_uvm’: Invalid argument
root@kali:~# pyrit list_cores
ERROR: could not insert ‘nvidia_uvm’: Invalid argument
Pyrit 0.4.0 (C) 2008-2011 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+
The following cores seem available…
#1: ‘CPU-Core (SSE2)’
#2: ‘CPU-Core (SSE2)’
#3: ‘CPU-Core (SSE2)’
#4: ‘CPU-Core (SSE2)’
Thankfully, reader Shinri provided us with a fix. A BIG thanks to Shinri who spent time and effort to find the fix and was kind enough to post it back on my website.
Thanks Shinri.
Step 5.a Recompile NVIDIA Driver
First of all you need to recompile NVIDIA driver. Just follow the steps below:
cd /usr/src/nvidia-current-331.67
make
What you’re doing here is going to source directory for NVIDIA current driver and recompiling it. By recompiling, you ensure it’s aligned for your hardware.
Step 5.b: Copy Module.symvers to UVM and recompile UVM
Now copy the compiled Module.symvers file to UVM folder and recompile UVM.
cp Module.symvers uvm/
make -C uvm
Step 5.c: Copy nvidia-uvm.ko to correct DKMS folder
We’re now very close. Just copy the compiled nvidia-uvm.ko to correct DKMS folder.Use the following command:
cp uvm/nvidia-uvm.ko /lib/modules/`uname -r`/updates/dkms
Those who are interested can read through this really long Debian bug report and envy the hard work done to find this solution.
Debian Bug report logs – #746643
Step 6 – Test Pyrit – It works!
Once you’ve followed Shinri’s solution, recompiled NVIDIA driver, UVM and copied it to correct DKMS folder, pyrit will just work.
root@kali:~# pyrit list_cores
Pyrit 0.4.0 (C) 2008-2011 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+
The following cores seem available...
#1: 'CUDA-Device #1 'GeForce 210''
#2: 'CPU-Core (SSE2)'
#3: 'CPU-Core (SSE2)'
#4: 'CPU-Core (SSE2)'
Step 7 – Install oclHashcat (cudaHashcat)
The reason you’ve done all the hard work so that you can use cudaHashcat. I found that Kali 1.0.7 Kernel 3.14 doesn’t install that by default (maybe that was the case in every version). Doesn’t matter, we can just install it quickly.
Use the following command to install OCLhashcat (which contains cudaHashcat too)
apt-get install oclhashcat oclhashcat-plus
Step 8 – Missing cudahashcat in Kali 1.0.9 problem and fix
staticn0de provided a .deb file that you can install manually which installs cudahashcat for you. Link to Original Post below:
I’ve only copy-pasted his instructions below, all credit goes to staticn0de, thank you.
root@kali:~# dpkg -i cudaHashcat-1.30.deb
Selecting previously unselected package cudahashcat-1.30.
(Reading database ... 349321 files and directories currently installed.)
Unpacking cudahashcat-1.30 (from cudaHashcat-1.30.deb) ...
Setting up cudahashcat-1.30 (1.30) ...
root@kali:~# optirun cudahashcat64 -t 32 -a 7 example0.hash ?a?a?a?a example.dict
cudaHashcat v1.30 starting...
I have taken the archive from the hashcat site and modified it under section 6 of their EULA. The deb installs the program is
/usr/share/cudahashcat
and places scripts in /usr/bin
which calls hashcat like any other command.I’ll upload it tonight for anyone that wants to use it. Provided as is with no expectation it will work and it may cause damages including death and your wife leaving you (tic) but you get the idea.
Weighs in at 172mb
SHA1SUM
f2c0d96c75d1c186b48e11c5b399f3e2ccc5e459
f2c0d96c75d1c186b48e11c5b399f3e2ccc5e459
when installed, its called with ‘
cudahashcat64
‘ for 64bit or ‘cudahashcat32
‘ for 32 bit.This was the most annoying download link … the amount of spams and popups and redirection was appalling.
Note that this is custom package, built by someone else than Kali Dev team and you should use it at your own risk.
Then again, with recent openSSL and Bash blunder, yeah.. use EVERYTHING in Linux at your own risk.
Once all done, run a cudahashcat benchmark
Bug report for missing cudahashcat in Kali 1.0.9
In the meantime, I’ve taken the liberty of reporting this missing cudahashcat as a Bug report.
Hopefully, it will be fixed in next release (i.e. Kali v1.0.10).
Conclusion
Pyrit allows to create massive databases, pre-computing part of the IEEE 802.11 WPA/WPA2-PSK authentication phase in a space-time-tradeoff. Exploiting the computational power of Many-Core- and other platforms through ATI-Stream, Nvidia CUDA and OpenCL, it is currently by far the most powerful attack against one of the world’s most used security-protocols.
If you’re reading this post and this helped, PLEASE put a comment “Thanks Shinri” in the comment section. That’s the least we can do.I guess a big thanks goes to staticn0de as well, feel free to post “Thanks staticn0de” if everything works for you.
Comment’s doesn’t require any signin/registration … so help yourself.
Thanks for reading. If this guide helped you to install NVIDIA driver kernel Module CUDA and Pyrit on Kali Linux 1.0.7 kernel 3.14 – CUDA, Pyrit and Cpyrit-cuda, please share this article and follow me in Facebook/Twitter.
0 comments:
Post a Comment