Metasploit on OS X Mavericks

I show you the steps that I followed to install Metasploit on Mavericks, with some solutions that I have used to solve some mistakes that I encountered during the installation.

First of all download and  install Command Line Tools (OSX 10.9):


Install  Java Development Kit (JDK) from: from:

Install “Homebrew” :

ruby -e “$(curl -fsSL”

echo PATH=/usr/local/bin:/usr/local/sbin:$PATH >> ~/.bash_profile

Install “NMAP”:

brew install nmap

Install “wget”:

brew install wget

Install “git”:

brew install git

To verify the version of gcc and g++ type:

gcc -v

g++ -v

If not present,  install gcc:

brew tap homebrew/versions brew install gcc47 –use-gcc

Check with “brew doctor” that there are no problems:

brew doctor

If you get the following error:

Error: No such file or directory – /usr/local/Cellar


sudo mkdir /usr/local/Cellar

sudo chown -R `whoami` /usr/local

Then run:

brew update

Install “Ruby” version 1.9.3:

brew install homebrew/versions/ruby193

To check the version:

ruby -v

If you want to install “Ruby” with rvm you can proceed as follows:

curl -L | bash rvm get head rvm requirements rvm install 1.9.3 rvm use 1.9.3 rvm default 1.9.3

If during compilation it’s presented to you an error about gcc4.7, you can try to solve it with:

CC=/usr/local/bin/gcc-4.2 rvm install 1.9.3 –enable-shared rvm use 1.9.3 –default

Install Ruby Msgpack:

port install msgpack

Install gem MSGPACK:

gem install msgpack

Set to use VNCViewer:

echo ‘#!/usr/bin/env bash’>> /usr/local/bin/vncviewer

echo open vnc://\$1 >> /usr/local/bin/vncviewer

chmod +x /usr/local/bin/vncviewer

Install the open source database “postgresql”:

brew install postgresql –without-ossp-uuid

Create a user with the name “MSF” (you will be prompted to enter and confirm a password, it will need us to configure the database):

createuser msf -P -h localhost

Create a database called msf:

createdb -O msf msf -h localhost

Install with “gem” other packages that will be used with MSF:

gem install pg sqlite3 msgpack activerecord redcarpet rspec simplecov yard bundler

Install “Metasploit”:

cd /usr/local/share/

git clone

cd metasploit-framework

for MSF in $(ls msf*); do ln -s /usr/local/share/metasploit-framework/$MSF /usr/local/bin/$MSF;done

sudo chmod go+w /etc/profile

sudo echo export MSF_DATABASE_CONFIG=/usr/local/share/metasploit-framework/database.yml >> /etc/profile

Go into the Metasploit directory and  type:

sudo bundle install

Install Ruby gem:

gem install pg sqlite3 msgpack hpricot

Configure the database  just created:

vim /usr/local/share/metasploit-framework/database.yml

Open with “vim” the file database.yml and type:


adapter: postgresql

database: msf

username: msf

password: (enter the password previously typed)


port: 5432


timeout: 5

Save and exit:

esc : wq


source /etc/profile

source ~/.bash_profile

Run Metasploit:

sudo msfconsole



Lascia un commento