nixpkgs/pkgs/tools/security/metasploit/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.6 KiB
Nix
Raw Normal View History

2021-09-27 08:28:20 +00:00
{ lib
, stdenv
, fetchFromGitHub
, makeWrapper
, ruby
, bundlerEnv
2021-10-19 20:52:58 +00:00
, python3
2021-09-27 08:28:20 +00:00
}:
let
env = bundlerEnv {
inherit ruby;
name = "metasploit-bundler-env";
gemdir = ./.;
};
in stdenv.mkDerivation rec {
pname = "metasploit-framework";
2023-01-01 15:37:10 +00:00
version = "6.2.33";
src = fetchFromGitHub {
owner = "rapid7";
repo = "metasploit-framework";
rev = version;
2023-01-01 15:37:10 +00:00
sha256 = "sha256-b7MBY+rQxDlXBJumtA7Kqm2yXDP8hEVaCfo8ydreWoY=";
};
nativeBuildInputs = [ makeWrapper ];
2021-10-19 20:52:58 +00:00
buildInputs = [ (python3.withPackages (ps: [ ps.requests ])) ];
dontPatchELF = true; # stay away from exploit executables
installPhase = ''
mkdir -p $out/{bin,share/msf}
cp -r * $out/share/msf
2021-10-19 20:52:58 +00:00
grep -rl "^#\!.*python2$" $out/share/msf | xargs -d '\n' rm
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
)
makeWrapper ${env}/bin/bundle $out/bin/msf-pattern_create \
--add-flags "exec ${ruby}/bin/ruby $out/share/msf/tools/exploit/pattern_create.rb"
makeWrapper ${env}/bin/bundle $out/bin/msf-pattern_offset \
--add-flags "exec ${ruby}/bin/ruby $out/share/msf/tools/exploit/pattern_offset.rb"
'';
2020-10-25 20:35:33 +00:00
# run with: nix-shell maintainers/scripts/update.nix --argstr path metasploit
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Metasploit Framework - a collection of exploits";
2022-06-10 09:26:54 +00:00
homepage = "https://docs.metasploit.com/";
platforms = platforms.unix;
license = licenses.bsd3;
2021-10-08 15:51:29 +00:00
maintainers = with maintainers; [ fab makefu ];
2021-05-23 21:39:20 +00:00
mainProgram = "msfconsole";
};
}