xl7dev

Metasploit Install On Mac osx 10.11.3

Install Homebrew

1
> /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Download Metasploit

1
> git clone https://github.com/rapid7/metasploit-framework.git /usr/local/share/metasploit-framework

Rubys proxy

1
2
3
> cd /usr/local/share/metasploit-framework && gem update
> export http_proxy=http://127.0.0.1:8087 # Settings [goagent](https://github.com/XX-net/XX-Net) proxy
> export http_proxy=https://127.0.0.1:8087 #https ssl certificate证书问题,编辑Gemfile把第一行中的https replace http

如果不需要代理执行如下命令取消

1
2
> unset http_proxy      #取消http proxy
> unset https_proxy #取消https proxy

Install rbenv && ruby

1
2
3
4
5
6
7
> brew install rbenv ruby-build rbenv-default-gems rbenv-gem-rehash 
rbenv-vars
> rbenv install -list
> rbenv install 2.1.8 # 安装2.1.8的ruby
> rbenv rehash
> rbenv global 2.1.8 # 全局使用2.1.8版本ruby
> gem install bundler && bundle install

Install Nmap

1
> brew install nmap

Install PostgreSQL

1
2
3
4
5
6
7
> brew install postgresql --without-ossp-uuid
> initdb /usr/local/var/postgres
> mkdir -p ~/Library/LaunchAgents
> cp /usr/local/Cellar/postgresql/9.5.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 localhost

Setting Metasploit Database

1
> vi /usr/local/share/metasploit-framework/config/database.yml
1
2
3
4
5
6
7
8
9
production:
adapter: postgresql
database: msf
username: msf
password: <password>
host: 127.0.0.1
port: 5432
pool: 75
timeout: 5
1
2
> cd /usr/local/share/metasploit-framework
> ./msfconsole

Easy install metasploit for OSX

1
> curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall

update

1
> msfupdate