In order to get Metasploit Framework working, your machine or VPS has to have at least 2GB of RAM. If you want to setup a database, 4GB is reccomended.
If you do not have a machine with this much RAM, or are renting a VPS, you should search how to do Paging, although please note that your RAM will be extremely slow.
If you have enough ram, feel free to skip this section.
By setting up Paging, we are repurposing your storage and using it as very slow RAM.
Please note, that if you are not running as root, you will need to have sudo
before most of these commands. If it says Permissions Denied
or something similiar, add sudo
. For example, instead of touch swap.img
, write sudo touch swap.img
.
- Run
free
in order to see how much RAM you currently have.
- Run the commands
cd /var
which sets your directory to/var/
.
- Then run
touch swap.img
which creates our paging file in the/var/
directory.
- After this we want to set the correct permissions for the
swap.img
file by runningchmod 600 swap.img
.
- We will now run
dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
in order to allocate the storage for paging. This specific command allocates 1GB, but if you need more eddit the command as appropriate.
- After this, run the command
mkswap /var/swap.img
- and
swapon /var/swap.img
in order to setup the paging.
- Now run
free
again in order to compare the RAM difference.
- Restart your device before proceeding.
First of all, we have to setup Ruby. Feel free to skip this part if ruby is already working on your device.
- first we want to install rvm by running
\curl -L https://get.rvm.io | bash -s stable
. If you get a message that tells you that the keys could not be verified, run all the commands it instructs you to run, restart your device, and then try this command again. - Restart your device
- Download the appropriate Ruby version. I personally want to insteall Ruby 1.9.3, so I ran
rvm install 1.9.3
but I reccomend installing 2 versions bellow the newest version. YOu can find out what the newest version is by going to Ruby's website. For example, If the newest version is 3.2.3, I reccomend installing Ruby 3.2.1.
- Next, we will create a gemset with the command
rvm gemset create rails3
.
- Now we will use the Ruby version you downlaoded as a defualt for the Gemset. As I downloaded 1.9.3, I will run the command
rvm use 1.9.3@rails3 --default
. - Now, as the last step, wil will download rails with
gem install rails --pre --no-document
. - Restart your device.
Now, the final part is installing metasploit itself. This is suprisingly easy.
- Run
sudo snap install metasploit-framework
. Although the Snap version of metasploit is outdated most of the time, it is the easiest way of installing Metasploit on non-kali machines, and the only functioning way I have found. I think that it is well worth the trade off. - Run
msfconsole
and enjoy your Metasploit!