#!/bin/bash
# RedHat Metasploit-Framework Installer
# https://foxpa.ws/install-metasploit-framework-on-redhat
# ---
# Obtain the latest release from GitHub
# You can git clone git://github.com/rapid7/metasploit-framework.git
# however I've had problems syncing on Qubes and the master .zip will always work.
# Consider using git for future updates. You may wish to add such to your crontab.
# Alternatively, use the Metasploit-hosted tarball at
# http://downloads.metasploit.com/data/releases/framework-latest.tar.bz2
sudo bash
cd /opt
wget https://github.com/rapid7/metasploit-framework/archive/refs/heads/master.zip
unzip master.zip
mv metasploit-framework-master metasploit
# Install Ruby dependencies
dnf -y install ruby-irb rubygems rubygem-bigdecimal rubygem-rake rubygem-i18n rubygem-bundler
dnf builddep -y ruby
dnf -y install ruby-devel libpcap-devel
gem install rake
# Install PostgreSQL (SQLite is no longer supported)
dnf -y install postgresql-server postgresql-devel
gem install pg
# Symlink the Metasploit tools to a PATH'd location:
ln -sf /opt/metasploit/msf* /usr/local/bin/
# Enable raw socket modules:
gem install pcaprub
# Install additional dependent Gems
bundle install --gemfile /opt/metasploit/Gemfile
