Wednesday, December 27, 2006

Get your dsniff working on Slackware

Surely everyone has heard dsniff, an evil set of 31337 network tools. I finally grab a copy and wanna give it a try, but traditional ./confugre && make && make install didn't get it work. Couple hours googling took me a patch made by Sined , someone claimed it works while it didn't work on my slack box.. well, maybe it is for other distr or I have something missing (I guess I don't) , I got no clue what changes he made, neither able to google a solution works for me. So I figured out this simple dirty way, hope this helps for folks who facing the same problems.

www.packetfactory.net is down at the moment, I grabed a copy from http://www.enzotech.net/dsniff.html (Don't use ones on sf -outdated)
libnids-1.16-fixed-FC.tar.gz
libnet-1.0.2a-fixed-FC.tar.gz

After installing libnet and libnid,

insistkool@foo:~/dsniff$ ./configure
insistkool@foo:~/dsniff$ make
This produces bunch of compilation errors

----------------------------------------------------------------------------
./sshcrypto.c:25: error: field `key' has incomplete type
./sshcrypto.c:30: error: syntax error before "des_key_schedule"
./sshcrypto.c:30: warning: no semicolon at end of struct or union
./sshcrypto.c:31: warning: data definition has no type or storage class
./sshcrypto.c:32: error: syntax error before '}' token
./sshcrypto.c: In function `blowfish_encrypt':
./sshcrypto.c:131: error: `BF_ENCRYPT' undeclared (first use in this function)
./sshcrypto.c:131: error: (Each undeclared identifier is reported only once
./sshcrypto.c:131: error: for each function it appears in.)
./sshcrypto.c: In function `blowfish_decrypt':
./sshcrypto.c:143: error: `BF_DECRYPT' undeclared (first use in this function)
./sshcrypto.c: In function `des3_init':
./sshcrypto.c:153: error: dereferencing pointer to incomplete type
./sshcrypto.c:156: error: dereferencing pointer to incomplete type
./sshcrypto.c:157: error: dereferencing pointer to incomplete type
./sshcrypto.c:160: error: dereferencing pointer to incomplete type
./sshcrypto.c:162: error: dereferencing pointer to incomplete type
./sshcrypto.c:164: error: dereferencing pointer to incomplete type
./sshcrypto.c:165: error: dereferencing pointer to incomplete type
./sshcrypto.c:166: error: dereferencing pointer to incomplete type
./sshcrypto.c: In function `des3_encrypt':
./sshcrypto.c:176: error: dereferencing pointer to incomplete type
./sshcrypto.c:176: error: dereferencing pointer to incomplete type
./sshcrypto.c:178: error: dereferencing pointer to incomplete type
./sshcrypto.c:178: error: dereferencing pointer to incomplete type
./sshcrypto.c:178: error: `DES_ENCRYPT' undeclared (first use in this function)
./sshcrypto.c:179: error: dereferencing pointer to incomplete type
./sshcrypto.c:179: error: dereferencing pointer to incomplete type
./sshcrypto.c:179: error: `DES_DECRYPT' undeclared (first use in this function)
./sshcrypto.c:180: error: dereferencing pointer to incomplete type
./sshcrypto.c:180: error: dereferencing pointer to incomplete type
./sshcrypto.c: In function `des3_decrypt':
./sshcrypto.c:189: error: dereferencing pointer to incomplete type
./sshcrypto.c:189: error: dereferencing pointer to incomplete type
./sshcrypto.c:191: error: dereferencing pointer to incomplete type
./sshcrypto.c:191: error: dereferencing pointer to incomplete type
./sshcrypto.c:191: error: `DES_DECRYPT' undeclared (first use in this function)
./sshcrypto.c:192: error: dereferencing pointer to incomplete type
./sshcrypto.c:192: error: dereferencing pointer to incomplete type
./sshcrypto.c:192: error: `DES_ENCRYPT' undeclared (first use in this function)
./sshcrypto.c:193: error: dereferencing pointer to incomplete type
./sshcrypto.c:193: error: dereferencing pointer to incomplete type
make: *** [sshcrypto.o] Error 1

----------------------------------------------------------------------------

You can see err mainly caused by the failure to locate several function calls (des_key_schedule,DES_ENCRYPT, DES_DECRYPT etc). Be aware dsniff heavily relies on libnet, libnid and openssl (and few more)

insistkool@foo:~/dsniff$ cp sshcrypto.c sshcrypto.c.orig
insistkool@foo:~/dsniff$ vi sshcrypto.c
remove the space when you edit your file
15 #include <>
16 #include <>
17
18 #include <>
19 #include <>
20 #include
21
22 #include "sshcrypto.h"

So, we can tell compiler where these headers locate

15 #include <>
16 #include <>
17 #include <>
18 #include <>
19 #include <>
20 #include <>


All rite, now simply:
insistkool@foo:~/dsniff-2.3$ make
insistkool@foo:~/dsniff-2.3$ su -c 'make install'

Well, even I am on slackware, I think it will works just fine on other distributions. Lesson of the day - Don't google before read through give away message and get my hand dirty!

1 comment:

Anonymous said...

Hi,
I've got the same problem, but I don't understand your solution. What do you mean by "remove the space when you edit your file"? My sshcrypto.c looks like this:

#include "config.h"

#include [sys/types.h]
#include [openssl/ssl.h]

#include [err.h]
#include [stdio.h]
#include [stdlib.h]

#include "sshcrypto.h"

I'm using "[" instead of "<" because Google otherwise thinks it's a tag...

Thanks in advance