2024-05-16 22:43:34 +00:00
|
|
|
{ stdenv, lib, fetchFromGitLab, autoreconfHook, libpcap, db, glib, libnet, libnids, symlinkJoin, openssl
|
2023-04-09 07:38:28 +00:00
|
|
|
, rpcsvc-proto, libtirpc, libnsl, libnl
|
2020-08-21 12:27:42 +00:00
|
|
|
}:
|
2021-01-06 16:00:52 +00:00
|
|
|
|
2018-12-02 23:59:11 +00:00
|
|
|
let
|
|
|
|
/*
|
|
|
|
dsniff's build system unconditionnaly wants static libraries and does not
|
|
|
|
support multi output derivations. We do some overriding to give it
|
|
|
|
satisfaction.
|
|
|
|
*/
|
|
|
|
staticdb = symlinkJoin {
|
|
|
|
inherit (db) name;
|
2023-07-25 15:36:57 +00:00
|
|
|
paths = with db.overrideAttrs { dontDisableStatic = true; }; [ out dev ];
|
2018-12-02 23:59:11 +00:00
|
|
|
postBuild = ''
|
|
|
|
rm $out/lib/*.so*
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
pcap = symlinkJoin {
|
|
|
|
inherit (libpcap) name;
|
2023-07-25 15:36:57 +00:00
|
|
|
paths = [ (libpcap.overrideAttrs { dontDisableStatic = true; }) ];
|
2018-12-02 23:59:11 +00:00
|
|
|
postBuild = ''
|
|
|
|
cp -rs $out/include/pcap $out/include/net
|
|
|
|
# prevent references to libpcap
|
|
|
|
rm $out/lib/*.so*
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
net = symlinkJoin {
|
|
|
|
inherit (libnet) name;
|
2023-07-25 15:36:57 +00:00
|
|
|
paths = [ (libnet.overrideAttrs { dontDisableStatic = true; }) ];
|
2018-12-02 23:59:11 +00:00
|
|
|
postBuild = ''
|
|
|
|
# prevent dynamic linking, now that we have a static library
|
|
|
|
rm $out/lib/*.so*
|
|
|
|
'';
|
|
|
|
};
|
2023-07-25 15:36:57 +00:00
|
|
|
nids = libnids.overrideAttrs {
|
2018-12-02 23:59:11 +00:00
|
|
|
dontDisableStatic = true;
|
2023-07-25 15:36:57 +00:00
|
|
|
};
|
2018-12-02 23:59:11 +00:00
|
|
|
ssl = symlinkJoin {
|
2019-07-30 01:41:32 +00:00
|
|
|
inherit (openssl) name;
|
|
|
|
paths = with openssl.override { static = true; }; [ out dev ];
|
2018-12-02 23:59:11 +00:00
|
|
|
};
|
2024-05-16 22:43:34 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2018-12-02 23:59:11 +00:00
|
|
|
pname = "dsniff";
|
|
|
|
version = "2.4b1";
|
|
|
|
# upstream is so old that nearly every distribution packages the beta version.
|
|
|
|
# Also, upstream only serves the latest version, so we use debian's sources.
|
|
|
|
# this way we can benefit the numerous debian patches to be able to build
|
|
|
|
# dsniff with recent libraries.
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "salsa.debian.org";
|
|
|
|
owner = "pkg-security-team";
|
|
|
|
repo = "dsniff";
|
2021-03-06 23:31:43 +00:00
|
|
|
rev = "debian/${version}+debian-30";
|
|
|
|
sha256 = "1fk2k0sfdp5g27i11g0sbzm7al52raz5yr1aibzssnysv7l9xgzh";
|
2018-12-02 23:59:11 +00:00
|
|
|
name = "dsniff.tar.gz";
|
|
|
|
};
|
|
|
|
|
2020-08-21 12:27:42 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook rpcsvc-proto ];
|
2023-04-09 07:38:28 +00:00
|
|
|
buildInputs = [ glib pcap libtirpc libnsl libnl ];
|
|
|
|
NIX_CFLAGS_LINK = "-lglib-2.0 -lpthread -ltirpc -lnl-3 -lnl-genl-3";
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [ "-I${libtirpc.dev}/include/tirpc" ];
|
2018-12-02 23:59:11 +00:00
|
|
|
postPatch = ''
|
|
|
|
for patch in debian/patches/*.patch; do
|
|
|
|
patch < $patch
|
|
|
|
done;
|
|
|
|
'';
|
|
|
|
configureFlags = [
|
|
|
|
"--with-db=${staticdb}"
|
|
|
|
"--with-libpcap=${pcap}"
|
|
|
|
"--with-libnet=${net}"
|
|
|
|
"--with-libnids=${nids}"
|
|
|
|
"--with-openssl=${ssl}"
|
|
|
|
];
|
|
|
|
|
2021-01-06 16:00:52 +00:00
|
|
|
meta = with lib; {
|
2018-12-02 23:59:11 +00:00
|
|
|
description = "collection of tools for network auditing and penetration testing";
|
|
|
|
longDescription = ''
|
|
|
|
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.
|
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.monkey.org/~dugsong/dsniff/";
|
2018-12-02 23:59:11 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.symphorien ];
|
|
|
|
# bsd and solaris should work as well
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|