2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, ruby, bundlerEnv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
env = bundlerEnv {
|
|
|
|
inherit ruby;
|
|
|
|
name = "metasploit-bundler-env";
|
|
|
|
gemdir = ./.;
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "metasploit-framework";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "6.0.50";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rapid7";
|
|
|
|
repo = "metasploit-framework";
|
|
|
|
rev = version;
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "sha256-ZtIpkUt3jIhe4st8JlxE0rvLe6P+QBGdjyTL13Avwj0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontPatchELF = true; # stay away from exploit executables
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,share/msf}
|
|
|
|
|
|
|
|
cp -r * $out/share/msf
|
|
|
|
|
|
|
|
(
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
# run with: nix-shell maintainers/scripts/update.nix --argstr path metasploit
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Metasploit Framework - a collection of exploits";
|
|
|
|
homepage = "https://github.com/rapid7/metasploit-framework/wiki";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.makefu ];
|
2021-05-28 09:39:13 +00:00
|
|
|
mainProgram = "msfconsole";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|