Skip to content

Instantly share code, notes, and snippets.

@oogali
Last active September 5, 2021 23:27
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save oogali/bc8ff245894c696c4dfa to your computer and use it in GitHub Desktop.
Save oogali/bc8ff245894c696c4dfa 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
@romanianstrife
Copy link

Need to source the bash profile before the script can continue

. ~/.bash_profile

also, gem bundler require ruby >= 2.3.0 now

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