Pyrit is one of the most useful security tool to crack WPA or WPA2-PSK passphrase, simply a powerful wi-fi password hacking tool.
Why it's crazy fast ? Because it uses the processing power of multicore CPU, SSE2 CPU extension, OennCL platform on Radeon GPUs, CUDA platform on NVDIA GPUs or the Padlock cryptographic accelator of VIA CPUs.
In this tutorial we are going to install and configure pyrit with CUDA to take the advantage of massive parallel processing power of the NVIDIA GPU. Here is the system configuration
- Hardware: CPU Intel Core i5 2410M, GPU NVIDIA GeForce GT 540M
- OS: Debian testing, currently stretch
- Kernel version: Linux 4.2.1-2
- NVIDIA driver version: 340.93
- CUDA toolkit version: 6.5.14-2
Contents
1. Install nvidia drivers and minimal cuda
CUDA is not supported with the opensource nouveau drivers, we have to install propitiatory nvidia drivers to get nvidia cuda working. If you have a NVIDIA Optimus system, check this detailed article about installing and configuring nvidia optimus in Debian/Kali Linux.
Installing nvidia drivers
Before installing anything, you must have to enable the non-free repository, to do so, put the line bellow in the /etc/apt/sources.list
file
deb http://ftp.debian.org/debian/ stretch main contrib non-free
Change the word stretch according to your disrto, like if you are using the Kali Linux, replace the above line with suitable Kali Linux repository URL. If you are not sure what I’m talking about, have a look at there and check out how to add the non-free repository.
sudo apt-get update sudo apt-get install gcc make linux-headers-amd64 sudo apt-get install nvidia-kernel-dkms nvidia-xconfig nvidia-settings sudo apt-get install nvidia-vdpau-driver vdpau-va-driver mesa-utils
Install minimal cuda
After rebooting, Just run this command bellow, this will install a minimal version of CUDA, less packages and fast installation.
sudo apt-get --no-install-recomands install nvidia-cuda-toolkit
Link the cuda install directory to /usr/local, this is step is necessary,
sudo ln -s /usr/lib/nvidia-cuda-toolkit/ /usr/local/cuda
2. Install various development headers
Various development header files are necessay to compile pyrit from sorce, lets install them.
sudo apt-get install python2.7-dev libssl-dev zlib1g-dev libpcap-dev
3. Download latest pyrit and cpyrit-cuda
Pyrit is hosted on google code, Download it from there,
cd ~/ wget -c https://pyrit.googlecode.com/files/pyrit-0.4.0.tar.gz wget -c https://pyrit.googlecode.com/files/cpyrit-cuda-0.4.0.tar.gz
NOTE: It seems that pyrit development is stalled, and it is available as a read-only project at google code.
4. Compile and install pyrit
tar -xf pyrit-0.4.0.tar.gz cd cd pyrit-0.4.0/ python setup.py build sudo python setup.py install
These commands will bulid and install the pyrit, with CPU only support, lest test run pyrit
pyrit -help # prints a help message
pyrit list_cores
This command should return a result something like bellow,
Now run a benchmark test, and save the results for future reference, my system got about 1660 PMKs/s with a Core i5 CPU.
pyrit benchmark
5. Compile and install cpyrit-cuda
Cpyrit-cuda is a pyrit extension, written in C and used as a loadable shared library. With this, pyrit tekes advantage of the NVIDIA GPU to significantly speed up the whole cracking processs. Lets install cpyrit cuda,
tar -xf cpyrit-cuda-0.4.0.tar.gz cd cpyrit-cuda-0.4.0/ python setup.py build sudo python setup.py install
installation is complete, now again test pyrit with cuda compatibility.
pyrit list_cores
Alternetively if you have a laptop with nvidia optimus GPU like me, run this command
optirun pyrit lsit_cores
These command should return a result with a recognized cuda capable device.
6. Pyrit CUDA benchmark testing
A benchmark test will clearly show the advange of GPU based cracking. The performance differance between GPU based and only CPU based cracking is surprising, lets check it out
pyrit benchmark
optirun pyrit benchmark # for NVIDIA optimus systems
Compare the results with the previous CPU only benchmark, it was about 4.4 times faster than the CPU alone. My system got about 7340 PMKs/s with a NVIDIA GeForce GT540M GPU.
7. Few tips
I got some performance boost with pyrit if the system running a lightweight desktop environment like LXDE, LXQt or Openbox. It's simply because the CPU has to do less with a lightweight desktop.
7. Troubleshooting
After extensive bug reporting and bug fixing, now compiling and installing pyrit and cpyrit-cuda is really smooth and easy.
Both Debian and Kali Linux 2.0 don't complain about anything while compiling it. I faced no problem with a Debian testing system, if you have any problem/bug, please let me know, leave a comment here.
So that's it, the whole installation process is pretty straight forward. I hope this guide will help you, if you find this article useful, don't hesitate to share it with your friends.
debi says
you have a typo there ! I am wonder how ppl follow it if that wont do anything at all ? sudo apt-get --no-install-recomands install nvidia-cuda-toolkit
notice the "recomands" !? > recommends !!!!!
xen says
I have a problem building the cpyrit... i think it is happening because of the new version of gcc 6 and Cuda 8 incompatibility...
It fails when we are trying to do the #python setup.py build/install with the following error:
ERROR: No supported gcc/g++ host compiler found, but clang-3.8 is available.
Use 'nvcc -ccbin clang-3.8' to use that instead.
Traceback (most recent call last):
File "setup.py", line 168, in
setup(**setup_args)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
self.run_command('build')
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
self.run_command(cmd_name)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 91, in run
subprocess.check_call(nvcc_cmd, shell=True)
File "/usr/lib/python2.7/subprocess.py", line 186, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/usr/local/cuda/bin/nvcc -m64 -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu' returned non-zero exit status 1
Any workaround?
Arnab Satapathi says
Thanks for pointing that out, I've not tried CUDA 8 yet, I think respective forums of CUDA and Pyrit are the best place to get the workarounds.
Also please drop another comment if you've managed to compile pyrit with any kind of work around.
And I'm wondering why nvcc switched to clang from gcc.
Joseph says
NVCC does not support GCC 6 you will have to downgrade your GCC version , i have encountered this issue to .
if someone can tell me how to downgrade a GCC / G++ version i would highly appreciate that
Joseph says
NVCC did not switch, it suggested that you should switch, i tried compiling with clang but no luck.
I will post if I found a workaround
Joseph says
I HAVE SUCCESSFULLY CONFIGURED CUDA .
THE SOLUTION :
i downgraded my GCC and G++ versions to 4.9\
HOW I DID IT ? :
go to debian packages (google it)
and download g++ 4.9 and gcc 4.9 .
configure them using :
sudo dpkg -i PKGNAME ; sudo apt-get install -f
replace PKGNAME with the package name .
you will get dependencies error . go to the debian packages site again and look at gcc 4.9 , you can see it has dependencies . look for the dependency you need ( according to the error you got in the terminal ) and install it ,
you will have to do it with several of dependencies , it will take sometime but in the end you will be able to enjoy pyrit with CUDA computing , believe me its worth it .
BTW : do the same for G++ , install it , check for dependencies error
install the dependencies ( and the dependecies's dependencies ) and in the end recompile the pyrit 5.01 as mentioned above by Aamer Shareef .
FINALLY AFTER 3 days and 3 sleepless nights i was able to configure CUDA to finalllly work !
Lumos says
"sudo apt-get install nvidia-kernel-dkms nvidia-xconfig nvidia-settings
sudo apt-get install nvidia-vdpau-driver vdpau-va-driver mesa-utils"
it crashed my Kali Linux(
Arnab says
I'm not sure what's wrong, but you should give it a try without the
nvidia-xconfig
andnvidia-settings
packages.Crashed ? No GUI ?
Aamer Shareef says
For anyone facing the issues with cpyrit cuda, follow these steps:
uninstall pyrit: apt-get remove pyrit
1. download the fresh stable release from
https://github.com/JPaulMora/Pyrit/releases
install the latest pyrit version
2. change the config file
nano ~/.pyrit/config
3. enter this line at the end of the file
use_CUDA = true
save and exit
run "optirun pyrit benchmark" and see your gfx card at its full potential ! 😀
you dont need to install cpyrit cuda, the latest release makes it easier to use the CUDA cores if your nvidia card supports it.
Hope this helps! 🙂
Running kali linux - kernel 4.8
note: do not use apt-get upgrade at the beginning of this tutorial ( you can upgrade later if you need, but it contains many unstable packages) if you are using the latest kali sana 2016.2.
install the latest linux image, "apt-get install linux-image-4.8*"
"apt-get install linux-headers-4.8*"
and then proceed with the tutorial.
If you have any issues with the bumblebeed service not starting at boot, type
nano /etc/rc.local
add "service bumblebeed start" before the "exit 0" line
save and exit
reboot and enjoy!
Arnab says
Thanks Aamer for your feedback, and your desire to share with people ! I too hope this helps others.
Aamer says
You are welcome Arnab. There still seems to be some issue with the method that I posted above. The work around would be to use the latest pyrit 0.5.1 from the Pyrit-Master branch in git. After performing a clean install ( using python setup.py clean and later building and installing ) and edit the config file as stated above. Go ahead and perform a clean install of cpyrit cuda (in the modules folder ). This should work. Tested on a fresh copy of kali sana on kernel 4.8.
Arnab says
Man ! Thanks again ! I'm lacking the time and disk space to test it myself, I'll definitely do that within few days and will update this tutorial.
Suvajit says
Hey why don't you make a youtube channel
That is much better
Arnab says
I started with 2G internet, that why ! Thanks !
Huy says
Hey. I’m getting this error when i building cpyrit-cuda:
python setup.py build
svn: E155007: '/root/cpyrit-cuda-0.4.0' is not a working copy
running build
running build_ext
Skipping rebuild of Nvidia CUDA kernel ...
Building modules...
building 'cpyrit._cpyrit_cuda' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-EkQe1J/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/cuda/include -I/usr/include/python2.7 -c _cpyrit_cuda.c -o build/temp.linux-x86_64-2.7/_cpyrit_cuda.o -Wall -fno-strict-aliasing -DVERSION="0.4.0"
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/cpyrit
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-EkQe1J/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-EkQe1J/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/_cpyrit_cuda.o -lcrypto -lcuda -lz -o build/lib.linux-x86_64-2.7/cpyrit/_cpyrit_cuda.so
/usr/bin/ld: cannot find -lcuda
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Arnab says
Yeah, the code is not compaitable with latest pytho, CUDA and NVIDIA drivers, I'll update the tutorial soon.
h says
I have the same issue:
python setup.py build
svn: E155007: '/root/cpyrit-cuda-0.4.0' is not a working copy
running build
running build_ext
Compiling CUDA module using nvcc 8.0, V8.0.44...
Executing '/usr/local/cuda/bin/nvcc -m64 --host-compilation C -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu'
nvcc fatal : Unknown option '-host-compilation'
Traceback (most recent call last):
File "setup.py", line 176, in
setup(**setup_args)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
self.run_command(cmd_name)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 101, in run
subprocess.check_call(nvcc_cmd, shell=True)
File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/usr/local/cuda/bin/nvcc -m64 --host-compilation C -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu' returned non-zero exit status 1
Arnab says
Hi, thanks for informing this problem.
Perhaps Pyrit 0.4 series code is too old to fit with CUDA 8.x and latest python, I'll give it a try !
karma says
And what's the solution?
Pyrit is 0.5.1 and cpyrit-cuda is 0.5.0. Maybe it's work with version 0.5.0 pyrit?
Thanks
karma says
Thanks for responding me.
And i should install the Cpyrit of this link too?
karma says
I had install pyrit 0.5.1 and cpyrit 0.5.0 of the github/PaulMoura.
But CUDA-Device don't appears.
root@kali:~/Pyrit/modules/cpyrit_cuda# python setup.py build
running build
running build_ext
Skipping rebuild of Nvidia CUDA kernel ...
Building modules...
root@kali:~/Pyrit/modules/cpyrit_cuda# python setup.py install
running install
running build
running build_ext
Skipping rebuild of Nvidia CUDA kernel ...
Building modules...
running install_lib
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/cpyrit_cuda-0.5.0.egg-info
Writing /usr/local/lib/python2.7/dist-packages/cpyrit_cuda-0.5.0.egg-info
root@kali:~/Pyrit/modules/cpyrit_cuda# pyrit list_coresPyrit 0.5.1 (C) 2008-2011 Lukas Lueg - 2015 John Mora
https://github.com/JPaulMora/Pyrit
This code is distributed under the GNU General Public License v3+
The following cores seem available...
#1: 'CPU-Core (SSE2/AES)'
#2: 'CPU-Core (SSE2/AES)'
#3: 'CPU-Core (SSE2/AES)'
#4: 'CPU-Core (SSE2/AES)'
#5: 'CPU-Core (SSE2/AES)'
#6: 'CPU-Core (SSE2/AES)'
#7: 'CPU-Core (SSE2/AES)'
#8: 'CPU-Core (SSE2/AES)'
root@kali:~/Pyrit/modules/cpyrit_cuda#
Arnab says
Yes you've to install it from the git hub repo, as in your case, pyrit and cpyrit versions are mismatched, perhaps it's the reason of CUDA device is not detected.
karma says
Hey. I'm getting this error when i building cpyrit-cuda:
root@kali:~/cpyrit-cuda-0.4.0# python setup.py build
svn: E155007: '/root/cpyrit-cuda-0.4.0' is not a working copy
running build
running build_ext
Compiling CUDA module using nvcc 8.0, V8.0.44...
Executing '/usr/local/cuda/bin/nvcc -m64 --host-compilation C -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu'
nvcc fatal : Unknown option '-host-compilation'
Traceback (most recent call last):
File "setup.py", line 175, in
setup(**setup_args)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
self.run_command(cmd_name)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 100, in run
subprocess.check_call(nvcc_cmd, shell=True)
File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/usr/local/cuda/bin/nvcc -m64 --host-compilation C -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu' returned non-zero exit status 1
help me pls
Arnab says
Most probably the pyrit sourcecode is old enough to mismatch with the current python version.
Read more about latest pyrit here> https://github.com/JPaulMora/Pyrit
Tito says
After these commands:
sudo apt-get update
sudo apt-get install gcc make linux-headers-amd64
sudo apt-get install nvidia-kernel-dkms nvidia-xconfig nvidia-settings
sudo apt-get install nvidia-vdpau-driver vdpau-va-driver mesa-utils
and then restarting, i simply get an error that is basically means that the os has a problem and cannot launch, I tried this multiple times (after formatting and reinstalling the os correctly and following the tutorial again) but each time i do it and reboot I cant log on anymore, please reply ASAP!
-Thanks
Arnab says
Seems to be a graphics related problem, as Gnome can't be started without 3D acceleration. If you're using a desktop, plug the VGA or HDMI cable to the on-board graphics output.
When graphics is not working, you can use the Alt + Ctrl + F1/F2/F3 keys to launch a virtual console (tty), then run commands.
Try after removing any existing Xorg.conf file from /etc/X11/ folder.
Tito says
What's the command for removing any existing Xorg.conf file from /etc/X11/ folder
Sorry, I'm a newb at linux
Arnab says
Laptop or desktop ? Don't install nvidia-xconfig and nvidia-setting .
xorg.conf could be located at many locations, try to find them at
/etc/xorg.conf > a file
/etc/X11/xorg.conf > a file
/etc/X11/xorg.conf.d/ > a fold
Use the rm command to remove the desired file.
Tito says
no such file or directory
I am using a laptop
i7 4510U
GeForce 820m
8gb ram
1tb
Using a live usb with persistence on kali linux 2016.2
Arnab says
It's some wired problem with Gnome 3 and GDM, which I never used. I think it's better to move this question to Kali forum.
Vlad says
Sure. On Debain 8 everything is working!
:~$ dpkg-query -s nvidia-driver
Package: nvidia-driver
Status: install ok installed
Priority: optional
Section: non-free/x11
Installed-Size: 1025
Maintainer: Debian NVIDIA Maintainers
Architecture: amd64
Source: nvidia-graphics-drivers
Version: 340.96-1
optirun ./hashcat64.bin -b
hashcat (v3.10) starting in benchmark-mode...
OpenCL Platform #1: NVIDIA Corporation
======================================
- Device #1: GeForce GT 750M, 1023/4095 MB allocatable, 2MCU
Hashtype: MD4
Speed.Dev.#1.: 1223.0 MH/s (95.57ms)
Hashtype: MD5
Speed.Dev.#1.: 911.5 MH/s (95.74ms)
Arnab says
As of Kali rolling, the whole system should be updated frequently with
sudo apt-get dist-upgrade
.To update only nvidia drivers only securely>> Just make sure you have all the kali repos including security ones in your sources.list file, then run
sudo apt-get update && sudo apt-get --reinstall install nvidia-driver bumblebee-nvidia
Vlad says
Arnab, thanks for the help! Solved. After Manualy re-install hashcat from source-code, hashcat is work! But now, hashcat does not see Intel GPU, any idea? How i can install "OpenCL Runtime 14.2 on Kali?
root@kl56vv:~# optirun hashcat -b
hashcat (v3.10) starting in benchmark-mode...
OpenCL Platform #1: NVIDIA Corporation
======================================
- Device #1: GeForce GT 750M, 1023/4095 MB allocatable, 2MCU
OpenCL Platform #2: Mesa, skipped! No OpenCL compatible devices found
Hashtype: MD4
Speed.Dev.#1.: 1324.0 MH/s (95.77ms)
Hashtype: MD5
Speed.Dev.#1.: 870.6 MH/s (96.03ms)
Hashtype: Half MD5
Speed.Dev.#1.: 592.4 MH/s (95.78ms)
Hashtype: SHA1
Speed.Dev.#1.: 138.5 MH/s (94.53ms)
Hashtype: SHA256
Speed.Dev.#1.: 105.7 MH/s (95.79ms)
Hashtype: SHA384
Speed.Dev.#1.: 26161.9 kH/s (96.12ms)
Arnab says
Hey Vlad, it's great that you figured it out, hope you also learnt a lot.
No Idea how to install that, it will be better if you provide me some more info.
Vlad says
Hi! Thank's for the guide! Pyrit is work, but i have problems with 'hashcat'. Can you help me? Please...
hashcat -b
hashcat (v3.00) starting in benchmark-mode...
ERROR: clGetDeviceIDs() : -1 : CL_DEVICE_NOT_FOUND
optirun hashcat -b
hashcat (v3.00) starting in benchmark-mode...
ERROR: clGetDeviceIDs() : -1 : CL_DEVICE_NOT_FOUND
Kali 2016.1 Asus N56VV
i7 3630 QM
Nvidia GT750M
Arnab says
Hi, thanks for your feedback, let me check Hashcat with Kali 2016.1, currently running Debian testing, I'll post it soon.
Vlad says
UPD: On Debian 8 everything is working, Hashcat, pyrit, etc... This problem is only in Kali Linux 2016.1 Rolling
Vlad says
Any news about this problem?
Arnab says
Hey Vlad, sorry I'm running out of time to test it with Kali rolling, you should discuss it on hashcat forum, I think it will be better at this moment.
Again another though from your 1st comment, are you sure that you're running CUDA hashcat with NVIDIA driver version 346.59 or above ? or running the OpenCL version by mistake(I may be wrong!)
Happy password cracking ahead 😀
Vlad says
How is it possible to make a secure update Nvidia driver on Kali rolling 2016 (X64) with "Bumblebee"?
Vlad says
On the Kali - 352.79
dpkg-query -s nvidia-driver
Package: nvidia-driver
Status: install ok installed
Priority: optional
Section: non-free/x11
Installed-Size: 1092
Maintainer: Debian NVIDIA Maintainers
Architecture: amd64
Source: nvidia-graphics-drivers
Version: 352.79-10
phlame64 says
Hi, and thanks for the great tutorial. I am getting the following error while trying to build 'cpyrit-cuda' by issuing 'python setup.py build':
'error -- unsupported GNU version! gcc versions later than 4.9 are not supported!'
I'm currently using gcc version 5.4.0 20160609 (Debian 5.4.0-6). Any advice would be really appreciated...
Arnab says
Hi, thanks for feedback.
You need to install gcc-4.9, sudo apt-get install gcc-4.9, and build it again, you may need to symlink gcc-4.9 to gcc, let me check that in morning.
Arnab says
Hi again, it seems to be you need GCC 4.9.x and cuda toolkit 7.5 or above to compile cpyrit-cuda.
phlame64 says
Thank you. So your suggestion is to uninstall gcc 5.4.0 and install a previous, compatible version (ie 4.9)? I wonder if this would cause issues with the other software installed that uses gcc.
Arnab says
No, you don't need to uninstall gcc-5 at all, you have to use update-alternatives command to temporarily set proper gcc version.
See man update-alternatives and google will help you lot, actually I'm running out of time to explain the whole thing here.
And thanks for your suggestion, I'll update the tutorial how to use gcc-4.9 to compile cpyrit-cuda in kali.
phlame64 says
Looking forward to your updated tutorial then 😉
Arnab says
yeah, sure 🙂
Sertac says
"sudo ln -s /usr/lib/nvidia-cuda-toolkit/ /usr/local/cuda/"
After this step i get an output like that
"ln: target '/usr/local/cuda/' is not a directory: No such file or directory"
When i checked, there is no "cuda" directory. Should i create it?
Arnab says
Hey, sorry for late reply, it's a little typo, just remove the trailing slash / from the /usr/local/cuda/ , like bellow.
sudo ln -s /usr/lib/nvidia-cuda-toolkit/ /usr/local/cuda
d1m says
Hi ! Sorry, one week I've been out of Internet.
>>> limited to 1.5 GB download+upload per month <<<
Wow! )) ADSL ? I had same connection 3-4 years ago, now I have 15 Mbit/s unlimited traffic and 60 Mbit/s at night time 00-09 a.m. Monthly fee is about 9 U$D
About performance in various DE - it seems, I have explanation )) Difference in performance between Gnome/KDE and light-weight decktops exists for weak CPUs and GPUs. For powerful CPU/GPU it is nothingness.
Arnab says
Hi, It's good to hear from you again ! Yes, on high end systems heavy desktop environment matters not.
What an internet you'hv got and what an ISP ! perhaps Sakhalin TTK from your IP. My internet is EVDO (CDMA Rev.A), limited bandwidth and damn costly ~ $11 .
d1m says
Yes, this info about ISP is true.... TransTeleKom, Sakhalin Island, Russia... the Asshole of the World ))) Ethernet connection via PPPoE session.
Mobile tariff you using are very expensive... now I have 1 month mobile 3G Internet for my smartfone - 6 GB in day time and 6 GB in night time - it costs about 10 U$ per month.
From what country you are ?
Arnab says
Greetings from India !
d1m says
hindy rusy bhy-bhy ! I remember ))
हिंदी रूसी भाई भाई
Good luck ! And your ISP is very greedy. )
d1m says
>>> Heavy desktop environment significantly affects the performance ! <<<
OK, I changed my DE from Gnome to LXDE and made commands "optirun" and "primusrun" for comparing.
Results are on screenshot: http://tinypic.com/r/8vp7np/9
My laptop (Acer v3-771g) have good cooling, no trottling .
BTW, good manual for Kali 2.0 with Nvidia + Bumblebee + CUDA for Optimus + cudaHashcat and Pyrit is here: https://forums.kali.org/showthread.php?21956 I've been following that manual, and took 1 line from yous: = sudo apt-get install python2.7-dev libssl-dev zlib1g-dev libpcap-dev =, because without it pyrit and cpyrit are won't to compile.
d1m says
I had catch peace of info during installation CUDA-7.5... it's very important, IMHO:
>>> ***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 352.00 is required for CUDA 7.5 functionality to work. <<<
CUDA 7.5 requires driver nvidia 352.xx and newer.
Arnab says
Thanks for sharing this useful information. I too want to improve the pyrit performance with custom compiled Linux 4.4.x series kernel, nvidia 358.xx driver and cuda toolkit 7.5 .
The only thing stopping me to do experiments is my internet connection, it's damn costly and limited to 1.5 GB download+upload per month, that's why I used the –-no-install-recomands flag during cuda installation.
d1m says
>>> I’m waiting for your results with Kali 2.0 . <<<
Yes, i have it... 3 minutes ago I finished.
===
root@kali:~# optirun pyrit benchmark
Pyrit 0.4.1-dev (svn r308) (C) 2008-2011 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+
Running benchmark (12562.1 PMKs/s)... /
Computed 12562.07 PMKs/s total.
#1: 'CUDA-Device #1 'GeForce GT 650M'': 10313.8 PMKs/s (RTT 2.8)
#2: 'CPU-Core (SSE2/AES)': 475.8 PMKs/s (RTT 3.2)
#3: 'CPU-Core (SSE2/AES)': 470.8 PMKs/s (RTT 3.2)
#4: 'CPU-Core (SSE2/AES)': 478.0 PMKs/s (RTT 3.2)
#5: 'CPU-Core (SSE2/AES)': 478.0 PMKs/s (RTT 3.2)
#6: 'CPU-Core (SSE2/AES)': 477.5 PMKs/s (RTT 3.2)
#7: 'CPU-Core (SSE2/AES)': 477.5 PMKs/s (RTT 3.2)
#8: 'CPU-Core (SSE2/AES)': 477.6 PMKs/s (RTT 3.2)
===
It seems, old Kali is winner )).
Now I see at least 2 reasons for low performance in Jessie (if to follow your manual):
1. Pyrit and cpyrit-cuda version are older - 0.40 VS 0.41-dev.
2. Nvidia-driver is older too - ver 346.xx (it seems) VS ver 352.xx on Kali 2.0.
Old Kali was running on old Ver. nvidia (not remeber, sorry... I can check, if you need) and suitable version CUDA-6.5.
Arnab says
That's great !
Yeah old Kali seems to be the winner, It's obvious that Debian always lacks cutting edge drivers in it's repository. I'll update the tutorial with latest nvidia driver and pyrit 0.41-dev soon.
Anyway, one question, what desktop environment you are using with kali 2.0 ? Heavy desktop environment significantly affects the performance ! Even the ambient temperature plays a role here, lower temperature == better performance.
Thank you very much for sharing this, be in touch.
d1m says
Ahahaha !
I had compare pyrit benchmark results for old Kali 1.1.0 and new Debian Jessie 8.2. Look:
===
root@kali:~# optirun pyrit benchmark
Pyrit 0.4.1-dev (svn r308) (C) 2008-2011 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+
Running benchmark (12964.2 PMKs/s)... /
Computed 12964.17 PMKs/s total.
#1: 'CUDA-Device #1 'GeForce GT 650M'': 10591.8 PMKs/s (RTT 2.8)
#2: 'CPU-Core (SSE2/AES)': 495.9 PMKs/s (RTT 3.1)
#3: 'CPU-Core (SSE2/AES)': 485.3 PMKs/s (RTT 3.1)
#4: 'CPU-Core (SSE2/AES)': 498.4 PMKs/s (RTT 3.1)
#5: 'CPU-Core (SSE2/AES)': 492.7 PMKs/s (RTT 3.1)
#6: 'CPU-Core (SSE2/AES)': 499.4 PMKs/s (RTT 3.1)
#7: 'CPU-Core (SSE2/AES)': 492.2 PMKs/s (RTT 3.1)
#8: 'CPU-Core (SSE2/AES)': 480.2 PMKs/s (RTT 3.2)
===
d1m@kaldeb:~$ optirun pyrit benchmark
Pyrit 0.4.0 (C) 2008-2011 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+
Running benchmark (9205.9 PMKs/s)...
Computed 9205.94 PMKs/s total.
#1: 'CUDA-Device #1 'GeForce GT 650M'': 6712.2 PMKs/s (RTT 2.8)
#2: 'CPU-Core (SSE2)': 476.1 PMKs/s (RTT 3.2)
#3: 'CPU-Core (SSE2)': 469.7 PMKs/s (RTT 3.2)
#4: 'CPU-Core (SSE2)': 470.1 PMKs/s (RTT 3.2)
#5: 'CPU-Core (SSE2)': 473.9 PMKs/s (RTT 3.2)
#6: 'CPU-Core (SSE2)': 473.1 PMKs/s (RTT 3.2)
#7: 'CPU-Core (SSE2)': 471.9 PMKs/s (RTT 3.2)
#8: 'CPU-Core (SSE2)': 469.9 PMKs/s (RTT 3.2)
===
Resume: I was doing monkey buisness 2 days (trying tofollow your manual). "Newer" not always means "better".
And anyway - thank you ! Now I'll try this manual for Kali 2.0.
Arnab says
That's great improvement !!! “Newer” not always means “better”. yes it's true.
Thank you very much for sharing your results ! I'm waiting for your results with Kali 2.0 .
Debian kernel is very much system specific around ~3.4MB, compiled when debian is installed. But Kali linux kernel is not ! It's a custom build, somewhat larger in size. Perhaps that could be the reason for such performance differance.
d1m says
Yes, I did it !
d1m@kaldeb:~/cpyrit-cuda-0.4.0$ optirun 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 GT 650M''
#2: 'CPU-Core (SSE2)'
#3: 'CPU-Core (SSE2)'
#4: 'CPU-Core (SSE2)'
#5: 'CPU-Core (SSE2)'
#6: 'CPU-Core (SSE2)'
#7: 'CPU-Core (SSE2)'
#8: 'CPU-Core (SSE2)'
Many thanks !!!
But you need to fix some errors:
1. sudo apt-get --no-install-recomands install nvidia-cuda-toolkit ==>... --no-install-recommends...
2. installing minimal version of cuda not creates directory /usr/local/cuda/ and command "sudo ln -s /usr/lib/nvidia-cuda-toolkit/ /usr/local/cuda/" generate errors . Also "python setup.py build" will be make error "/bin/sh: 1: /usr/local/cuda/bin/nvcc: not found".
My solution - copying folder's content /usr/lib/nvidia-cuda-toolkit/* to /usr/local/cuda/*
3. "cd cd pyrit-0.4.0/" ==> "cd pyrit-0.4.0/"
4. "optirun pyrit lsit_cores" ==>... list_cores...
Arnab says
Thanks to you too !!
1. I used the –no-install-recomands flag to reduce the data download, that's absolutely unnecessary.
2. Copying folder contents to /usr/local is another solution, but in my case it worked just by making a symbolic link ! strange !
Hope you enjoyed this too !