ggreer / dsniff

Dug Song seems to have abandoned dsniff. I got it to work with the latest OS X & Homebrew libraries.
Other
339 stars 83 forks source link

Can't compile MacOS 10.15.4 #14

Open gghez opened 4 years ago

gghez commented 4 years ago
  1. Repository cloned

  2. brew deps installed

  3. ./configure command executed

  4. make command stdout/stderr merged output:

gcc -g -O2 -D_BSD_SOURCE -DHAVE_SOCKADDR_SA_LEN -DLIBNET_BSD_BYTE_SWAP -DDSNIFF_LIBDIR=\"/usr/local/share/dsniff/\" -I.  -I./missing -I/usr/local/opt/libpcap/include -I/usr/local/opt/libnet/include -I/usr/local/opt/libnids/include -I/usr/local/opt/openssl/include -I/usr/local/include -c ./ssh.c
./ssh.c:249:26: error: incomplete definition of type 'struct rsa_st'
        put_bn(ssh->ctx->servkey->e, &p);               /* servkey exponent */
               ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:250:26: error: incomplete definition of type 'struct rsa_st'
        put_bn(ssh->ctx->servkey->n, &p);               /* servkey modulus */
               ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:252:26: error: incomplete definition of type 'struct rsa_st'
        put_bn(ssh->ctx->hostkey->e, &p);               /* hostkey exponent */
               ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:253:26: error: incomplete definition of type 'struct rsa_st'
        put_bn(ssh->ctx->hostkey->n, &p);               /* hostkey modulus */
               ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:304:30: error: incomplete definition of type 'struct rsa_st'
        if (BN_cmp(ssh->ctx->servkey->n, ssh->ctx->hostkey->n) > 0) {
                   ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:304:52: error: incomplete definition of type 'struct rsa_st'
        if (BN_cmp(ssh->ctx->servkey->n, ssh->ctx->hostkey->n) > 0) {
                                         ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:324:51: error: incomplete definition of type 'struct rsa_st'
        if ((p = ssh_session_id(cookie, ssh->ctx->hostkey->n,
                                        ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:325:22: error: incomplete definition of type 'struct rsa_st'
                                ssh->ctx->servkey->n)) == NULL) {
                                ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:385:19: error: incomplete definition of type 'struct rsa_st'
        ssh->ctx->servkey->n = BN_new();
        ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:386:19: error: incomplete definition of type 'struct rsa_st'
        ssh->ctx->servkey->e = BN_new();
        ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:389:26: error: incomplete definition of type 'struct rsa_st'
        get_bn(ssh->ctx->servkey->e, &p, &i);
               ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:390:26: error: incomplete definition of type 'struct rsa_st'
        get_bn(ssh->ctx->servkey->n, &p, &i);
               ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:394:19: error: incomplete definition of type 'struct rsa_st'
        ssh->ctx->hostkey->n = BN_new();
        ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:395:19: error: incomplete definition of type 'struct rsa_st'
        ssh->ctx->hostkey->e = BN_new();
        ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:398:26: error: incomplete definition of type 'struct rsa_st'
        get_bn(ssh->ctx->hostkey->e, &p, &i);
               ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:399:26: error: incomplete definition of type 'struct rsa_st'
        get_bn(ssh->ctx->hostkey->n, &p, &i);
               ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:411:51: error: incomplete definition of type 'struct rsa_st'
        if ((p = ssh_session_id(cookie, ssh->ctx->hostkey->n,
                                        ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:412:22: error: incomplete definition of type 'struct rsa_st'
                                ssh->ctx->servkey->n)) == NULL) {
                                ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
./ssh.c:428:30: error: incomplete definition of type 'struct rsa_st'
        if (BN_cmp(ssh->ctx->servkey->n, ssh->ctx->hostkey->n) < 0) {
                   ~~~~~~~~~~~~~~~~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [ssh.o] Error 1
fannyhasbi commented 4 years ago

Same problem with me

Arthur111 commented 4 years ago

This is because your openssl version is too recent. You have to compile it with 1.0.* here : https://www.openssl.org/source/old/1.0.2/

This issue was already posted and closed ( https://github.com/ggreer/dsniff/issues/13 )

There is another problem with macOS 10.15

It must be linked with glib and gthread, this means add LDFLAGS='-lglib-2.0 -lgthread-2.0' in the ./configure command.

you can download Glib and gthread here : https://gitlab.gnome.org/GNOME/glib

concerning Berkley db you can download it here : http://www.linuxfromscratch.org/blfs/view/8.2/server/db.html