Happy New Year!

So this is the first post for this year and this guide can be applied to other Debian based GNU/Linux distros out there. For the sake of this tutorial, I'll just use my Linux Mint 16.

Installing Dependencies

Firstly, you might want to install several packages needed by Metasploit. Open up Terminal and update your system:

sudo apt-get update
sudo apt-get upgrade

Then, install the following packages:

sudo apt-get install build-essential libreadline-dev  libssl-dev libpq5 libpq-dev libreadline5 libsqlite3-dev libpcap-dev openjdk-7-jre subversion git-core autoconf postgresql pgadmin3 curl zlib1g-dev libxml2-dev libxslt1-dev vncviewer libyaml-dev ruby1.9.3

Then, install the Ruby libraries:

sudo gem install wirble sqlite3 bundler

Installing Nmap

This scanning tool is not included in Metasploit so we have to install it manually using  this command:

mkdir ~/Development
cd ~/Development
svn co https://svn.nmap.org/nmap
cd nmap
sudo make install
make clean

Configuring PostgreSQL Server

Now we have  to create the user and database to be used within Metasploit:

sudo -s
su postgres
createuser msf -P -S -R -D
createdb -O msf msf

Installing Metasploit

Here comes the real step. Installing Metasploit is very easy with the installation wizard. just follow the guide and click Next to the end. But firstly, Lets download the installer package from Rapid7.

Visit http://www.rapid7.com/products/metasploit/download.jsp and download Metasploit Community Version which is free. You can also buy the Pro version. It come with 7-days trial though. For me, the free version is good enough.

After downloading the installer, chmod it so we can execute it:

sudo chmod +x metasploit-latest-linux-installer.run

After that, run the installer as root:

sudo ./metasploit-latest-linux-installer.run

Follow the on-screen wizard until you finished.

After exiting the wizard, You'll be forwarded to Metasploit Web UI to con  figure your Metasploit for first use. This is an important step. Don't miss out!

You will have to wait for the initialization process to end. This might take a while but if this continues for more than 10 minutes, you better restart the service manually and start the initialization process again.

To restart the service, close your browser window and open up terminal and type in:

sudo bash /opt/metasploit/ctlscript.sh restart

After restarting the service, wait for a few minutes before accessing the initialization process again. Patience is the key to success!

Now, you should be able to register your copy of Metasploit Community and the key will be delivered to you via email instantly.

That's all, msfconsole time!!