Speed up Metasploit with Ruby 2.1.5

Started by ZEROF, February 11, 2015, 01:41:31 AM

Previous topic - Next topic

ZEROF

Hi,

Last news is that in the future MSF will support only newest Ruby version, from 2.1.5. But even now we can use MSF with Ruby 2.1.5 to get better performances.

# Install rbenv

sudo DEBIAN_FRONTEND=noninteractive apt-get install -y gcc make build-essential libcurl4-openssl-dev ruby-dev libssl-dev openssl libreadline-dev
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
source ~/.bash_profile


# Install ruby

rbenv install 2.1.5

# Then set system Ruby to use 2.1.5

rbenv shell 2.1.5

And you are ready to use MSF with last supported Ruby version.

If you have issue with gems you will need to install them:

sudo gem install bundle
sudo bundle install


P.S. You don't need to remove older version from system because they are used by tool like wpscan.

EDIT: Don't use this tutorial, read https://forum.backbox.org/announcements/backbox-switched-to-ruby2-1/msg8753/#new. Thank you.

Have fun!

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

sentinus

#1
hi zerof. i tired i get this error also when i type msfupdate i get same error
first when i type sudo DEBIAN_FRONTEND=noninteractive apt-get install -y gcc make build-essential libcurl4-openssl-dev ruby-dev libssl-dev openssl libreadline-dev [code]

says
[code]libreadline-dev and libcurl4-openssl-dev packages not available on repo


Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

   /usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/do_sqlite3-0.10.14 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86-linux/2.1.0/do_sqlite3-0.10.14/gem_make.out
An error occurred while installing do_sqlite3 (0.10.14), and Bundler cannot
continue.
Make sure that `gem install do_sqlite3 -v '0.10.14'` succeeds before bundling.
dpkg: error processing package beef-project (--configure):
installed post-installation script alt işlemi çıkış durumunda hata döndürdü : 5
metasploit-framework (4.11+git20150226-0backbox1) ayarlanıyor...
Extracting Metasploit Framework ...


aslo i treid to install   ri1.9.1 ruby-dev again i get same error

beef-project (0.4.6~alpha+git20150227-0backbox1) ayarlanıyor...
Extracting beef ...
Installing Ruby Gems ...
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from http://rubygems.org/.........
Fetching version metadata from http://rubygems.org/..
Fetching dependency metadata from http://rubygems.org/..
Resolving dependencies...
Using addressable 2.3.6
Using ansi 1.4.3
Using daemons 1.1.9
Using data_objects 0.10.14
Using dm-core 1.2.1
Using dm-do-adapter 1.2.0
Using dm-migrations 1.2.0
Using fastercsv 1.5.5
Using json 1.8.1
Using json_pure 1.8.2
Using multi_json 1.10.1
Using dm-serializer 1.2.2

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

   /usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/do_sqlite3-0.10.14 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86-linux/2.1.0/do_sqlite3-0.10.14/gem_make.out
An error occurred while installing do_sqlite3 (0.10.14), and Bundler cannot
continue.
Make sure that `gem install do_sqlite3 -v '0.10.14'` succeeds before bundling.
dpkg: error processing package beef-project (--configure):
installed post-installation script alt işlemi çıkış durumunda hata döndürdü : 5
metasploit-framework (4.11+git20150226-0backbox1) ayarlanıyor...
Extracting Metasploit Framework ...
[/code][/code]

ZEROF

#2
Sorry i didn't remove this tutorial, we have updated BBox ruby to new version in last 24h, you will not need to use this tutorial anymore ;). Purge your system https://forum.backbox.org/announcements/backbox-switched-to-ruby2-1/msg8753/#new and install ruby from our repository.

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*