PDA

View Full Version : Kali 1.0.2-AMD64 configuring Pyrit with NVCC



Mistwraith
2013-04-28, 08:15
Community,

I've read a ton of guides on this and asides from a fresh install of Pyrit 0.3.0 which is what the current FAQ supports, Kali is running 0.4.0... I'm up succesfully on Kali, everything is 100%, NVIDIA drivers are good and detected and NVIDIA X-Server is working too. I believe all the hard work is done, the only problem I am having is Pyrit (Default Installation) is not utilizing my video cards, it's still only utilizing CPU's. I read in the wiki and FAQ, that I needed to either install to a location /usr/bin/ which isn't an option since Kali came pre-loaded, or somehow set the path for the current Pyrit install to know where the NVCC compiler is. I searched the forums and responses to others questions are a bit different then my own. I"m attaching some screen shots and info.

NVIDIA operating 100%
http://i.imgur.com/M6Q5JJU.jpg

Pyrit Cores Avail
http://i.imgur.com/0FJelJZ.jpg


root@Kali:/usr/bin# which nvcc
/usr/bin/nvcc
root@Kali:/usr/bin# cd /usr/bin
root@Kali:/usr/bin# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2012 NVIDIA Corporation
Built on Thu_Apr__5_00:24:31_PDT_2012
Cuda compilation tools, release 4.2, V0.2.1221
root@Kali:/usr/bin#

hausoo
2013-04-29, 22:33
hello have you read this thread...http://forums.kali.org/showthread.php?90-Nvidia-driver-install&highlight=pyrit
post #18
try installing pyrit from http://pyrit.googlecode.com worked for me
i could not get repo version to work even rebuilding deb package with patches

79

Mistwraith
2013-04-30, 03:34
hello have you read this thread...http://forums.kali.org/showthread.php?90-Nvidia-driver-install&highlight=pyrit
post #18
try installing pyrit from http://pyrit.googlecode.com worked for me
i could not get repo version to work even rebuilding deb package with patches

79

I saw it and I will give it a go around, just was a bit confused as it uses Pyrit 0.3.0 but KALI ships with 0.4.0 I would prefer the newest version you know?

hausoo
2013-04-30, 04:28
google code is 4.0 same as kali except debain patches
svn is 0.4.1 r308

:~# pyrit
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+

Mistwraith
2013-05-05, 19:51
root@Kali:~/Desktop/Pyrit# cd pyrit-0.3.0
root@Kali:~/Desktop/Pyrit/pyrit-0.3.0# python setup.py build
svn: '.' is not a working copy
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying pyrit_cli.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/__init__.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/cpyrit.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/util.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/pckttools.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/config.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/network.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/storage.py -> build/lib.linux-x86_64-2.7/cpyrit
running build_ext
building 'cpyrit._cpyrit_cpu' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/cpyrit
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cpyrit/_cpyrit_cpu.c -o build/temp.linux-x86_64-2.7/cpyrit/_cpyrit_cpu.o -DVERSION="0.3.0"
cpyrit/_cpyrit_cpu.c:21:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

While using python to compile the package for the build phase, I was met with this error. Any ideas?

hausoo
2013-05-06, 13:58
apt-get install python2.7-dev

use pyrit-0.4.0

Mistwraith
2013-05-07, 02:01
@hausoo,

Appreciate your expertise and assistance working with me on this. I installed the Python 2.7 Dev tools, and I downloaded the Pyrit 0.4.0 packages, when running the commands again I received what I beileve is the same identicial error. I have to do a bit of research here, but if you can provide more feed back that would be great. I feel I am really close to having this puppy up and running, and I already have a nice .pcap file I plan to work it on :)

http://i.imgur.com/tnpIcZ8.png

Mistwraith
2013-05-07, 02:25
Figured it..I was missing some packages...for whatever reason, installing Python2.7-Dev, didn't include the libpcap...

aptitude search libpcap
apt-get install python2.7-libpcap
apt-get install libpcap-dev

I'm pretty sure it was just the python2.7 libpcap I needed, but I installed both, also installed OPEN SSL

apt-get install openssl

resource found here: http://stackoverflow.com/questions/11998805/python-install-pyrit-error-command-gcc-in-centos

Mistwraith
2013-05-07, 02:30
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 GTX 560 Ti''
#2: 'CUDA-Device #2 'GeForce GTX 560 Ti''
#3: 'CPU-Core (SSE2)'
#4: 'CPU-Core (SSE2)'
root@Kali:~#

root@Kali:~# 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 (48229.0 PMKs/s)... \

Computed 48228.96 PMKs/s total.
#1: 'CUDA-Device #1 'GeForce GTX 560 Ti'': 25076.3 PMKs/s (RTT 2.9)
#2: 'CUDA-Device #2 'GeForce GTX 560 Ti'': 24416.2 PMKs/s (RTT 2.9)
#3: 'CPU-Core (SSE2)': 1011.4 PMKs/s (RTT 3.1)
#4: 'CPU-Core (SSE2)': 1053.7 PMKs/s (RTT 3.0)
root@Kali:~#



Success :)

Amidamaru
2013-07-04, 18:27
Community,

I've read a ton of guides on this and asides from a fresh install of Pyrit 0.3.0 which is what the current FAQ supports, Kali is running 0.4.0... I'm up succesfully on Kali, everything is 100%, NVIDIA drivers are good and detected and NVIDIA X-Server is working too. I believe all the hard work is done, the only problem I am having is Pyrit (Default Installation) is not utilizing my video cards, it's still only utilizing CPU's. I read in the wiki and FAQ, that I needed to either install to a location /usr/bin/ which isn't an option since Kali came pre-loaded, or somehow set the path for the current Pyrit install to know where the NVCC compiler is. I searched the forums and responses to others questions are a bit different then my own. I"m attaching some screen shots and info.

NVIDIA operating 100%
http://i.imgur.com/M6Q5JJU.jpg

Pyrit Cores Avail
http://i.imgur.com/0FJelJZ.jpg


root@Kali:/usr/bin# which nvcc
/usr/bin/nvcc
root@Kali:/usr/bin# cd /usr/bin
root@Kali:/usr/bin# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2012 NVIDIA Corporation
Built on Thu_Apr__5_00:24:31_PDT_2012
Cuda compilation tools, release 4.2, V0.2.1221
root@Kali:/usr/bin#

Actually how did you've got the which nvcc command to work?

For me returns nothing, ZERO.

Thanks!

hausoo
2013-07-05, 16:42
hello you need nvidia-cuda-toolkit for nvcc

apt-get install nvidia-cuda-toolkit
repo ver 4.2

or d/l from nvidia latest 5.5


:~# which nvcc
/usr/bin/nvcc


:~# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2012 NVIDIA Corporation
Built on Thu_May__9_18:45:33_PDT_2013
Cuda compilation tools, release 5.5, V5.5.0


./deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 560"
CUDA Driver Version / Runtime Version 5.5 / 5.5
CUDA Capability Major/Minor version number: 2.1
Total amount of global memory: 1023 MBytes (1072889856 bytes)
( 7) Multiprocessors x ( 48) CUDA Cores/MP: 336 CUDA Cores
GPU Clock rate: 1620 MHz (1.62 GHz)
Memory Clock rate: 2004 Mhz
Memory Bus Width: 256-bit
L2 Cache Size: 524288 bytes
Max Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536,65535), 3D=(2048,2048,2048)
Max Layered Texture Size (dim) x layers 1D=(16384) x 2048, 2D=(16384,16384) x 2048
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 32768
Warp size: 32
Maximum number of threads per multiprocessor: 1536
Maximum number of threads per block: 1024
Maximum sizes of each dimension of a block: 1024 x 1024 x 64
Maximum sizes of each dimension of a grid: 65535 x 65535 x 65535
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 1 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Bus ID / PCI location ID: 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 5.5, CUDA Runtime Version = 5.5, NumDevs = 1, Device0 = GeForce GTX 560
Result = PASS

Amidamaru
2013-07-05, 21:09
Thanks much. I've got it installed, apt-get install nvidia-cuda-toolkit. nvcc it's working right now but I'm still facing some problems and I don't know how I should handle them actually:

This is what I've done.

1. svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit_svn
2. cd pyrit
3. python install.py build got me:

running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying pyrit_cli.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/__init__.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/cpyrit.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/util.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/pckttools.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/config.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/network.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/storage.py -> build/lib.linux-x86_64-2.7/cpyrit
running build_ext
building 'cpyrit._cpyrit_cpu' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/cpyrit
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cpyrit/_cpyrit_cpu.c -o build/temp.linux-x86_64-2.7/cpyrit/_cpyrit_cpu.o -Wall -fno-strict-aliasing -DVERSION="0.4.1-dev (svn r308)" -maes -mpclmul
cpyrit/_cpyrit_cpu.c:40:18: fatal error: pcap.h: No such file or directory
compilation terminated.
Failed to build; Compiling without AES-NI
building 'cpyrit._cpyrit_cpu' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cpyrit/_cpyrit_cpu.c -o build/temp.linux-x86_64-2.7/cpyrit/_cpyrit_cpu.o -Wall -fno-strict-aliasing -DVERSION="0.4.1-dev (svn r308)"
cpyrit/_cpyrit_cpu.c:40:18: fatal error: pcap.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1


3. I've switched over cpyrit_cuda directory thinking that I'm needing the pyrit's cuda module and I've summoned again the commands with build and install. Everything seemed ok but pyrit list_cores still showing me none of the Nvidia's.

The commands output are bellow:

/home/pyrit_svn/cpyrit_cuda# python setup.py build
The CUDA compiler and headers required to build kernel were not found. Trying to continue anyway...
running build
running build_ext
Compiling CUDA module using nvcc 4.2, V0.2.1221...
Executing 'nvcc -m64 --host-compilation C -Xcompiler "-fPIC" --ptx ./_cpyrit_cudakernel.cu'
nvcc warning : option 'host-compilation' has been deprecated and is ignored
Building modules...
building 'cpyrit._cpyrit_cuda' extension
creating build
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -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.1-dev (svn r308)"
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/cpyrit
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro 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

/home/pyrit_svn/cpyrit_cuda# python setup.py install
The CUDA compiler and headers required to build kernel were not found. Trying to continue anyway...
running install
running build
running build_ext
Skipping rebuild of Nvidia CUDA kernel ...
Building modules...
running install_lib
copying build/lib.linux-x86_64-2.7/cpyrit/_cpyrit_cuda.so -> /usr/local/lib/python2.7/dist-packages/cpyrit
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/cpyrit_cuda-0.4.1_dev._svn.r308_.egg-info

/home/pyrit_svn/cpyrit_cuda# 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: 'CPU-Core (SSE2)'
#2: 'CPU-Core (SSE2)'
#3: 'CPU-Core (SSE2)'
#4: 'CPU-Core (SSE2)'

Any further ideas?

Thanks!

Philly
2013-08-03, 11:57
Actually how did you've got the which nvcc command to work?

For me returns nothing, ZERO.

Thanks!


nano /root/.bashrc
Add this to the end of the file - Note the dir when you installed your cuda tools, verify before you bash away the keyboard!


PATH=$PATH:/usr/local/cuda-5.5/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-5.5/lib
export PATH
export LD_LIBRARY_PATH

Amidamaru
2013-08-03, 12:34
Thanks. However, I've used this tutorial and I've successfully make it works. :)

http://pentestconsultancy.blogspot.com/p/installing-configuring-nvidia-cuda-55.html