2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, libpcap }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "masscan";
|
2021-01-09 10:05:03 +00:00
|
|
|
version = "1.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "robertdavidgraham";
|
|
|
|
repo = "masscan";
|
|
|
|
rev = version;
|
2021-01-09 10:05:03 +00:00
|
|
|
sha256 = "04nlnficybgxa16kq9fwrrfjsbyiaps4mikfqgdr206fkqk9i05y";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" "GITVER=${version}" "CC=cc" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/man/man8
|
|
|
|
mkdir -p $out/share/{doc,licenses}/masscan
|
|
|
|
mkdir -p $out/etc/masscan
|
|
|
|
|
|
|
|
cp data/exclude.conf $out/etc/masscan
|
|
|
|
cp -t $out/share/doc/masscan doc/algorithm.js doc/howto-afl.md doc/bot.html
|
|
|
|
cp doc/masscan.8 $out/share/man/man8/masscan.8
|
|
|
|
cp LICENSE $out/share/licenses/masscan/LICENSE
|
|
|
|
|
|
|
|
wrapProgram $out/bin/masscan --prefix LD_LIBRARY_PATH : "${libpcap}/lib"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Fast scan of the Internet";
|
|
|
|
homepage = "https://github.com/robertdavidgraham/masscan";
|
|
|
|
license = licenses.agpl3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
|
|
|
};
|
|
|
|
}
|