Tuesday, March 5, 2013

Installing pyrit on Windows (with cygwin)


If you are as unfortunate as I am and you need to use Windows (for some reason) to install pyrit, you will probably have a bad time. However! :) I figured out how to make it work, at least for CPU-based cracking. I used cygwin, but it should be possible with MinGW too.

GPU-based cracking will be a lot (and I mean A LOT) more difficult though. I have found a ticket on pyrit's webpage ([3] and also a Google Groups thread on [4]) that is not really promising, but I would like to try it later and see if it's really impossible to make it work with GPU acceleration.

Installation steps

So, here are the steps (based on [1] and [2]):

  1. Install cygwin from cygwin.com (download: http://cygwin.com/setup-x86.exe or http://cygwin.com/setup-x86_64.exe)! Make sure that you install gcc, cc, openssl, svn!
  2. Download and unzip the Winpcap developer pack. By the time of this post, the most recent version was the following: http://www.winpcap.org/install/bin/WpdPack_4_1_2.zip
  3. Copy libraries like this:
    WpdPack\Lib\libpacket.a to cygwin\lib\
    WpdPack\Lib\libwpcap.a to cygwin\lib\
  4. Rename cygwin\lib\libwpcap.a to cygwin\lib\libpcap.a
  5. Copy all headers from WpdPack\Include to cygwin\usr\include\
  6. Make sure you have installed Winpcap libraries and that they are in your path by typing:
    which Packet.dll
    which wpcap.dll
    For me they are under /cygdrive/c/WINDOWS/system32/
  7. Download pyrit source (svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit)
  8. I think the next step is no longer needed (I took it from [1]): modify ./pyrit/cpyrit/setup.py adding a reference to lib crypto (now, originaly it's: libraries = ['crypto', 'pcap'], so I have changed it to libraries = ['ssl', 'crypto', 'pcap'],)
  9. ./setup.py build
  10. ./setup.py install
  11. pyrit.py benchmark
    should give you something similar to this:



  1. Ive been at this for hours, learned how to set Environment Variables, that I have to install python and Visual Studio, and now I got some ' TypeError: not all arguments converted during string formatting '
    with either the build or install
    Any idea why it does this?

  2. Well, I was using it with python 2.7.3 (INSIDE cygwin of course), and had no problem with it.

    BTW, Visual Studio: why would you need that? :)

  3. Hi, I can make it work under 32 bits windows (xp) but under 64 bits (win7) get the following error:
    /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/../../../../x86_64-pc-cygwin/bin/ld: se salta el /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/../../../../lib/libpcap.a incompatible mientras se busca -lpcap
    (sorry, i'm spanish) "incompatible while searching -lpcap"
    any clue about that?
    thank you

    1. Hi sorry for the late answer. Unfortunately, nope don't really have a clue. All I can tell is that I used a win7 x64 system when I wrote this little howto. Sorry... hope you manage to find a solution. Anyways, pyrit should not be really used under windows, I was just bored and wanted to find out if you can make it work under a windows system :)

    2. Thank you, don't worry about this. I was only wasting time. I have pyrit working on my linux distro with stream (ATI video card)...

    3. Yep, under *nix, pyrit just actually works :D

  4. svp, je voudrais installé ma GTX 760 sur BACKTRACK 5R3 mais j'ai pas pu l'installé, pouvai vous m'aidez a l'installé??

  5. Please, I would like to install the GTX 760 on BACKTRACK 5R3 but I could not the installed pouvai you help me has installed?

  6. IF you are using 64bit cygwin you will need to follow the extra steps found here -> http://sourceforge.net/p/tcpreplay/mailman/message/31989765/

    (1) If you look under /wpdpack/lib you'll notice that both .lib and .a
    files are distributed for winpcap. If you look under /wpdpack/lib/x64
    you'll notice only .lib files are distributed. I found a post on the
    MinGW-w64 mailing list* that describes how to generate the .a files from the
    .lib files. The commands are:

    (a) gendef wpcap.dll
    (b) dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libwpcap.a
    --input-def wpcap.def

    I used the .dll's in the c:\windows\SysWOW64 folder to do this. This
    should be done both for libpacket.a and libwpcap.a.

    1. Hi Rick,

      Awesome! Thanks for sharing this! :)


  7. Hi guys, I would like to setup a cluster but i can't install cygwin , are there some ideas for making a single portale executable?

  8. error: command 'gcc' failed with exit status 1

  9. This comment has been removed by the author.

  10. Hello! Do you have 32-bit cygwin or 64-bit?