How to install Metasploit Framework in MacOSX

Metasploit is well know penetration tool , for me its one of my all time favorite tools for penetration testing . In this tutorial i will show you, how to install Metasploit Framework in MacOSX 10.8.3 with all dependencies .

Let’s Install Metasploit Framework in Mac OS X

Setup prerequisites

Install XCODE :
go to 
and install xcode or open Apple App Store and install xcode

Install Xcode
Install Xcode

After Installing xcode install Xcode  Command Line tools

  • open xcode 
  • go to prefrences
  • under downloads tab
  • click install on command line tools
  • and click install
Install Command line tools
Install Command line tools

For Mavericks and 10.9 + Users

  • Open Terminal and Type
xcode-select --install 

and choose install

command line tools mavericks

After Installing command Line Tools , Open terminal and type

$gcc -v
$g++ -v 
verify gcc and g++
verify gcc and g++

After installing and verifying all these components lets begin installing Ruby because metasploit is based on ruby backend so we have to install it first

1 : Install Homebrew

ruby -e "$(curl -fsSL"

2 : Install Git and wget

brew install git
brew install wget 

3 : Install  RVM (  ruby version manager ) for installing ruby

curl -#L | bash -s stable --autolibs=3 --ruby

4 : Install Ruby

rvm requirements 
brew install autoconf automake libtool libyaml readline libksba openssl
rvm install ruby-1.9.3
rvm gemset create msf
rvm use ruby-1.9.3@msf --default

it will take some time to compile ruby from source after that your can verify your ruby installation using

ruby -v 
ruby installed in mac
ruby installed in mac

Now ruby is installed in your mac .. YAY! one task is finished next is installing metasploit framework
for installing metasploit framework i like to keep things cleaner , means convention over configuration for that i will create a folder under root Directory called  “/opt ”  then inside that i will install metasploit framework , it’s better to visualize the folder structure

$ sudo su 
# mkdir -p /opt/
# cd /opt 
# git clone msf

Download Source from github

cloning metasploit to local

After Cloning metasploit framework cd into that folder and run

$ sudo bundle install 

After bundler finish installing required gems then you can start framework by simple typing

$ sudo  ./msfconsole
metasploit installed in mac

done now you can use metasploit framework in your mac .

Tagged With : - -