百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>服务器> OSX(YOSEMITE)上安装METASPLOIT步骤详解
分享文章到:

OSX(YOSEMITE)上安装METASPLOIT步骤详解

发布时间:01/15 来源: 浏览: 关键词:
Metasploit是一款开源的安全漏洞检测工具,可以帮助安全和IT专业人士识别安全性问题,验证漏洞的缓解措施,并管理专家驱动的安全性进行评估,提供真正的安全风险情报。这些功能包括智能开发,密码审计,Web应用程序扫描,社会工程,下面一起来看它的安装步骤。


Metasploit一款基于ruby的渗透测试框架,官方只提供Windows和Linux的安装包,要在osx上安装需要手动准备运行环境,下面介绍安装过程。

安装要求:

技能:会使用Terminal,了解命令sudo的作用,帐号具备管理员权限。

操作系统:我使用的OS X Yosemite(10.10.3)。

网络:似乎rubygem和一些代码托管网站在大陆是被封锁的,所以你可能需要用到代理。

 

1.安装Xcode and Command Line Development Tools

打开AppStore搜索Xcode安装,快速链接(美国商店)https://itunes.apple.com/us/app/xcode/id497799835?mt=12

安装完成后在命令终端输入下面命令后会弹出一个新的安装窗口,根据提示进行安装。

xcode-select --install

2.安装JDK

提供下载链接:

http://download.oracle.com/otn-pub/java/jdk/8u40-b27/jdk-8u40-macosx-x64.dmg

3.安装Homebrew和运行环境

执行下面命令

#安装
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo PATH=/usr/local/bin:/usr/local/sbin:$PATH >> ~/.bash_profile
source ~/.bash_profile
#确保brew正常运行
brew doctor
brew tap homebrew/versions
brew tap homebrew/dupes
#通过brew安装nmap网络扫描软件
brew install nmap
#安装ruby2.1.5
brew install homebrew/versions/ruby21
#安装postgresql
brew install postgresql


4.下载metasploit安装相关ruby模块

请参照下面命令操作,注意执行bundle install前需cd到 /usr/local/share/metasploit-framework目录。


cd /usr/local/share/
git clone https://github.com/rapid7/metasploit-framework.git
cd metasploit-framework
for MSF in $(ls msf*); do ln -s /usr/local/share/metasploit-framework/$MSF /usr/local/bin/$MSF;done
sudo echo export MSF_DATABASE_CONFIG=/usr/local/share/metasploit-framework/config/database.yml >> /etc/profile
#产生vncviewer链接
echo '#!/usr/bin/env bash'>> /usr/local/bin/vncviewer
echo open vnc://\$1 >> /usr/local/bin/vncviewer
chmod +x /usr/local/bin/vncviewer
 
#安装模块
gem install pg sqlite3 msgpack activerecord redcarpet rspec simplecov yard bundler
#重要步骤! 安装nokogiri模块
gem install nokogiri -v '1.6.6.2' -- \
--use-system-libraries  -- \
--with-xml2-include=/usr/local/Cellar/libxml2/2.9.2/include/libxml2 \
--with-xml2-lib=/usr/local/Cellar/libxml2/2.9.2/lib \
--with-xslt-lib=/usr/local/lib \
--with-xslt-include=/usr/local/include
#安装其他模块

bundle install

5.配置Postgresql


#初始化数据库
initdb /usr/local/var/postgres
#创建“msf”用户和“msf”数据库,注意记下你设置的数据库密码
createuser msf -P -h localhost
createdb -O msf msf -h localhost
 
#配置postgresql随开机启动
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.4.1/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
 
#配置metasploit的数据库连接
#编辑器创建一个配置
vi /usr/local/share/metasploit-framework/config/database.yml
#配置内容,注意保留跟在冒号后的空格
##########配置开始################
production:
  adapter: postgresql
  database: msf
  username: msf
  password: <数据库密码>
  host: 127.0.0.1
  port: 5432
  pool: 75
  timeout: 5
###########配置结束################
6.大功告成

输入msfconsole进入metasploit的shell,输入db_status确认数据库连接正常。

打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有9人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板