1 { stdenv, lib, fetchFromGitLab, autoreconfHook, libpcap, db, glib, libnet, libnids, symlinkJoin, openssl
2 , rpcsvc-proto, libtirpc, libnsl, libnl
7 dsniff's build system unconditionnaly wants static libraries and does not
8 support multi output derivations. We do some overriding to give it
11 staticdb = symlinkJoin {
13 paths = with db.overrideAttrs { dontDisableStatic = true; }; [ out dev ];
19 inherit (libpcap) name;
20 paths = [ (libpcap.overrideAttrs { dontDisableStatic = true; }) ];
22 cp -rs $out/include/pcap $out/include/net
23 # prevent references to libpcap
28 inherit (libnet) name;
29 paths = [ (libnet.overrideAttrs { dontDisableStatic = true; }) ];
31 # prevent dynamic linking, now that we have a static library
35 nids = libnids.overrideAttrs {
36 dontDisableStatic = true;
39 inherit (openssl) name;
40 paths = with openssl.override { static = true; }; [ out dev ];
42 in stdenv.mkDerivation rec {
45 # upstream is so old that nearly every distribution packages the beta version.
46 # Also, upstream only serves the latest version, so we use debian's sources.
47 # this way we can benefit the numerous debian patches to be able to build
48 # dsniff with recent libraries.
49 src = fetchFromGitLab {
50 domain = "salsa.debian.org";
51 owner = "pkg-security-team";
53 rev = "debian/${version}+debian-30";
54 sha256 = "1fk2k0sfdp5g27i11g0sbzm7al52raz5yr1aibzssnysv7l9xgzh";
55 name = "dsniff.tar.gz";
58 nativeBuildInputs = [ autoreconfHook rpcsvc-proto ];
59 buildInputs = [ glib pcap libtirpc libnsl libnl ];
60 NIX_CFLAGS_LINK = "-lglib-2.0 -lpthread -ltirpc -lnl-3 -lnl-genl-3";
61 env.NIX_CFLAGS_COMPILE = toString [ "-I${libtirpc.dev}/include/tirpc" ];
63 for patch in debian/patches/*.patch; do
68 "--with-db=${staticdb}"
69 "--with-libpcap=${pcap}"
70 "--with-libnet=${net}"
71 "--with-libnids=${nids}"
72 "--with-openssl=${ssl}"
76 description = "collection of tools for network auditing and penetration testing";
78 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.
80 homepage = "https://www.monkey.org/~dugsong/dsniff/";
81 license = licenses.bsd3;
82 maintainers = [ maintainers.symphorien ];
83 # bsd and solaris should work as well
84 platforms = platforms.linux;