Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 001101/b0c79f30bfb25d7517c3f193b96ebb67 to your computer and use it in GitHub Desktop.
Save 001101/b0c79f30bfb25d7517c3f193b96ebb67 to your computer and use it in GitHub Desktop.
Install Ruby 2.1.5 via rbenv, then Metasploit on CentOS
# install build deps
sudo yum install gcc gcc-c++ make expat-devel gettext-devel libcurl-devel \
libffi-devel libxml2-devel libxslt-devel libyaml-devel postgresql-server \
postgresql-devel readline-devel sqlite-devel openssl-devel ruby-devel \
rubygems autoconf automake bison libtool libpcap-devel
# install rbenv
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
# install ruby 2.1.5
rbenv install 2.1.5
# configure gem to not bother with installing docs
echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc
# install bundler
gem install bundler
# download latest development version of metasploit,
# tell rbenv to always use 2.1.5 for it,
# then install dependencies
git clone https://github.com/rapid7/metasploit-framework.git
cd metasploit-framework
rbenv local 2.1.5
bundle install
# initialize, configure, activate, and start postgresql
sudo service postgresql initdb
sudo service postgresql start
# create postgresql user and database for metasploit
sudo -u postgres -i createuser -DERPSl metasploit
sudo -u postgres -i createdb -O metasploit metasploit
# TODO: configure metasploit to use database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment