JPaulMora / Pyrit

The famous WPA precomputed cracker, Migrated from Google.
GNU General Public License v3.0
1.07k stars 273 forks source link

ToDo: Make Pyrit compile in a cygwin-environment #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 9 years ago
Hello.

Firstly, thank you for so diligently working on this terrific project! 

Secondly, I realize you don't "support" windows and plan not to from a
previous comment I've read from you.  I'd like to write a how-to on
compiling pyrit under windows (via cygwin + minGW).  There was a gentleman
who posted a comment about successfully getting pyrit to run on windows
with cygwin + mingw and he never responded to me.  This response was on the
deleted FirstSteps Wiki page.

Since reading that comment, I have been trying to figure out to make pyrit
work on my windows vista computer on my own.  I've gotten very far and I
seem to be hitting a hurdle that I feel like you would be able to assist
with (not windows-related).

I feel like the error stems from the fact that I'm missing something in my
cygwin environment and I can't be sure.  I've installed SSL and related
libraries into cygwin, and all other packages that I thought could be
related/helpful.  I'm posting the output below of the error, and I was
hoping you could point me in the right direction, or give me your thoughts
as to why I was receiving an "undefined reference" error from the beginning
of the build process?

Thank you very much!!

Andy Slezak

Python 2.5.2

andy@VISTA-ANDY2 /cygdrive/c/pyrit/pyrit
$ python setup.py build
running build
running build_py
running build_ext
building '_cpyrit._cpyrit_cpu' extension
writing build/temp.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu.def
gcc -mno-cygwin -shared -s
build/temp.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu.o
build/temp.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu_sse2.o
build/temp.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu.def
-L/usr/lib/python2.5/config -lssl -lpython2.5 -o
build/lib.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu.dll
build/temp.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu.o: In function
`finalize_pmk_sse2':
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:282: undefined reference to
`_sse2_sha1_update'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:283: undefined reference to
`_sse2_sha1_finalize'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:286: undefined reference to
`_sse2_sha1_update'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:287: undefined reference to
`_sse2_sha1_finalize'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:290: undefined reference to
`_sse2_sha1_update'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:291: undefined reference to
`_sse2_sha1_finalize'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:294: undefined reference to
`_sse2_sha1_update'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:295: undefined reference to
`_sse2_sha1_finalize'
build/temp.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu.o: In function
`prepare_pmk_openssl':
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:325: undefined reference to
`_SHA1_Init'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:326: undefined reference to
`_SHA1_Update'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:330: undefined reference to
`_SHA1_Init'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:331: undefined reference to
`_SHA1_Update'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:334: undefined reference to
`_EVP_sha1'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:334: undefined reference to
`_HMAC'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:337: undefined reference to
`_EVP_sha1'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:337: undefined reference to
`_HMAC' build/temp.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu.o: In
function `finalize_pmk_openssl':
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:352: undefined reference to
`_SHA1_Update'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:353: undefined reference to
`_SHA1_Final'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:356: undefined reference to
`_SHA1$
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:357: undefined reference to
`_SHA1_Final'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:363: undefined reference to
`_SHA1_Update'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:364: undefined reference to
`_SHA1_Final'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:367: undefined reference to
`_SHA1_Update'
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:368: undefined reference to
`_SHA1_Final' build/temp.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu.o: In
function `init_cpyrit_cpu':
/cygdrive/c/pyrit/pyrit/_cpyrit/_cpyrit_cpu.c:529: undefined reference to
`_detect_sse2'
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Original issue reported on code.google.com by andrewmslezak on 27 Jul 2009 at 5:54

GoogleCodeExporter commented 9 years ago
yeah i was also having similar issues, i think one of the things to remove some 
of
the errors was fixed by following this:
http://verticalfall.blogspot.com/2008/12/compile-pyrit-under-windows.html
that cut out about half the errors and i ended up with just the sse2 errors, 
i'll try
it again later with the newest svn when i get home. 

Original comment by adam.k...@gmail.com on 28 Jul 2009 at 1:16

GoogleCodeExporter commented 9 years ago
just tested with r142 and got as below:

$ python setup.py build
running build
running build_py
creating build
creating build/lib.cygwin-1.5.25-i686-2.5
copying cpyrit.py -> build/lib.cygwin-1.5.25-i686-2.5
copying cpyrit_util.py -> build/lib.cygwin-1.5.25-i686-2.5
package init file '_cpyrit/__init__.py' not found (or not a regular file)
package init file '_cpyrit/__init__.py' not found (or not a regular file)
running build_ext
building '_cpyrit._cpyrit_cpu' extension
creating build/temp.cygwin-1.5.25-i686-2.5
creating build/temp.cygwin-1.5.25-i686-2.5/_cpyrit
gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/us
r/include/python2.5 -c _cpyrit/_cpyrit_cpu.c -o build/temp.cygwin-1.5.25-i686-2.
5/_cpyrit/_cpyrit_cpu.o
gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/us
r/include/python2.5 -c _cpyrit/_cpyrit_cpu_sse2.S -o build/temp.cygwin-1.5.25-i6
86-2.5/_cpyrit/_cpyrit_cpu_sse2.o
creating build/lib.cygwin-1.5.25-i686-2.5/_cpyrit
gcc -shared -Wl,--enable-auto-image-base build/temp.cygwin-1.5.25-i686-2.5/_cpyr
it/_cpyrit_cpu.o build/temp.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu_sse2.o -L
/usr/lib/python2.5/config -lssl -lcrypto -lpython2.5 -o build/lib.cygwin-1.5.25-
i686-2.5/_cpyrit/_cpyrit_cpu.dll
build/temp.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu.o: In function `finalize_p
mk_sse2':
/home/Adam/pyrit-read-only/pyrit/_cpyrit/_cpyrit_cpu.c:282: undefined reference
to `_sse2_sha1_update'
/home/Adam/pyrit-read-only/pyrit/_cpyrit/_cpyrit_cpu.c:283: undefined reference
to `_sse2_sha1_finalize'
/home/Adam/pyrit-read-only/pyrit/_cpyrit/_cpyrit_cpu.c:286: undefined reference
to `_sse2_sha1_update'
/home/Adam/pyrit-read-only/pyrit/_cpyrit/_cpyrit_cpu.c:287: undefined reference
$
/home/Adam/pyrit-read-only/pyrit/_cpyrit/_cpyrit_cpu.c:290: undefined reference
$
/home/Adam/pyrit-read-only/pyrit/_cpyrit/_cpyrit_cpu.c:291: undefined reference
to `_sse2_sha1_finalize'
/home/Adam/pyrit-read-only/pyrit/_cpyrit/_cpyrit_cpu.c:294: undefined reference
to `_sse2_sha1_update'
/home/Adam/pyrit-read-only/pyrit/_cpyrit/_cpyrit_cpu.c:295: undefined reference
to `_sse2_sha1_finalize'
build/temp.cygwin-1.5.25-i686-2.5/_cpyrit/_cpyrit_cpu.o: In function `init_cpyri
t_cpu':
/home/Adam/pyrit-read-only/pyrit/_cpyrit/_cpyrit_cpu.c:529: undefined reference
to `_detect_sse2'
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Original comment by adam.k...@gmail.com on 28 Jul 2009 at 7:14

GoogleCodeExporter commented 9 years ago
Adam - thanks for the link (I can't believe I didn't see it...).  Looks like you
confirmed my suspicions.  I didn't modify ./pyrit/cpyrit/setup.py and add a 
reference
to lib crypto via "libraries = ['ssl','crypto']"

I wonder if there's an SSE2 library or something along those lines?  Maybe I'll 
build
2.2 (which was made without sse2 optimizations...  I'm more interested in the 
GPU
acceleration at the moment.  Obviously, it would be nice to have sse2 
acceleration too...

I'm going to try and play around when I get to the office.  It looks like this
definitely helped me.  I'll post any updates I find.  Please post any other 
ideas if
you think of them :)

Original comment by andrewmslezak on 28 Jul 2009 at 12:38

GoogleCodeExporter commented 9 years ago
I won't be able to help you significantly with this as I don't use Windows.

Update to r143 which re-adds __init__.py to _cpyrit. The file has had been
auto-generated by setup.py for some time. However this behaviour changed again 
and
the file has been missing from svn for some time...

I think the OpenSSL libraries are called 'libeay' instead of 'ssl' on Windows.

You can prevent the SSE2-path from getting compiled by either removing '#define
COMPILE_SSE2' from _cpyrit_cpu.h or adding '#undef COMPILE_SSE2' to the end of 
this file.

Original comment by lukas.l...@gmail.com on 28 Jul 2009 at 12:50

GoogleCodeExporter commented 9 years ago
Thanks, Lukas!!

I'm trying this now...

Original comment by andrewmslezak on 28 Jul 2009 at 5:01

GoogleCodeExporter commented 9 years ago
Success (wo SSE2)!

I actually had to force the "include_dirs" variable in setup.py to search for 
where
OpenSSL was located.  For some reason my cygwin/python/gcc environment wasn't 
finding
the .h files correctly (hmac.h and sha.h).  

I also, added the 'crypto' library as adam.k.92 so helpfully pointed out, with 
which
I tested both with/without.  I received SHA1_init errors without this key point
included.  Thank you, adam.k.92!

Here's what I ended up with in my setup.py:

cpu_extension = Extension(name='_cpyrit._cpyrit_cpu',
                    sources = ['_cpyrit/_cpyrit_cpu.c','_cpyrit/_cpyrit_cpu_sse2.S'],
                    include_dirs = ['/usr/include/'],
                    libraries = ['ssl','crypto'])

util_extension = Extension(name='_cpyrit._cpyrit_util',
                    sources = ['_cpyrit/_cpyrit_util.c'],
                    include_dirs = ['/usr/include/'],
                    extra_compile_args=EXTRA_COMPILE_ARGS)

Secondly, I undefined COMPILE_SSE2 as you recommended.  This got rid of SSE2 
errors.  

Here is what my _cpyrit_cpu.h looked like when finished: 

#if (defined(__i386__) || defined(__x86_64__)) && !defined(__APPLE__)
    #define COMPILE_SSE2
    #undef COMPILE_SSE2
#endif

Now I'm on to testing cpyrit cuda to see if that compiles :)  Pyrit with my
CUDA-enabled video card on my windows box is the whole purpose of this ticket! 
:)

Updates to come...  Thanks for your help so far, guys!

Andy

Original comment by andrewmslezak on 29 Jul 2009 at 1:16

GoogleCodeExporter commented 9 years ago
Wow thanks a lot Andy works now, pity the lack of SSE2. Let us know if you get 
the
CUDA working, if I have spare time I'll see if I can get the ati-stream working
though I'm rather noob. 

By the way, Lukas rather than start a new issue I'll post here: would it be 
possible
to re-add the network core to the svn?

Adam.

Original comment by adam.k...@gmail.com on 29 Jul 2009 at 7:35

GoogleCodeExporter commented 9 years ago
The network-core won't see the light of day for some time now. 

Original comment by lukas.l...@gmail.com on 29 Jul 2009 at 10:01

GoogleCodeExporter commented 9 years ago
Any particular reason? Seemed to be working alright for me, worked fine for 
batch
processing.

Original comment by adam.k...@gmail.com on 29 Jul 2009 at 10:53

GoogleCodeExporter commented 9 years ago
The first version was thrown together to get some experience. I now want to do 
it The
Right Way (tm). Two cents:

 * The client should not die when a network-server goes out of business. This
requires the client's scheduling mechanism to be able to revoke workunits that 
once
were issued to the dead server and re-insert them into the global queue. The
all-new-and-shiny scheduling that was introduced with 0.2.3 can now do that.
 * Networking differs from other (local) cores as it introduces latency. Pyrit's
scheduling model is based upon the assumption that there is an endless amount 
of work
(e.g. the queue is always full) and that there is no further
bandwidth-limitation/latency between getting a workunit into the queue and
transferring them to the hardware. The network core needs to cover the latency 
it
introduces by double-buffering - which should be implemented more cleanly that 
it was
previously.

Original comment by lukas.l...@gmail.com on 29 Jul 2009 at 11:35

GoogleCodeExporter commented 9 years ago
Obviously, I'm welcoming any feedback on getting SSE2 compiled successfully!  I
hacked away at getting nvcc to work with gcc... it got pretty late and I was 
beat.  I
didn't have much luck.  I'll probably hack away at it tonight again...

Original comment by andrewmslezak on 29 Jul 2009 at 2:33

GoogleCodeExporter commented 9 years ago
sorry I haven't updated this ticket in a while - please do keep it open.... or 
out of
curiosity, is it possible to close it and allow me to apply my updates?  Maybe 
that
wouldn't be so wise as I might have questions that might arise.  I just didn't 
want
the world to think I'd forgotten about my intent :)

Original comment by andrewmslezak on 8 Aug 2009 at 11:08

GoogleCodeExporter commented 9 years ago
I've updated the ticket for you. Feel free to add new stuff.

Original comment by lukas.l...@gmail.com on 8 Aug 2009 at 11:11

GoogleCodeExporter commented 9 years ago
FYI I've managed to get Pyrit to compile and run under windows correctly, there 
are 
two areas to add 'crypto' where it appears you've only altered one.  Getting 
the 
CUDA side of things to compile... well.. I've failed so far.  

Pyrit 0.2.4 (C) 2008, 2009 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)'

Original comment by domainr...@googlemail.com on 20 Aug 2009 at 2:27

GoogleCodeExporter commented 9 years ago
I should add a quick benchmark showing it does work:

$ pyrit benchmark
Pyrit 0.2.5-dev (svn r169) (C) 2008, 2009 Lukas Lueg http://pyrit.googlecode.com

This code is distributed under the GNU General Public License v3

The ESSID-blobspace seems to be empty; you should create an ESSID...

Running benchmark for about 0 seconds... /

Computed 2902.03 PMKs/s total.
#1: 'CPU-Core (SSE2)': 739.0 PMKs/s (Occ. 96.5%; RTT 3.0)
#2: 'CPU-Core (SSE2)': 746.8 PMKs/s (Occ. 97.5%; RTT 2.9)
#3: 'CPU-Core (SSE2)': 743.1 PMKs/s (Occ. 99.9%; RTT 3.0)
#4: 'CPU-Core (SSE2)': 742.1 PMKs/s (Occ. 96.8%; RTT 2.9)

And that I changed my setup.py to look like:

cpu_extension = Extension(name='cpyrit._cpyrit_cpu',
                    sources = ['cpyrit/_cpyrit_cpu.c', 'cpyrit/_cpyrit_cpu_sse2.S'],
                    libraries = ['ssl','crypto'])

util_extension = Extension(name='cpyrit._util',
                    sources = ['cpyrit/_util.c'],
                    extra_compile_args=EXTRA_COMPILE_ARGS)

pckttools_extension = Extension(name='cpyrit._pckttools',
                    sources = ['cpyrit/_pckttools.c'],
                    libraries = ['ssl','crypto'])

Getting the cuda part to compile has proved a littel fruitless.  It's not a 
problem 
with Pyrit.  Nvcc complains about the incorrect verions of cl.exe not matter 
what I 
try.

Original comment by domainr...@googlemail.com on 20 Aug 2009 at 4:19

GoogleCodeExporter commented 9 years ago
Hmmmm interesting, its working over here now too....I don't it was the case of
'missing' the crypto as i'm sure the pckttools was only added recently. When i 
get
the time i want to go through and see in which revision it was fixed =P

Original comment by adam.k...@gmail.com on 21 Aug 2009 at 9:55

GoogleCodeExporter commented 9 years ago
Ok, looks like r152 works with sse2 with just adding the crypto libs and r151 
won't
work. Well whatever was done in r152 works =)

Original comment by adam.k...@gmail.com on 21 Aug 2009 at 10:27

GoogleCodeExporter commented 9 years ago
thanks for the updates, guys.... I wonder if Lukas has any feedback on the r151 
vs
r152 changes that would allow SSE2 to compile :)

Original comment by andrewmslezak on 22 Aug 2009 at 1:03

GoogleCodeExporter commented 9 years ago
I'm not really following this bug.

Rev152 adds secondary labels ("_foo" instead of "foo") as gcc on MacOS seems to
mangle labels. Judging from comment #2 this also happens in cygwin.

Original comment by lukas.l...@gmail.com on 22 Aug 2009 at 8:46

GoogleCodeExporter commented 9 years ago
Hi guys, just to anyone interested with r173 on cygwin your going to have to 
make
sure you update your python. At least that's what I found I had to do otherwise 
there
was install problems. I just got the latest python from svn and works a charm.
Thought I'd save you some time wondering what the heck is wrong with it :)

P.S Just need to add the one reference to the crypto lib in the setup.py still.

Original comment by adam.k...@gmail.com on 17 Sep 2009 at 11:31

GoogleCodeExporter commented 9 years ago
"Nvcc complains about the incorrect verions of cl.exe not matter what I 
try."

I believe I may have a fix for this, I had to edit the headers included in the 
CUDA
SDK. Let me see if I can get a clean build and I'll let you know what was 
needed.

Original comment by isprin...@gmail.com on 15 Oct 2009 at 1:40

GoogleCodeExporter commented 9 years ago
Nobody seems to work on this. I still don't care about windows ;-)

Closed for now.

Original comment by lukas.l...@gmail.com on 4 Nov 2009 at 7:33

GoogleCodeExporter commented 9 years ago
Can you reopen this, I'm planning on having a really good go at compiling 
CAL++/CUDA support into windows binaries.

Original comment by jamescor...@googlemail.com on 7 Dec 2010 at 11:02

GoogleCodeExporter commented 9 years ago
I have pyrit on its own running fine on cygwin, just haven't really bothered 
with CAL++/CUDA because the improvement for my low powered graphics card would 
be minimal for the amount of effort of trying to get it to work. Do let us know 
if you manage to get it working though.

Original comment by adam.k...@gmail.com on 8 Dec 2010 at 2:28

GoogleCodeExporter commented 9 years ago
Got pyrit latest SVN to compile fine runs fine on proccessor.

Got opencl and cal++ to compile, but after than have been built and installed 
pyrit just runs and stops... Deleting the addons from site-packages makes pyrit 
work again...

Original comment by james0p0...@googlemail.com on 13 Dec 2010 at 4:02

GoogleCodeExporter commented 9 years ago
can you provide patches and a howto for the wiki?

Original comment by lukas.l...@gmail.com on 13 Dec 2010 at 4:26

GoogleCodeExporter commented 9 years ago
Sure, now I just have to remember how I did it!

Original comment by james0p0...@googlemail.com on 13 Dec 2010 at 4:34

GoogleCodeExporter commented 9 years ago
I used verbose and this is the last thing I see.
dlopen("/usr/lib/python2.6/site-packages/cpyrit/_cpyrit_calpp.dll", 2);

Original comment by james0p0...@googlemail.com on 13 Dec 2010 at 8:17

GoogleCodeExporter commented 9 years ago
you can probably attach to the process with ollydbg to see where exactly it 
hangs 

Original comment by lukas.l...@gmail.com on 14 Dec 2010 at 2:32

GoogleCodeExporter commented 9 years ago
Ok, first I'm going to try and compile the DLL in Visual Studio and then link 
it.

Original comment by james0p0...@googlemail.com on 14 Dec 2010 at 2:53

GoogleCodeExporter commented 9 years ago
i got it to compile in cygwin
i needed to copy a few librarys in tho
also
i cant get any of the cuda/calpp plugins to compile as the cuda library format 
is not recoginsed by cygwins linker

Original comment by client...@gmail.com on 31 May 2011 at 8:32

GoogleCodeExporter commented 9 years ago
I manually created the linking libraries... and I didn't get anywhere with the 
dlls I managed to compile, They still just crashed. I will try with pyrit svn 
sometime soon.

Original comment by james0p0...@googlemail.com on 1 Jun 2011 at 9:54

GoogleCodeExporter commented 9 years ago
I tried compiling both version 0.4.0 and svn trunk in cygwin, and it seemed to 
work without modifications; however, when I tried to execute pyrit it hung with:
(0.4.0)

Traceback (most recent call last):
    File "/usr/bin/pyrit", line 4, in <module>
        import pyrit_cli
    File "/usr/lib/python2.6/site-packages/pyrit_cli.py", line 32, in <module>
        import cpyrit.cpyrit
    File "/usr/lib/python2.6/site-packages/cpyrit.py", line 41, in <module>
        import util
    File "/usr/lib/python2.6/site-packages/util.py", line 52, in <module>
        import _cpyrit_cpu

ImportError: Exec format error

SVN does the same thing except in util line 53.

Original comment by spectra...@gmail.com on 20 Jul 2011 at 10:54

GoogleCodeExporter commented 9 years ago
Some news, I've built the latest pyrit on win32 w/o cygwin/mingw, using vs2008.
C:\Pyrit\winpcap>c:\Python26\python.exe C:\Python26\Scripts\pyrit benchmark
Pyrit 0.4.1-dev (C) 2008-2011 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+

Running benchmark (408.8 PMKs/s)... \
...

I've wrote a guide for this, it's easy with some modifications to the build 
system. I haven't tried SSE2, yet.

Original comment by nikolas....@gmail.com on 17 Nov 2011 at 1:24

GoogleCodeExporter commented 9 years ago
#1) Preparations

Get a working compilation environment. Get Visual Studio 2008/2010 (Express). 
I'm testing with VC++98 Pro Edition.

- Install 7Zip (optional) or another tool to untar .tar.gz archives.
- Install subversion client for Windows, make sure its in PATH.
- Install ActiveState Python/Perl, latest versions.

My setup uses a bit dated tools:
-> Python: ActivePython 2.6.2.2
-> Perl: Binary build 1006 [291086] provided by ActiveState
-> SVN: svn, version 1.3.1 (r19032)

- Open command prompt, verify you have all tools working:

  $ perl -v
  $ python -v
  $ svn --version

- Get Pyrit.

  $ cd c:\
  $ mkdir Pyrit
  $ cd Pyrit
  $ svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit-read-only

- Apply patch. (I did that in my git bash, if you don't have the patch utility, 
you have to do merge the changes on your own, manually)

  $ patch -p0 < pyrit-win32.diff

Once the checkout is there, don't try to build it yet, proceed with the next 
steps.

#2) OpenSSL

Get latest OpenSSL sources, 1.0.0e at the time of writing. Untar it to eg. 
c:\openssl-1.0.0e.
- Open VC++ command propmpt, and build as explained in INSTALL.W32. Then 
install it to eg. C:\Pyrit\openssl.
  Type following:

  $ cd c:\openssl-1.0.0e\
  $ perl Configure VC-WIN32 no-asm --prefix=c:/Pyrit/openssl
  $ ms\do_ms
  $ nmake -f ms\ntdll.mak
  $ nmake -f ms\ntdll.mak test (optional step!)
  $ nmake -f ms\ntdll.mak install

If you run into linker problems like:
  cryptlib.obj : error LNK2019: unresolved external symbol _OPENSSL_ia32_cpuid referenced....
you tweaked something and retried. Untar the whole package again and retry to 
make it disappear.

#3) WinPcap (http://www.winpcap.org/devel.htm / 
http://www.winpcap.org/install/default.htm)

Get WinPcap 4.1.2 Developer Pack. Unzip it to C:\Pyrit\winpcap. This should 
have created C:\Pyrit\winpcap\WpdPack.
Install WinPcap 4.1.2 binaries, this is required to get the winpcap.DLL.

#4) Pyrit

- Open cmd.exe command prompt. Type following:

  $ cd C:\Pyrit\pyrit-read-only\pyrit
  $ set WINOPENSSLDIR=C:\Pyrit\openssl
  $ set WINPCAPDIR=C:\Pyrit\winpcap\WpdPack
  $ python setup.py build
  $ python setup.py install
  $ C:\your\path\to\python.exe c:\your\path\to\python\Scripts\pyrit

There you go.

C:\Pyrit\winpcap>c:\Python26\python.exe C:\Python26\Scripts\pyrit benchmark
Pyrit 0.4.1-dev (C) 2008-2011 Lukas Lueg http://pyrit.googlecode.com
This code is distributed under the GNU General Public License v3+

Running benchmark (408.8 PMKs/s)... \

Original comment by nikolas....@gmail.com on 17 Nov 2011 at 1:27

Attachments:

GoogleCodeExporter commented 9 years ago
Just a note, I have given up with this due to a closed source free alternative 
being released but there isn't a problem compiling pyrit on windows there is a 
problem with the modules that allow gpu acceleration.

Original comment by james0p0...@googlemail.com on 17 Nov 2011 at 2:15

GoogleCodeExporter commented 9 years ago
the guide works just fine for running pyrit but when i get down to analyzing or 
attacking the capture file i get an error about not having Scapy 2.X. I tried 
to manually install scapy 2.x but it doesnt support python 2.7 so im kinda 
stuck here.

Original comment by Javab...@gmail.com on 8 Jan 2012 at 1:17

GoogleCodeExporter commented 9 years ago
I've managed to build pyrit with opencl and calpp support (I don't have an 
nVidia card to check for CUDA support) via mingw. From the beginning i've tried 
to build all modules (pyrit\opencl\calpp) under cygwin,  all works fine, except 
calpp - crashes/segfaults etc... after long time spent with gdb i've suppose 
that problem in cygwin gcc (4.5.3). The only trouble with mingw was pyrit sse2 
support, because mingw gcc (4.6.1) does not align stack by default, after 
adding option "-mstackrealign" pyrit module starts working as intended without 
crashes. On my 4850 i've got the following results: 11500 PMK/s(OpenCL), 18700 
PMK/s (CALpp).

Original comment by kost.aci...@gmail.com on 11 Apr 2012 at 1:38

GoogleCodeExporter commented 9 years ago
Make Pyrit compile in a Visual C++ 2008 environment.
With Python 2.6 and pyrit 0.4.1-dev.
1. Add lines in _cpyrit_cpu.c

#pragma comment(lib, "crypt32.lib")
#pragma comment(lib, "libeay32.lib")
#define VERSION  "0.4.1-dev"

2.Download and install http://slproweb.com/download/Win32OpenSSL-1_0_0l.exe
Take from OpenSSL-Win32  folder header and lib files and copy to Visual C++ 
2008 folder.
Build and install pyrit.
3.In pckttools.py insert line 'import scapy.all' str.41 (it for scapy).
Under Windows XP SP3 all work well,faster then in linux. 

Original comment by puiv...@gmail.com on 25 Jan 2014 at 8:21

Attachments:

GoogleCodeExporter commented 9 years ago
pyrit + opencl on cygwin(win7)

pyrit(cpu) part: 
http://jumpespjump.blogspot.com/2013/03/installing-pyrit-on-windows-with-cygwin.
html

pyrit(opencl):
1. download and install AMD APP SDK 2.9
2. copy CL folder from C:\Program Files (x86)\AMD APP SDK\2.9\include to 
c:\cygwin\usr\include
3. copy all files from C:\Program Files (x86)\AMD APP SDK\2.9\lib\x86 to 
c:\cygwin\lib
4. run "python setup.py build" and "... install" in "cpyrit_opencl"

I am not sure the performance is OK. Need more testing.

Original comment by f...@wqfw.de on 9 Apr 2014 at 3:29