2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, ruby, bundlerEnv }:
|
2017-05-14 20:52:58 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
env = bundlerEnv {
|
|
|
|
inherit ruby;
|
|
|
|
name = "metasploit-bundler-env";
|
|
|
|
gemdir = ./.;
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "metasploit-framework";
|
2021-03-12 15:19:53 +00:00
|
|
|
version = "6.0.34";
|
2015-06-15 12:11:05 +00:00
|
|
|
|
2017-05-14 20:52:58 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rapid7";
|
|
|
|
repo = "metasploit-framework";
|
|
|
|
rev = version;
|
2021-03-12 15:19:53 +00:00
|
|
|
sha256 = "sha256-sKt1hN7thNhA+bjeFF3gxJs/82EPXPiM81zcMpDRDyg=";
|
2015-06-15 12:11:05 +00:00
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2017-05-14 20:52:58 +00:00
|
|
|
|
2019-07-23 10:32:11 +00:00
|
|
|
dontPatchELF = true; # stay away from exploit executables
|
2015-06-15 12:11:05 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2017-05-14 20:52:58 +00:00
|
|
|
mkdir -p $out/{bin,share/msf}
|
2015-06-15 12:11:05 +00:00
|
|
|
|
|
|
|
cp -r * $out/share/msf
|
|
|
|
|
2017-09-27 15:32:54 +00:00
|
|
|
(
|
|
|
|
cd $out/share/msf/
|
|
|
|
for i in msf*; do
|
|
|
|
makeWrapper ${env}/bin/bundle $out/bin/$i \
|
|
|
|
--add-flags "exec ${ruby}/bin/ruby $out/share/msf/$i"
|
|
|
|
done
|
|
|
|
)
|
|
|
|
|
2015-06-15 12:11:05 +00:00
|
|
|
'';
|
|
|
|
|
2020-10-25 20:35:33 +00:00
|
|
|
# run with: nix-shell maintainers/scripts/update.nix --argstr path metasploit
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-06-15 12:11:05 +00:00
|
|
|
description = "Metasploit Framework - a collection of exploits";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/rapid7/metasploit-framework/wiki";
|
2017-05-14 20:52:58 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.makefu ];
|
2015-06-15 12:11:05 +00:00
|
|
|
};
|
|
|
|
}
|