Skip to content

Instantly share code, notes, and snippets.

@rdesfo
Created July 2, 2015 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdesfo/f5af3b5a60bdc13d181c to your computer and use it in GitHub Desktop.
Save rdesfo/f5af3b5a60bdc13d181c to your computer and use it in GitHub Desktop.
attempt metasploit default nix
args : with args;
rec {
src = fetchurl {
url = http://downloads.metasploit.com/data/releases/framework-latest.tar.bz2;
sha256 = "1irw71r9rymn826s7rwmk0rmjsk0gdfy75c1wwalln81r25x9n8x";
};
buildInputs = [makeWrapper];
configureFlags = [];
doInstall = fullDepEntry(''
mkdir -p $out/share/msf
mkdir -p $out/bin
cp -r * $out/share/msf
for i in $out/share/msf/msf*; do
makeWrapper $i $out/bin/$(basename $i) --prefix RUBYLIB : $out/share/msf/lib
done
'') ["minInit" "defEnsureDir" "doUnpack" "addInputs"];
/* doConfigure should be specified separately */
phaseNames = ["doInstall" (doPatchShebangs "$out/share/msf")];
name = "metasploit-framework-4.11.3";
meta = {
description = "Metasploit Framework - a collection of exploits";
homepage = "https://www.metasploit.com/";
license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [ rdesfo ];
platforms = stdenv.lib.platforms.all;
};
}
@rdesfo
Copy link
Author

rdesfo commented Jul 2, 2015

both

nix-build -A msf

and

nix-env -f . -iA msf

complete without returning an error, but when I run msfconsole

$ msfconsole 
[*] Metasploit requires the Bundler gem to be installed
    $ gem install bundler

so I tried running msfconsole in nix-shell

$ nix-shell -p bundler
$ msfconsole 
fatal: Not a git repository (or any of the parent directories): .git
Bundler could not find compatible versions for gem "bcrypt":
  In Gemfile:
    metasploit-framework (>= 0) ruby depends on
      bcrypt (>= 0) ruby
Could not find gem 'bcrypt (>= 0) ruby', which is required by gem 'metasploit-framework (>= 0) ruby', in any of the sources.

I also tried using the bundix tool which can be found here, but I couldn't get this to build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment