13 name = "metasploit-bundler-env";
16 in stdenv.mkDerivation rec {
17 pname = "metasploit-framework";
20 src = fetchFromGitHub {
22 repo = "metasploit-framework";
23 rev = "refs/tags/${version}";
24 hash = "sha256-di7/LBqXrcIhy4UG5krAFSJ1ZhrJuGxEWJ25aVLuiGg=";
32 (python3.withPackages (ps: [ ps.requests ]))
35 dontPatchELF = true; # stay away from exploit executables
38 mkdir -p $out/{bin,share/msf}
40 cp -r * $out/share/msf
42 grep -rl "^#\!.*python2$" $out/share/msf | xargs -d '\n' rm
47 makeWrapper ${env}/bin/bundle $out/bin/$i \
48 --add-flags "exec ${ruby}/bin/ruby $out/share/msf/$i"
52 makeWrapper ${env}/bin/bundle $out/bin/msf-pattern_create \
53 --add-flags "exec ${ruby}/bin/ruby $out/share/msf/tools/exploit/pattern_create.rb"
55 makeWrapper ${env}/bin/bundle $out/bin/msf-pattern_offset \
56 --add-flags "exec ${ruby}/bin/ruby $out/share/msf/tools/exploit/pattern_offset.rb"
59 # run with: nix-shell maintainers/scripts/update.nix --argstr path metasploit
60 passthru.updateScript = ./update.sh;
63 description = "Metasploit Framework - a collection of exploits";
64 homepage = "https://docs.metasploit.com/";
65 platforms = platforms.unix;
66 license = licenses.bsd3;
67 maintainers = with maintainers; [ fab makefu ];
68 mainProgram = "msfconsole";