Navigation
« Fixin Raspistill and Raspivid for Headless Streaming on the Raspberry Pi | Main | Using Posh-SecMod PowerShell Module to Automate Nessus (Part 3) »
Sunday
Apr282013

Script to Automate Metasploit Framework Installation

For some time now I have been maintaining guides for installing Metasploit Framework on OSX, Ubuntu and CentOS. I decided this weekend to write a script to facilitate going thru all the steps. The script aids in installing Framework on OSX Mountain Lion and Ubuntu 12.10/13.04. the script can be found at https://github.com/darkoperator/MSF-Installer

To use the script on OSX Java, Xcode and Command Development Tools from Xcode must be installed before running the script. In the case of OSX I also added the option of installing GNU GCC in the case you want to compile the old Ruby 1.8.7 that requieres it. When you download the script you must make it executable, when ran with no arguments or with -h it will how the usage help message:

$ chmod +x msf_install.sh 
$ ./msf_install.sh -h
Scritp for Installing Metasploit Framework
By Carlos_Perez[at]darkoperator.com
Ver 0.1.0

-i                :Install Metasploit Framework.
-p      :password for MEtasploit databse msf user. If not provided a roandom one is generated for you.
-g                :Install GNU GCC (Not necessary uless you wish to compile and install ruby 1.8.7 in OSX
-h                :This help message

To start the installation you just run the script with the -i option and the installation will start. In the case of OSX it will:

  • Check that dependencies are meet.
  • Check if Homebrew is installed and of not it will install it.
  • Install Ruby 1.9.3
  • Install base ruby gems.
  • Install and configure Postgres for use with Metasploit
  • Install GCC if selected.
  • Download and install Metasploit Framework.
  • Installs all necessaries Ruby Gems using bundler.
  • Configure the database connection and sets the proper environment variables.
  • Download and install the latest version of Armitage.
  • Download and install the Pentest plugin and DNSRecon Import plugin.

in the case of Ubuntu 12.10 and 13.04 it will:

  • Install all necessary packages
  • Install base ruby gems.
  • Configure Postgres for use with Metasploit
  • Download and install Metasploit Framework.
  • Installs all necessaries Ruby Gems using bundler.
  • Configure the database connection and sets the proper environment variables.
  • Download and install the latest version of Armitage.
  • Download and install the Pentest plugin and DNSRecon Import plugin.

I let the script be as verbose as possible on purpose so as to identify any surprise changes from R7 or from any of the platforms. I hope it is useful to others as I know it will in my lab setups.

Reader Comments (5)

just installed msf on my new laptop ( ;-) ) works fine. just a question. in the future, can we use msf_install for update purposes like update_armitage??
June 25, 2013 | Unregistered Commenterteravice
Just download and run https://github.com/darkoperator/MSF-Installer/blob/master/update_armitage.sh to update Armitage I have plans to add it to install process
June 26, 2013 | Registered CommenterCarlos Perez
Carlos, thanks for the great metasploit installer script. I love your site design also. Good luck to you
August 20, 2013 | Unregistered CommenterMatt
I get this error on Ubuntu 13.04:
[*] The script does not support this platform at this moment.

Great stuff you have here btw!
September 8, 2013 | Unregistered Commenterjren
Just created a brand new vm and tested and it seem to be working properly. What specific version of Ubuntu are you running?
September 8, 2013 | Registered CommenterCarlos Perez

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.