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