Skip to content

Instantly share code, notes, and snippets.

@picatz
Created November 9, 2017 03:13
Show Gist options
  • Save picatz/4079ec08813fe04a6c5ccab9a547a37d to your computer and use it in GitHub Desktop.
Save picatz/4079ec08813fe04a6c5ccab9a547a37d to your computer and use it in GitHub Desktop.
Ubuntu Xenial64 -- Install Metasploit Framework
# Built ontop of the work started by this gangster:
# https://www.darkoperator.com/installing-metasploit-in-ubunt/
function install::updates() {
sudo apt-get update -y
}
function install::upgrades() {
sudo apt-get upgrade -y
}
function install::fuck_tons_of_shit() {
sudo apt-get install gnupg2 build-essential libreadline-dev libssl-dev libpq5 libpq-dev libreadline5 libsqlite3-dev libpcap-dev git-core autoconf postgresql pgadmin3 curl zlib1g-dev libxml2-dev libxslt1-dev vncviewer libyaml-dev curl zlib1g-dev -y
}
function install::ruby_and_rvm() {
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
source ~/.bashrc
RUBYVERSION=$(wget https://raw.githubusercontent.com/rapid7/metasploit-framework/master/.ruby-version -q -O - )
rvm install $RUBYVERSION
rvm use $RUBYVERSION --default
ruby -v
}
function install::nmap() {
mkdir ~/Development
cd ~/Development
git clone https://github.com/nmap/nmap.git
cd nmap
./configure
make
sudo make install
make clean
cd /
}
function install::postgres_info() {
# need to re-test this
sudo -s
su postgres
createuser msf -P -S -R -D
createdb -O msf msf
exit
exit
}
function install::msf() {
cd /opt
sudo git clone https://github.com/rapid7/metasploit-framework.git
sudo chown -R `whoami` /opt/metasploit-framework
cd metasploit-framework
rvm --default use ruby-${RUByVERSION}@metasploit-framework
gem install bundler
bundle install
sudo bash -c 'for MSF in $(ls msf*); do ln -s /opt/metasploit-framework/$MSF /usr/local/bin/$MSF;done'
}
function main() {
install::updates
install::upgrades
install::fuck_tons_of_shit
install::ruby_and_rvm
install::nmap
install::postgres_info
install::msf
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment