15 name = "metasploit-bundler-env";
19 stdenv.mkDerivation (finalAttrs: {
20 pname = "metasploit-framework";
23 src = fetchFromGitHub {
25 repo = "metasploit-framework";
26 rev = "refs/tags/${finalAttrs.version}";
27 hash = "sha256-Zg6ui9B+l7tVVrv+gMpFL/xWuvdOc0Gf29s1ZvP2EYM=";
35 (python3.withPackages (ps: [ ps.requests ]))
38 dontPatchELF = true; # stay away from exploit executables
43 mkdir -p $out/{bin,share/msf}
45 cp -r * $out/share/msf
47 grep -rl "^#\!.*python2$" $out/share/msf | xargs -d '\n' rm
52 makeWrapper ${env}/bin/bundle $out/bin/$i \
53 --add-flags "exec ${ruby}/bin/ruby $out/share/msf/$i"
57 makeWrapper ${env}/bin/bundle $out/bin/msf-pattern_create \
58 --add-flags "exec ${ruby}/bin/ruby $out/share/msf/tools/exploit/pattern_create.rb"
60 makeWrapper ${env}/bin/bundle $out/bin/msf-pattern_offset \
61 --add-flags "exec ${ruby}/bin/ruby $out/share/msf/tools/exploit/pattern_offset.rb"
67 msfconsole-version = testers.testVersion {
68 package = finalAttrs.finalPackage;
69 command = "HOME=/tmp msfconsole -q -x 'version;exit'";
73 # run with: nix-shell maintainers/scripts/update.nix --argstr path metasploit
74 passthru.updateScript = ./update.sh;
77 description = "Metasploit Framework - a collection of exploits";
78 homepage = "https://docs.metasploit.com/";
79 platforms = platforms.unix;
80 license = licenses.bsd3;
81 maintainers = with maintainers; [
85 mainProgram = "msfconsole";