2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, ruby, bundlerEnv }:
|
2017-05-14 21:52:58 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
env = bundlerEnv {
|
|
|
|
inherit ruby;
|
|
|
|
name = "metasploit-bundler-env";
|
|
|
|
gemdir = ./.;
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "metasploit-framework";
|
2021-02-20 10:58:25 +00:00
|
|
|
version = "6.0.31";
|
2015-06-15 13:11:05 +01:00
|
|
|
|
2017-05-14 21:52:58 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rapid7";
|
|
|
|
repo = "metasploit-framework";
|
|
|
|
rev = version;
|
2021-02-20 10:58:25 +00:00
|
|
|
sha256 = "sha256-wt7VeS8NnmJHMhry/68W1S1f9jUnsSHnhUSrCQN1qNM=";
|
2015-06-15 13:11:05 +01:00
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2017-05-14 21:52:58 +01:00
|
|
|
|
2019-07-23 11:32:11 +01:00
|
|
|
dontPatchELF = true; # stay away from exploit executables
|
2015-06-15 13:11:05 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2017-05-14 21:52:58 +01:00
|
|
|
mkdir -p $out/{bin,share/msf}
|
2015-06-15 13:11:05 +01:00
|
|
|
|
|
|
|
cp -r * $out/share/msf
|
|
|
|
|
2017-09-27 16:32:54 +01: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 13:11:05 +01: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 13:11:05 +01:00
|
|
|
description = "Metasploit Framework - a collection of exploits";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/rapid7/metasploit-framework/wiki";
|
2017-05-14 21:52:58 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.makefu ];
|
2015-06-15 13:11:05 +01:00
|
|
|
};
|
|
|
|
}
|