This commit is contained in:
blshkv 2021-02-07 10:10:14 +08:00
parent 65a3fdc1ac
commit daf8634bce
No known key found for this signature in database
GPG key ID: 32BDCED870788F04
10 changed files with 0 additions and 511 deletions

View file

@ -1,2 +0,0 @@
DIST dsniff-2.4b1.tar.gz 131666 BLAKE2B f0cc3c875ed37ee573a28d2c54e7dc89bd14df233b047273ebb054820c2f8c61be22b0310c9354446a9ca6e99fdcd7f027fa7a122da667d4a809362dcb8c957f SHA512 62dafab293de6dc3e9b01561b3627d63ca334467c01c3550a6318d8bcbe99d5a301ec16967af34065a14e8bca1c4b6a41da766cbd51ebd8338615b950c4f642f
DIST dsniff_2.4b1+debian-29.debian.tar.xz 29668 BLAKE2B d41c4374ef25db7a93f9a64b9a1cf2d352e5c6938f31c28b765ef2e45416a7db71682e299a4b53446205c2403a26b4ffa2f7004db5d31ddf666a56816a742eac SHA512 a36b8a6d32bd586aa9e97d428807a113a159e0aa0ca014976a75cc2977ac6a62b57fdefc9ca8876533675249f0f32759767a4d0058e9643dde87091733e457c9

View file

@ -1,91 +0,0 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit autotools toolchain-funcs
MY_PV="${PV}_beta1"
DESCRIPTION="A collection of tools for network auditing and penetration testing"
HOMEPAGE="https://monkey.org/~dugsong/dsniff/"
SRC_URI="
https://monkey.org/~dugsong/${PN}/beta/${P}b1.tar.gz
mirror://debian/pool/main/d/${PN}/${PN}_2.4b1+debian-29.debian.tar.xz
"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ~ppc ~x86"
IUSE="libressl X"
DEPEND="net-libs/libpcap
>=net-libs/libnet-1.1.2.1-r1
>=net-libs/libnids-1.21
net-libs/libnsl:0=
net-libs/libtirpc
net-libs/rpcsvc-proto
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
>=sys-libs/db-4:*
X? ( x11-libs/libXmu )"
RDEPEND="${DEPEND}"
src_prepare() {
# replace Debian patch 23 with a simpler one (bug #506076)
mv -v \
"${WORKDIR}"/debian/patches/23_urlsnarf_timestamp.patch{,.old} || die
cp -v \
"${FILESDIR}"/${MY_PV}-urlsnarf-pcap_timestamps.patch \
"${WORKDIR}"/debian/patches/23_urlsnarf_timestamp.patch || die
# replace Debina patch with Fedora (works for both 1.0 and 1.1)
mv -v \
"${WORKDIR}"/debian/patches/24_Fix-OpenSSL1.1.0-Build.patch{,.old} || die
cp -v \
"${FILESDIR}"/${MY_PV}-openssl_110.patch \
"${WORKDIR}"/debian/patches/24_Fix-OpenSSL1.1.0-Build.patch || die
# Debian patchset, needs to be applied in the exact order that "series"
# lists or patching will fail.
# Bug #479882
eapply $(
for file in $(< "${WORKDIR}"/debian/patches/series ); do
printf "%s/debian/patches/%s " "${WORKDIR}" "${file}"
done
)
# Bug 125084
eapply "${FILESDIR}"/${MY_PV}-httppostfix.patch
# bug #538462
eapply "${FILESDIR}"/${MY_PV}-macof-size-calculation.patch
#https://bugs.gentoo.org/674192
# libtirpc support
eapply "${FILESDIR}"/${MY_PV}-rpc-r1.patch
# undo damage from debian patches
eapply "${FILESDIR}"/${MY_PV}-sharedir.patch
default
eautoreconf
}
src_configure() {
econf \
--with-libtirpc \
$(use_with X x) \
|| die "econf failed"
}
src_compile() {
emake CC="$(tc-getCC)"
}
src_install() {
emake install install_prefix="${D}"
dodir /etc/dsniff
cp "${D}"/usr/share/dsniff/{dnsspoof.hosts,dsniff.{magic,services}} \
"${D}"/etc/dsniff/ || die
dodoc CHANGES README TODO
}

View file

@ -1,20 +0,0 @@
--- a/decode_http.c 2000-12-19 07:38:05.000000000 +0800
+++ b/decode_http.c 2006-03-05 22:32:14.000000000 +0800
@@ -139,14 +139,14 @@
host = p;
}
else if (req[0] == 'P') {
- if (strncmp(p, "Content-type: ", 14) == 0) {
- if (strncmp(p + 14, "application/"
+ if (strncasecmp(p, "Content-type: ", 14) == 0) {
+ if (strncasecmp(p + 14, "application/"
"x-www-form-urlencoded",
33) != 0) {
query = NULL;
}
}
- else if (strncmp(p, "Content-length: ", 16) == 0) {
+ else if (strncasecmp(p, "Content-length: ", 16) == 0) {
p += 16;
i = atoi(p);
if ((msg = buf_tok(&inbuf, NULL, i)) == NULL)

View file

@ -1,11 +0,0 @@
--- a/macof.c
+++ b/macof.c
@@ -134,7 +134,7 @@ main(int argc, char *argv[])
libnet_build_tcp(sport, dport, seq, 0, TH_SYN, 512,
0, 0, LIBNET_TCP_H, NULL, 0, l, 0);
- libnet_build_ipv4(LIBNET_TCP_H, 0,
+ libnet_build_ipv4(LIBNET_IPV4_H + LIBNET_TCP_H, 0,
libnet_get_prand(LIBNET_PRu16), 0, 64,
IPPROTO_TCP, 0, src, dst, NULL, 0, l, 0);

View file

@ -1,243 +0,0 @@
Patch by Christoph Biedl <debian.axhn@manchmal.in-ulm.de> for dsniff >=
2.4b1, which fixes building with OpenSSL 1.1.0. Adapted for compatibility
with older OpenSSL versions by Robert Scheck <robert@fedoraproject.org>.
--- dsniff-2.4/ssh.c 2017-02-11 22:31:54.705269813 +0100
+++ dsniff-2.4/ssh.c.openssl_110 2017-02-11 22:45:31.193447230 +0100
@@ -234,6 +234,10 @@
u_char *p, cipher, cookie[8], msg[1024];
u_int32_t num;
int i;
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ const BIGNUM *servkey_e, *servkey_n;
+ const BIGNUM *hostkey_e, *hostkey_n;
+#endif
/* Generate anti-spoofing cookie. */
RAND_bytes(cookie, sizeof(cookie));
@@ -243,11 +247,23 @@
*p++ = SSH_SMSG_PUBLIC_KEY; /* type */
memcpy(p, cookie, 8); p += 8; /* cookie */
num = 768; PUTLONG(num, p); /* servkey bits */
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ RSA_get0_key(ssh->ctx->servkey, &servkey_n, &servkey_e, NULL);
+ put_bn(servkey_e, &p); /* servkey exponent */
+ put_bn(servkey_n, &p); /* servkey modulus */
+#else
put_bn(ssh->ctx->servkey->e, &p); /* servkey exponent */
put_bn(ssh->ctx->servkey->n, &p); /* servkey modulus */
+#endif
num = 1024; PUTLONG(num, p); /* hostkey bits */
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ RSA_get0_key(ssh->ctx->hostkey, &hostkey_n, &hostkey_e, NULL);
+ put_bn(hostkey_e, &p); /* hostkey exponent */
+ put_bn(hostkey_n, &p); /* hostkey modulus */
+#else
put_bn(ssh->ctx->hostkey->e, &p); /* hostkey exponent */
put_bn(ssh->ctx->hostkey->n, &p); /* hostkey modulus */
+#endif
num = 0; PUTLONG(num, p); /* protocol flags */
num = ssh->ctx->encmask; PUTLONG(num, p); /* ciphers */
num = ssh->ctx->authmask; PUTLONG(num, p); /* authmask */
@@ -298,7 +314,11 @@
SKIP(p, i, 4);
/* Decrypt session key. */
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ if (BN_cmp(servkey_n, hostkey_n) > 0) {
+#else
if (BN_cmp(ssh->ctx->servkey->n, ssh->ctx->hostkey->n) > 0) {
+#endif
rsa_private_decrypt(enckey, enckey, ssh->ctx->servkey);
rsa_private_decrypt(enckey, enckey, ssh->ctx->hostkey);
}
@@ -318,8 +338,13 @@
BN_clear_free(enckey);
/* Derive real session key using session id. */
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ if ((p = ssh_session_id(cookie, hostkey_n,
+ servkey_n)) == NULL) {
+#else
if ((p = ssh_session_id(cookie, ssh->ctx->hostkey->n,
ssh->ctx->servkey->n)) == NULL) {
+#endif
warn("ssh_session_id");
return (-1);
}
@@ -328,10 +353,15 @@
}
/* Set cipher. */
if (cipher == SSH_CIPHER_3DES) {
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ warnx("cipher 3des no longer supported");
+ return (-1);
+#else
ssh->estate = des3_init(ssh->sesskey, sizeof(ssh->sesskey));
ssh->dstate = des3_init(ssh->sesskey, sizeof(ssh->sesskey));
ssh->encrypt = des3_encrypt;
ssh->decrypt = des3_decrypt;
+#endif
}
else if (cipher == SSH_CIPHER_BLOWFISH) {
ssh->estate = blowfish_init(ssh->sesskey,sizeof(ssh->sesskey));
@@ -357,6 +387,10 @@
u_char *p, cipher, cookie[8], msg[1024];
u_int32_t num;
int i;
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ BIGNUM *servkey_n, *servkey_e;
+ BIGNUM *hostkey_n, *hostkey_e;
+#endif
/* Get public key. */
if ((i = SSH_recv(ssh, pkt, sizeof(pkt))) <= 0) {
@@ -379,21 +413,43 @@
/* Get servkey. */
ssh->ctx->servkey = RSA_new();
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ servkey_n = BN_new();
+ servkey_e = BN_new();
+ RSA_set0_key(ssh->ctx->servkey, servkey_n, servkey_e, NULL);
+#else
ssh->ctx->servkey->n = BN_new();
ssh->ctx->servkey->e = BN_new();
+#endif
SKIP(p, i, 4);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ get_bn(servkey_e, &p, &i);
+ get_bn(servkey_n, &p, &i);
+#else
get_bn(ssh->ctx->servkey->e, &p, &i);
get_bn(ssh->ctx->servkey->n, &p, &i);
+#endif
/* Get hostkey. */
ssh->ctx->hostkey = RSA_new();
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ hostkey_n = BN_new();
+ hostkey_e = BN_new();
+ RSA_set0_key(ssh->ctx->hostkey, hostkey_n, hostkey_e, NULL);
+#else
ssh->ctx->hostkey->n = BN_new();
ssh->ctx->hostkey->e = BN_new();
+#endif
SKIP(p, i, 4);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ get_bn(hostkey_e, &p, &i);
+ get_bn(hostkey_n, &p, &i);
+#else
get_bn(ssh->ctx->hostkey->e, &p, &i);
get_bn(ssh->ctx->hostkey->n, &p, &i);
+#endif
/* Get cipher, auth masks. */
SKIP(p, i, 4);
@@ -405,8 +461,13 @@
RAND_bytes(ssh->sesskey, sizeof(ssh->sesskey));
/* Obfuscate with session id. */
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ if ((p = ssh_session_id(cookie, hostkey_n,
+ servkey_n)) == NULL) {
+#else
if ((p = ssh_session_id(cookie, ssh->ctx->hostkey->n,
ssh->ctx->servkey->n)) == NULL) {
+#endif
warn("ssh_session_id");
return (-1);
}
@@ -422,7 +483,11 @@
else BN_add_word(bn, ssh->sesskey[i]);
}
/* Encrypt session key. */
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ if (BN_cmp(servkey_n, hostkey_n) < 0) {
+#else
if (BN_cmp(ssh->ctx->servkey->n, ssh->ctx->hostkey->n) < 0) {
+#endif
rsa_public_encrypt(bn, bn, ssh->ctx->servkey);
rsa_public_encrypt(bn, bn, ssh->ctx->hostkey);
}
@@ -470,10 +535,15 @@
ssh->decrypt = blowfish_decrypt;
}
else if (cipher == SSH_CIPHER_3DES) {
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ warnx("cipher 3des no longer supported");
+ return (-1);
+#else
ssh->estate = des3_init(ssh->sesskey, sizeof(ssh->sesskey));
ssh->dstate = des3_init(ssh->sesskey, sizeof(ssh->sesskey));
ssh->encrypt = des3_encrypt;
ssh->decrypt = des3_decrypt;
+#endif
}
/* Get server response. */
if ((i = SSH_recv(ssh, pkt, sizeof(pkt))) <= 0) {
--- dsniff-2.4/sshcrypto.c 2017-02-11 22:31:54.688270184 +0100
+++ dsniff-2.4/sshcrypto.c.openssl_110 2017-02-11 22:35:30.594555807 +0100
@@ -28,10 +28,12 @@
u_char iv[8];
};
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
struct des3_state {
des_key_schedule k1, k2, k3;
des_cblock iv1, iv2, iv3;
};
+#endif
void
rsa_public_encrypt(BIGNUM *out, BIGNUM *in, RSA *key)
@@ -39,10 +41,20 @@
u_char *inbuf, *outbuf;
int len, ilen, olen;
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ const BIGNUM *n, *e;
+ RSA_get0_key(key, &n, &e, NULL);
+ if (BN_num_bits(e) < 2 || !BN_is_odd(e))
+#else
if (BN_num_bits(key->e) < 2 || !BN_is_odd(key->e))
+#endif
errx(1, "rsa_public_encrypt() exponent too small or not odd");
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ olen = BN_num_bytes(n);
+#else
olen = BN_num_bytes(key->n);
+#endif
outbuf = malloc(olen);
ilen = BN_num_bytes(in);
@@ -71,7 +83,13 @@
u_char *inbuf, *outbuf;
int len, ilen, olen;
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ const BIGNUM *n;
+ RSA_get0_key(key, &n, NULL, NULL);
+ olen = BN_num_bytes(n);
+#else
olen = BN_num_bytes(key->n);
+#endif
outbuf = malloc(olen);
ilen = BN_num_bytes(in);
@@ -146,6 +164,7 @@
swap_bytes(dst, dst, len);
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
/* XXX - SSH1's weirdo 3DES... */
void *
des3_init(u_char *sesskey, int len)
@@ -194,3 +213,4 @@
des_ncbc_encrypt(dst, dst, len, dstate->k2, &dstate->iv2, DES_ENCRYPT);
des_ncbc_encrypt(dst, dst, len, dstate->k1, &dstate->iv1, DES_DECRYPT);
}
+#endif

View file

@ -1,41 +0,0 @@
diff -urP dsniff-2.4.orig/Makefile.in dsniff-2.4/Makefile.in
--- dsniff-2.4.orig/Makefile.in 2019-01-17 13:41:54.832180094 -0700
+++ dsniff-2.4/Makefile.in 2019-01-17 14:13:30.282057880 -0700
@@ -39,8 +39,8 @@
X11LIB = @X_LIBS@ @X_PRE_LIBS@ -lXmu -lX11 @X_EXTRA_LIBS@
INCS = -I. $(NIDSINC) $(PCAPINC) $(LNETINC) $(DBINC) $(SSLINC) $(X11INC) \
- -I$(srcdir)/missing
-LIBS = @LIBS@ -L$(srcdir) -lmissing
+ -I$(srcdir)/missing @RPC_CFLAGS@
+LIBS = @LIBS@ -L$(srcdir) -lmissing @RPC_LIBS@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff -urP dsniff-2.4.orig/configure.in dsniff-2.4/configure.in
--- dsniff-2.4.orig/configure.in 2019-01-17 13:41:54.632180080 -0700
+++ dsniff-2.4/configure.in 2019-01-17 14:15:05.824064731 -0700
@@ -338,4 +338,23 @@
AC_SUBST(SSLINC)
AC_SUBST(SSLLIB)
+AC_ARG_WITH([libtirpc],
+ AS_HELP_STRING([--with-libtirpc], [Use libtirpc as RPC implementation (instead of sunrpc)]),
+ [], [ with_libtirpc=no ])
+
+AS_IF([test "x$with_libtirpc" != xno],
+ [PKG_CHECK_MODULES([TIRPC],
+ [libtirpc],
+ [RPC_CFLAGS=$TIRPC_CFLAGS; RPC_LIBS=$TIRPC_LIBS;],
+ [AC_MSG_ERROR([libtirpc requested, but library not found.])]
+ )],
+ [AC_CHECK_HEADER(rpc/rpc.h,
+ [RPC_CFLAGS=""; RPC_LIBS="";],
+ [AC_MSG_ERROR([sunrpc requested, but headers are not present.])]
+ )]
+)
+
+AC_SUBST(RPC_CFLAGS)
+AC_SUBST(RPC_LIBS)
+
AC_OUTPUT(Makefile)

View file

@ -1,39 +0,0 @@
--- a/Makefile.in
+++ b/Makefile.in
@@ -37,8 +37,8 @@
X11INC = @X_CFLAGS@
X11LIB = @X_LIBS@ @X_PRE_LIBS@ -lXmu -lX11 @X_EXTRA_LIBS@
-INCS = -I. $(X11INC) -I$(srcdir)/missing
-LIBS = @LIBS@ -L$(srcdir) -lmissing
+INCS = -I. $(X11INC) -I$(srcdir)/missing @RPC_CFLAGS@
+LIBS = @LIBS@ -L$(srcdir) -lmissing @RPC_LIBS@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
--- a/configure.in
+++ b/configure.in
@@ -337,4 +337,23 @@
AC_SUBST(SSLINC)
AC_SUBST(SSLLIB)
+AC_ARG_WITH([libtirpc],
+ AS_HELP_STRING([--with-libtirpc], [Use libtirpc as RPC implementation (instead of sunrpc)]),
+ [], [ with_libtirpc=no ])
+
+AS_IF([test "x$with_libtirpc" != xno],
+ [PKG_CHECK_MODULES([TIRPC],
+ [libtirpc],
+ [RPC_CFLAGS=$TIRPC_CFLAGS; RPC_LIBS=$TIRPC_LIBS;],
+ [AC_MSG_ERROR([libtirpc requested, but library not found.])]
+ )],
+ [AC_CHECK_HEADER(rpc/rpc.h,
+ [RPC_CFLAGS=""; RPC_LIBS="";],
+ [AC_MSG_ERROR([sunrpc requested, but headers are not present.])]
+ )]
+)
+
+AC_SUBST(RPC_CFLAGS)
+AC_SUBST(RPC_LIBS)
+
AC_OUTPUT(Makefile)

View file

@ -1,32 +0,0 @@
diff -urP dsniff-2.4.orig/Makefile.in dsniff-2.4/Makefile.in
--- dsniff-2.4.orig/Makefile.in 2019-01-17 16:11:25.546048937 -0700
+++ dsniff-2.4/Makefile.in 2019-01-17 16:56:37.218243360 -0700
@@ -11,12 +11,12 @@
install_prefix =
prefix = @prefix@
exec_prefix = @exec_prefix@
-libdir = @libdir@
+sharedir = $(prefix)/share/dsniff
sbindir = @sbindir@
mandir = @mandir@
CC = @CC@
-CFLAGS = @CFLAGS@ -DDSNIFF_LIBDIR=\"$(libdir)/\"
+CFLAGS = @CFLAGS@ -DDSNIFF_LIBDIR=\"$(sharedir)/\"
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
@@ -157,10 +157,10 @@
for file in $(PROGS); do \
$(INSTALL_PROGRAM) -m 755 $$file $(install_prefix)$(sbindir); \
done
- test -d $(install_prefix)$(libdir) || \
- $(INSTALL) -d $(install_prefix)$(libdir)
+ test -d $(install_prefix)$(sharedir) || \
+ $(INSTALL) -d $(install_prefix)$(sharedir)
for file in $(CONFIGS); do \
- $(INSTALL_DATA) $$file $(install_prefix)$(libdir); \
+ $(INSTALL_DATA) $$file $(install_prefix)$(sharedir); \
done
test -d $(install_prefix)$(mandir)/man8 || \
$(INSTALL) -d $(install_prefix)$(mandir)/man8

View file

@ -1,15 +0,0 @@
Author: Hilko Bengen <bengen@debian.org>
Description: urlsnarf: use timestamps from pcap file if available. Closes: #573365
Index: dsniff-2.4b1+debian/urlsnarf.c
===================================================================
--- a/urlsnarf.c
+++ b/urlsnarf.c
@@ -57,7 +57,7 @@
{
static char tstr[32], sign;
struct tm *t, gmt;
- time_t tt = time(NULL);
+ time_t tt = nids_last_pcap_header->ts.tv_sec;
int days, hours, tz, len;
gmt = *gmtime(&tt);

View file

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>netmon@gentoo.org</email>
<name>Gentoo network monitoring and analysis project</name>
</maintainer>
<longdescription>
dsniff is a collection of tools for network auditing and penetration testing.
dsniff, filesnarf, mailsnarf, msgsnarf, urlsnarf, and webspy passively monitor a
network for interesting data (passwords, e-mail, files, etc.). arpspoof,
dnsspoof, and macof facilitate the interception of network traffic normally
unavailable to an attacker (e.g, due to layer-2 switching). sshmitm and webmitm
implement active monkey-in-the-middle attacks against redirected SSH and HTTPS
sessions by exploiting weak bindings in ad-hoc PKI.
</longdescription>
</pkgmetadata>