Skip to content

Instantly share code, notes, and snippets.

@tekwizz123
Created January 15, 2023 22:38
Show Gist options
  • Save tekwizz123/f186abc801e780c9e0a299c4f3d6812d to your computer and use it in GitHub Desktop.
Save tekwizz123/f186abc801e780c9e0a299c4f3d6812d to your computer and use it in GitHub Desktop.
# Install Ubuntu 22.04.1 LTS
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
sudo apt-get install build-essential
brew install gcc
# Clone Metasploit n Set Up
mkdir -p ~/git
cd ~/git
git clone git@github.com:$GITHUB_USERNAME/metasploit-framework
cd ~/git/metasploit-framework
export GITHUB_USERNAME=YOUR_USERNAME_FOR_GITHUB
export GITHUB_EMAIL=YOUR_EMAIL_ADDRESS_FOR_GITHUB
git remote add upstream git@github.com:rapid7/metasploit-framework.git
git fetch upstream
git checkout -b upstream-master --track upstream/master
git config --global user.name "$GITHUB_USERNAME"
git config --global user.email "$GITHUB_EMAIL"
git config --global github.user "$GITHUB_USERNAME"
cd ~/git/metasploit-framework
ln -sf ../../tools/dev/pre-commit-hook.rb .git/hooks/pre-commit
ln -sf ../../tools/dev/pre-commit-hook.rb .git/hooks/post-merge
# Install Ruby
sudo apt update && sudo apt install -y git autoconf build-essential libpcap-dev libpq-dev zlib1g-dev libsqlite3-dev
brew install rbenv ruby-build
rbenv install 3.0.5 <- Note that for some reason doing this before the apt commands above will fail on SSL issues. Not sure why.
# Install Gems
gem install bundler
bundle install
# Set Up Database
sudo apt update && sudo apt-get install -y postgresql postgresql-client
sudo service postgresql start && sudo update-rc.d postgresql enable
./msfdb init <- Don't do this as the root user.
./msfconsole -qx "db_status; exit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment