Installing metasploit on a cheap Debian VPS

Iraklis Mathiopoulos
2 min readSep 4, 2016

--

Update: If you want to install metasploit as root, run this quick script: https://github.com/iam1980/metasploit-vps-installer/blob/master/msf_root.sh

Sometimes you need metasploit running on a box with a public IP in order to get incoming reverse shells. There are numerous guides out there on how to do it, most of them are outdated and do not work. It turns out that following part of the official documentation is all that you need (https://github.com/rapid7/metasploit-framework/wiki/Setting-Up-a-Metasploit-Development-Environment).

I’m creating this short post and associated bash script for my own reference. Including the VPS provisioning, it shouldn't take more than 10 minutes to have metasploit up and running.

Step 1: Get a 512mb Debian (Jessie) VPS

512mb RAM is more than enough. We are not going to install PostgreSQL or any other service on that box, so if you are planning on installing more daemons, get something with a little bit more memory.

Step 2: Install required packages and add dedicated user

Run the following commands as root

adduser msfdev
adduser msfdev sudo
apt-get update
apt-get -y install autoconf bison build-essential curl git-core libapr1 libaprutil1 libcurl4-openssl-dev libgmp3-dev libpcap-dev libpq-dev libreadline6-dev libsqlite3-dev libssl-dev libsvn1 libtool libxml2 libxml2-dev libxslt-dev libyaml-dev locate ncurses-dev openssl wget xsel zlib1g zlib1g-dev

Step 3: As the msfdev user, download the metasploit installer script and execute it

Note: If you want to inspect the script before executing it: https://github.com/iam1980/metasploit-vps-installer

su - msfdev
wget https://raw.githubusercontent.com/iam1980/metasploit-vps-installer/master/msf_vps_installer.sh
bash msf_vps_installer.sh

All done. You should have a working msfconsole on your VPS.

--

--