博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux下安装渗透测试框架Metasploit
阅读量:5165 次
发布时间:2019-06-13

本文共 6232 字,大约阅读时间需要 20 分钟。

我们先来说一种方法,直接从github来下载:

git clone --depth=1  git://github.com/rapid7/metasploit-framework metasploit

 

然后:

 

cd ./metasploit

 

结果是这样的:

 

magic@luna:~/metasploit$ lsapp		    features			  msfconsole  scriptCODE_OF_CONDUCT.md  Gemfile			  msfd	      scriptsconfig		    Gemfile.local.example	  msfrpc      specCONTRIBUTING.md     Gemfile.lock		  msfrpcd     testCOPYING		    HACKING			  msfupdate   toolsdata		    lib				  msfvenom    Vagrantfiledb		    LICENSE			  pluginsdocumentation	    metasploit-framework.gemspec  Rakefileexternal	    modules			  README.md

 

然后直接msfconsole就可以运行了。另外就是更新也在这里:msfupdate(执行的时候注意权限问题)

 

第二种方法:

 

首先我们来下载一下这个文件,并且保存的文件名称为msfinstall

 

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

 

结果是这样的:

 

root@luna:/home/magic/tools/metasploit# curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb#!/bin/shprint_pgp_key() {  cat <<-EOF-----BEGIN PGP PUBLIC KEY BLOCK-----Version: GnuPG v1mQINBFDAy/0BEAC8I5bw5gLQqHKx5JCacYcXFL6AZowl3qIOTxo5yfBl8CepNpWYOOERvIUJb17WehhhbWOo9WjpBalDXBRtI1NvfArewOT8fLm7BdhYe8U45moBfkYixFtNrPw3pdIltHQISrB8PufhliN8obQuq0rcxYV8NblvYo4gIGNjBfO1QGvBNmp7kBtjlAuZguScZmUTdPOwfv8fqN52X9tCv1ahQk1hg8XG9YwW0vXb5z93jkLXBb5bsRCnou4m9IV6vOv2HVNRyMKT7uht3z4FqflP9NkySl4daCdZgmXbf169vvLdwLrClVymwAbwvuyILZv4JW1w0Kx8nWiTuK5A886882i83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7ca0yFXJgKJznLAFQ8g+b8aLyvodZYHjblaizkojEWDN3zPTQebnP7N8wTl0+rc2F3Bmnak6+m0P/F1kYXyz3obSvQXwe3rYAkxarcg95wXQRn6hN0PBb5lD05Ytx/peZrYpYFe4CYPtiL+y7sseExQhrRjpWr3FKGCKBpsrQkGUk3MiZ4iHVvlyKv/Z9IMYNRmVzMXUM2QAbRgYD0x4kvdXso6YR2rn8sC89c/OxIBK1HRwVgfRofUe9PmdeKhsBVYEQkNb8V18YP0GswrBc4cjoGqDwV64yPAotP2tB9QhqjJFM9xDT/wJSxKi1uzzSwQBfpD/ylsTB6/v1K3dksvQ6cVZqaBt4g2hq78rEq+ZyncUD2z3eXXrlVheqJdXZXoayQFaTo4iIAc7wbraZZ6mDr6mxxFMlUqO2qxTh3RIcafYvaF7yUDA=hQKe-----END PGP PUBLIC KEY BLOCK-----EOF}install_deb() {  LIST_FILE=/etc/apt/sources.list.d/metasploit-framework.list  PREF_FILE=/etc/apt/preferences.d/pin-metasploit.pref  if [ ! -f $LIST_FILE ]; then    echo -n "Adding metasploit-framework to your repository list.."    echo "deb $DOWNLOAD_URI/apt lucid main" > $LIST_FILE    print_pgp_key | apt-key add -  fi  if [ ! -f $PREF_FILE ]; then    mkdir -p /etc/apt/preferences.d/    cat > $PREF_FILE <
/dev/null echo "OK" echo "Checking for and installing update.." apt-get install -y --force-yes metasploit-framework}install_rpm() { echo "Checking for and installing update.." REPO_FILE=/etc/yum.repos.d/metasploit-framework.repo GPG_KEY_FILE=/etc/pki/rpm-gpg/RPM-GPG-KEY-Metasploit if [ ! -f $REPO_FILE ]; then echo -n "Adding metasploit-framework to your repository list.." cat > /etc/yum.repos.d/metasploit-framework.repo <
${GPG_KEY_FILE} fi yum install -y metasploit-framework}install_pkg(){ ( cd ~/Downloads echo "Downloading package..." curl -O "$DOWNLOAD_URI/osx/metasploitframework-latest.pkg" echo "Checking signature..." if pkgutil --check-signature metasploitframework-latest.pkg; then echo "Installing package..." installer -pkg metasploitframework-latest.pkg -target / fi echo "Cleaning up..." rm -fv metasploitframework-latest.pkg )}DOWNLOAD_URI=http://downloads.metasploit.com/data/releases/metasploit-frameworkPKGTYPE=unknownID=`id -u`if [ -f /etc/redhat-release ] ; then PKGTYPE=rpmelse if uname -sv | grep 'Darwin' > /dev/null; then PKGTYPE=pkg else PKGTYPE=deb fifiif [ "$ID" -ne 0 ]; then if ! hash sudo 2>/dev/null; then echo "This script must be executed as the 'root' user or with sudo" exit 1 else echo "Switching to root user to update the package" sudo -E $0 $@ exit 0 fificase $PKGTYPE in deb) install_deb ;; rpm) install_rpm ;; *) install_pkgesacroot@luna:/home/magic/tools/metasploit# lsmsfinstall

 

没错这个就是别人写好的下载脚本。你可以直接保存为msfinstall,然后赋予这个文件可执行权限就可以了。

 

chmod 755 msfinstall

 

然后来执行:

./msfinstall

 

然后我们就可以运行metasploit了:

msfconsole

 

ps:转载请注明出处。

 

转载于:https://www.cnblogs.com/magic-zero/p/6362795.html

你可能感兴趣的文章
oracle 递归查询
查看>>
java之多态的使用
查看>>
python 第八章 r w a 等文件操作
查看>>
软件工程第二次作业
查看>>
TCP/IP
查看>>
c++ 查找容器中符合条件的元素,并返回iterator(find_if)
查看>>
下载安装Android sdk tools
查看>>
C++ 我想这样用(七)
查看>>
poj-2376 Cleaning Shifts (排序+贪心)
查看>>
mssql 创建触发器
查看>>
2.python数据结构的性能分析
查看>>
DataTables给表格绑定事件
查看>>
jquery操作select(取值,设置选中)
查看>>
图的遍历
查看>>
在Android中自定义捕获Application全局异常,可以替换掉系统的强制退出对话框(很有参考价值与实用价值)...
查看>>
C语言第三次博客作业---单层循环结构
查看>>
DevExpress 程序运行后 layoutView 卡片大小发生变化
查看>>
WPF DevExpress 中GridControl如何设置选中单元格的Style
查看>>
查看python库文档
查看>>
Python网络编程_抓取百度首页代码(注释详细)
查看>>