This tutorial is a combination of a number of different guides that I’ve compiled on the subject of getting Metasploit to work on OSX. I have not been able to find any other site with a complete working solution, so I decided to write one myself. This has been tested on multiple environments from beginning to end. If you have any problems, please leave a comment and I will do my best to help you get things working.
First, install XCode using the App Store. Xcode is a free download.
XCode 5 does not give me the option to install the command line tools from the app, so we have to do it via command line.
1 xcode - select -- install
For this tutorial, I ended up going with Homebrew. I’ve always used MacPorts in the past, but I keep hearing more and more about Homebrew and wanted to give it a try. It turned out to be pretty painless.
Make sure to run your Brew Doctor as soon as Brew is installed to make sure everything is working properly
1 brew doctor
At the time of this tutorial, Metasploit requires package 448 of Ruby v1.9.3 in order to run properly, I’m sure that will change in the future, so please make sure to update your commands with the correct version number!!
1 2 3 4 rvm requirements rvm install ruby - 1.9.3 - p448 rvm gemset create msf rvm use ruby - 1.9.3 - p448 -- defaultThat last line is especially important since XCode 5.1 will default to Ruby 2.x.
You will now be asked to reload your source information.
1 source ~ / .rvm / scripts / rvm
There are a number of packages and dependencies that need to be installed in order to get everything running smoothly.
First, we need to install Nmap.
1 brew install nmap
Next we need to install GNU GCC. This may time some time since we are compiling the latest version from source.
1 brew tap homebrew / dupes ; brew install gcc -- use - llvmNext, we need PostgreSQL.
1 brew install postgresql -- without - ossp - uuidWith PostgreSQL installed, we need to configure a few things. Don’t forget to make sure that the version numbers below match the ones that were installed.
1 2 3 4 5 6 initdb / usr / local / var / postgres mkdir - p ~ / Library / LaunchAgents cp / usr / local / Cellar / postgresql / 9.2.1 / homebrew .mxcl .postgresql .plist ~ / Library / LaunchAgents / launchctl load - w ~ / Library / LaunchAgents / homebrew .mxcl .postgresql .plist createuser msf - P - h localhost createdb - O msf msf - h localhostWe need a few Ruby Gems to get Metasploit running.
1 gem install pg sqlite3 msgpack hpricotWe’re almost done. Now we just need to setup MSF to run in our new environment.
Paste the following information into the database.ymp file:
1 2 3 4 5 6 7 8 9 production : adapter : postgresql database : msf username : msf password : host : 127.0.0.1 port : 5432 pool : 75 timeout : 5Bundle Install
1 2 3 cd / opt / msf / bundle install #if this fails, run: sudo bundle install
We need to create symlinks of the metasploit executables in the /usr/bin/ folder, as a safeguard against Armitage not being able to find the MSF files.
1 ln - s / opt / msf / msf * / opt / local / bin /Now that we are done installing everything, let’s test Metasploit to make sure everything went smoothly.
1 sudo msfconsoleIf all goes well, you should see the Metasploit console!
It’s really unfortunate that Armitage no longer ships with the Metasploit Framework. Luckly this is a very short process
Click here to to download Armitage for OSX.
Armitage should be installed the same way you would install any other OSX app. Open the DMG file, and drag the application to your Applications folder.
For Mac OSX systems, there seems to be an issue with launching Armitage directly using the icon. In order to work around this, Armitage can be launched from the command line:
1 sudo - E java - jar "armitage.jar"
转载于:https://www.cnblogs.com/Savin/p/3642104.html
相关资源:苹果mac OS X上安装metasploit