Sunday, April 13, 2008

Compile cowpatty under windows

Try to follow this steps to compile cowpatty-4.2, you can find last version here.
I've succesfully compiled under Windows XP SP2 with cygwin and winpcap.
First step it's to install cygwin, make sure that you check to install gcc, cc, stdlib, openssl, etc, default installation will work.
Dowload from here winpcap win32 dll libraries and install it on windows then get and unzip WinPcap Developer's Packs , copy headers files from .\include\* to c:\cygwin\usr\include\pcap and libary file from .\lib\* to c:\cygwin\lib\ .
Check that you've correctly installed winpcap dll by open a cygwin session (double click on c:\cygwin\cygwin.bat) and type which Packet.dll wpcap.dll.

Administrator@notebook ~
$ which Packet.dll wpcap.dll /cygdrive/c/WINDOWS/system32/Packet.dll /cygdrive/c/WINDOWS/system32/wpcap.dll

Download and extract cowpatty-4.2.gz.

tar xsvf cowpatty-4.3.tgz

Edit Makefile, add path for pcap headers
old file:

##################################
LDLIBS = -lpcap
CFLAGS = -pipe -Wall -DOPENSSL
CFLAGS += -O2
LDLIBS += -lcrypto

new file:

##################################
LDLIBS = -lwpcap
CFLAGS = -pipe -Wall -DOPENSSL
CFLAGS += -I /usr/include/pcap/ -I /usr/include/
CFLAGS += -O2
LDLIBS += -lcrypto

Now It's time to compile:

Administrator@notebook ~/cowpatty-4.2
$ make
cc -pipe -Wall -DOPENSSL -I /usr/include/pcap/ -I /usr/include/ -O2 -g3 -ggdb
-c -o md5.o md5.c
cc -pipe -Wall -DOPENSSL -I /usr/include/pcap/ -I /usr/include/ -O2 -g3 -ggdb

-c -o sha1.o sha1.c
cc -pipe -Wall -DOPENSSL -I /usr/include/pcap/ -I /usr/include/ -O2 -g3 -ggdb
-c -o utils.o utils.c
cc -pipe -Wall -DOPENSSL -I /usr/include/pcap/ -I /usr/include/ -O2 -g3 -ggdb
-c -o cowpatty.o cowpatty.c
cc -pipe -Wall -DOPENSSL -I /usr/include/pcap/ -I /usr/include/ -O2 -g3 -ggdb
-c -o genpmk.o genpmk.c


That's it.



If you have any problem please let me know.
vf

18 comments:

kerek2 said...

hi...plz help me..i cannot extract cowpatty.tgz...how to do that...i'm already dowload the file into c:cygwin....also how to do nano make file?...hope you can help/...tq

vfall said...

tar xvf cowpatty.tgz

HTH

vf

Anonymous said...

I extracted the cowpatty.tgz file but I really don't understand the following step man :

Open with nano Makefile, add path for pcap headers
old file:

##################################
LDLIBS = -lpcap
CFLAGS = -pipe -Wall -DOPENSSL
CFLAGS += -O2
LDLIBS += -lcrypto

new file:

##################################
LDLIBS = -lwpcap
CFLAGS = -pipe -Wall -DOPENSSL
CFLAGS += -I /usr/include/pcap/ -I /usr/include/
CFLAGS += -O2
LDLIBS += -lcrypto

...what do you mean by nano Makefile and all the rest ?

Thanks a lot.

Anonymous said...

Unfortunatelly the default installation of cygwin does not work.
there is no make command found.
So I can not run make.I can not figure it oout the packages I need to install the whole thing.There is no make command to choose.

Anonymous said...

It compiles but it is not functional. When trying to read packet file it says unknown packet format!. The packet file however reads correct in aircrack. whats missing?

Anonymous said...

$ make
MAKE Version 4.0 Copyright (c) 1987, 1996 Borland International
Fatal: 'md5.o' does not exist - don't know how to make it

Anonymous said...

just successfully compiled cowpatty 4.6, you have to install "make" in the devel section, then when done, copy: cowpatty.exe,genpmk.exe,cygwin1.dll and cygcrypto-0.9.8.dll. I didn't have cygcrypto-0.9.8.dll so i copied it from another win32 build of 4.0.

Unknown said...

http://matrixprogramming.com/Tools/InstallCygwin.html

above is a great site that explains the install process of Cygwin
and including
;MAKE & ;GCC-G77 & GCC-C++

Hope this helps

M0RB10U$

Unknown said...

http://matrixprogramming.com/Tools/InstallCygwin.html
This site contains instruction to include ;MAKE
into your CYGWIN installation

M0rbi0uS

Anonymous said...

tar: cowpatty-4.2: Cannot open: No such file or directory.
Tar: Error is not recoverable: exiting now

Anonymous said...

Someone that has compiled latest version for win32 let's upload the file somewhere at any hosts files.

Anonymous said...

how can i get ~/cowpatty-4.2
below,
------------------------------
love$love-pc ~
$ cd c:
love$love-pc /cygdrive/c
$ cd cowpatty
love$love-pc /cygdrive/cowpatty-4.2
$ make
bash: make: command not found
------------------------------
how can i get stat "~/cowpatty-4.2"
Please note me^^ thank you

Anonymous said...

how can i get ~/cowpatty-4.2
below,
------------------------------
love@love-pc ~
$ cd c:
love@love-pc /cygdrive/c
$ cd cowpatty
love@love-pc /cygdrive/cowpatty-4.2
$ make
bash: make: command not found
------------------------------
how can i get stat "~/cowpatty-4.2"
Please note me^^ thank you

Anonymous said...

cd /cygdrive/c/cowpatty-4.2/

Anonymous said...

Can be used for cowpatty-4.6, but before final "make" command you need to copy "libwpcap.a" to "libpcap.a" file, in \cygwin\lib\ directory :)

Thanks for fine job :)


E:\cowpatty-4.6>cowpatty.exe -V
cowpatty 4.6 - WPA-PSK dictionary attack.
$Id: cowpatty.c 264 2009-07-03 15:15:50Z jwright $

jordan said...

it says c:\cygwin\usr\include\pcap is non existaant. that is after i installed winpcap, any help???

Anonymous said...

4.6 then when done, copy: cowpatty.exe,genpmk.exe,cygwin1.dll and cygcrypto-0.9.8.dll. FROM WHERE? ...TO WHERE?

thanks

gMurray said...

gMurray@compaq4321 /cygdrive/c/cowpatty-4.6
$ make
cc -pipe -Wall -DOPENSSL -I /usr/include/pcap/ -I /usr/include/ -O2 -g3 -ggdb -c -o md5.o md5.c
cc: error trying to exec '/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe': execv: Bad address
cc -pipe -Wall -DOPENSSL -I /usr/include/pcap/ -I /usr/include/ -O2 -g3 -ggdb -c -o sha1.o sha1.c
cc: error trying to exec '/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe': execv: Bad address
cc -pipe -Wall -DOPENSSL -I /usr/include/pcap/ -I /usr/include/ -O2 -g3 -ggdb -c -o utils.o utils.c
cc: error trying to exec '/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe': execv: Bad address
cc -pipe -Wall -DOPENSSL -I /usr/include/pcap/ -I /usr/include/ -O2 -g3 -ggdb -c -o cowpatty.o cowpatty.c
cc: error trying to exec '/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe': execv: Bad address
cc -pipe -Wall -DOPENSSL -I /usr/include/pcap/ -I /usr/include/ -O2 -g3 -ggdb -c -o genpmk.o genpmk.c
cc: error trying to exec '/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe': execv: Bad address
cc -pipe -Wall -DOPENSSL -I /usr/include/pcap/ -I /usr/include/ -O2 -g3 -ggdb cowpatty.c -o cowpatty utils.o md5.o sha1.o -lpcap -lcrypto
cc: error trying to exec '/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe': execv: Bad address
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lcrypto
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -luser32
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lkernel32
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -ladvapi32
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lshell32
collect2: ld returned 1 exit status
Makefile:25: recipe for target `cowpatty' failed
make: *** [cowpatty] Error 1

plz help