ubuntu安装Metasploit Framework(最简单)

概述

这个其实我以前说过ubuntu安装metasploit,就是在github上clone下来安装,但是那种方式安装的话会碰到很多依赖的问题,不方便安装,下面我推荐官方的,使用安装脚本安装

安装

首先打开终端输入
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall
之后如果你不是root用户登录的话你要输入root密码
接着你要做的是就是等待安装完成

 Bboysoul    shell git:(master) curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5394  100  5394    0     0   3105      0  0:00:01  0:00:01 --:--:--  3107
Switching to root user to update the package
[sudo] bboysoul 的密码: 
Adding metasploit-framework to your repository list..OK
Updating package cache..OK
Checking for and installing update..
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列【新】软件包将被安装:
  metasploit-framework
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 1 个软件包未被升级。
需要下载 177 MB 的归档。
解压缩后会消耗 423 MB 的额外空间。
获取:1 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid/main amd64 metasploit-framework amd64 4.16.16+20171109102640.git.1.c5fd027~1rapid7-1 [177 MB]
已下载 177 MB,耗时 2分 8秒 (1,373 kB/s)                                                                                                                                                                          
正在选中未选择的软件包 metasploit-framework。
(正在读取数据库 ... 系统当前共安装有 208821 个文件和目录。)
正准备解包 .../metasploit-framework_4.16.16+20171109102640.git.1.c5fd027~1rapid7-1_amd64.deb  ...
正在解包 metasploit-framework (4.16.16+20171109102640.git.1.c5fd027~1rapid7-1) ...
正在设置 metasploit-framework (4.16.16+20171109102640.git.1.c5fd027~1rapid7-1) ...
update-alternatives: 使用 /opt/metasploit-framework/bin/msfbinscan 来在自动模式中提供 /usr/bin/msfbinscan (msfbinscan)
update-alternatives: 使用 /opt/metasploit-framework/bin/msfconsole 来在自动模式中提供 /usr/bin/msfconsole (msfconsole)
update-alternatives: 使用 /opt/metasploit-framework/bin/msfd 来在自动模式中提供 /usr/bin/msfd (msfd)
update-alternatives: 使用 /opt/metasploit-framework/bin/msfdb 来在自动模式中提供 /usr/bin/msfdb (msfdb)
update-alternatives: 使用 /opt/metasploit-framework/bin/msfelfscan 来在自动模式中提供 /usr/bin/msfelfscan (msfelfscan)
update-alternatives: 使用 /opt/metasploit-framework/bin/msfmachscan 来在自动模式中提供 /usr/bin/msfmachscan (msfmachscan)
update-alternatives: 使用 /opt/metasploit-framework/bin/msfpescan 来在自动模式中提供 /usr/bin/msfpescan (msfpescan)
update-alternatives: 使用 /opt/metasploit-framework/bin/msfrop 来在自动模式中提供 /usr/bin/msfrop (msfrop)
update-alternatives: 使用 /opt/metasploit-framework/bin/msfrpc 来在自动模式中提供 /usr/bin/msfrpc (msfrpc)
update-alternatives: 使用 /opt/metasploit-framework/bin/msfrpcd 来在自动模式中提供 /usr/bin/msfrpcd (msfrpcd)
update-alternatives: 使用 /opt/metasploit-framework/bin/msfupdate 来在自动模式中提供 /usr/bin/msfupdate (msfupdate)
update-alternatives: 使用 /opt/metasploit-framework/bin/msfvenom 来在自动模式中提供 /usr/bin/msfvenom (msfvenom)
update-alternatives: 使用 /opt/metasploit-framework/bin/metasploit-aggregator 来在自动模式中提供 /usr/bin/metasploit-aggregator (metasploit-aggregator)
Run msfconsole to get started
W: --force-yes 已经被废弃,请使用以 --allow 开头的选项来代替。

安装完成

接着输入msfconsole
会提示你是否建立一个database,你输入yes就好

 Bboysoul    shell git:(master)  msfconsole

 ** Welcome to Metasploit Framework Initial Setup **
    Please answer a few questions to get started.


Would you like to use and setup a new database (recommended)? yes
Creating database at /home/bboysoul/.msf4/db
Starting database at /home/bboysoul/.msf4/db...success
Creating database users
Creating initial database schema

 ** Metasploit Framework Initial Setup Complete **

                                                  
  +-------------------------------------------------------+
  |  METASPLOIT by Rapid7                                 |
  +---------------------------+---------------------------+
  |      __________________   |                           |
  |  ==c(______(o(______(_()  | |""""""""""""|======[***  |
  |             )=\           | |  EXPLOIT   \            |
  |            // \\          | |_____________\_______    |
  |           //   \\         | |==[msf >]============\   |
  |          //     \\        | |______________________\  |
  |         // RECON \\       | \(@)(@)(@)(@)(@)(@)(@)/   |
  |        //         \\      |  *********************    |
  +---------------------------+---------------------------+
  |      o O o                |        \'\/\/\/'/         |
  |              o O          |         )======(          |
  |                 o         |       .'  LOOT  '.        |
  | |^^^^^^^^^^^^^^|l___      |      /    _||__   \       |
  | |    PAYLOAD     |""\___, |     /    (_||_     \      |
  | |________________|__|)__| |    |     __||_)     |     |
  | |(@)(@)"""**|(@)(@)**|(@) |    "       ||       "     |
  |  = = = = = = = = = = = =  |     '--------------'      |
  +---------------------------+---------------------------+


       =[ metasploit v4.16.16-dev-                        ]
+ -- --=[ 1702 exploits - 969 auxiliary - 299 post        ]
+ -- --=[ 503 payloads - 40 encoders - 10 nops            ]
+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]

msf > 

接着我们建立Module database,如果不建立那么你在search一些模块的时候会提示
[!] Module database cache not built yet, using slow search

在此之前我们首先要安装postgresql
sudo apt install postgresql
安装完成之后确认下服务是否开启,如果没有开启它

 Bboysoul    shell git:(master)  sudo service postgresql status
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
   Active: active (exited) since 五 2017-11-10 14:59:02 CST; 29s ago
 Main PID: 27540 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/postgresql.service

11月 10 14:59:02 bboysoul systemd[1]: Starting PostgreSQL RDBMS...
11月 10 14:59:02 bboysoul systemd[1]: Started PostgreSQL RDBMS.
11月 10 14:59:08 bboysoul systemd[1]: Started PostgreSQL RDBMS.

接着进入metasploit中,输入

msf > msfdb init
[*] exec: msfdb init

Found a database at /home/bboysoul/.msf4/db, checking to see if it is started
Database already started at /home/bboysoul/.msf4/db

之后输入

msf > db_rebuild_cache
[*] Purging and rebuilding the module cache in the background...

等几分钟之后执行
search ms10
看看是不是还有
[!] Module database cache not built yet, using slow search
这个警告
如果还有那么再等一段时间再次执行,如果十分钟以后还是出现这个警告,那么可能你的步骤错了

欢迎关注Bboysoul的博客www.bboysoul.com
Have Fun

  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 1. 首先,打开终端并更新软件包列表: sudo apt-get update 2. 安装依赖项: sudo apt-get install build-essential libreadline-dev libssl-dev libpq5 libpq-dev libreadline5 libsqlite3-dev libpcap-dev git-core autoconf postgresql pgadmin3 curl zlib1g-dev libxml2-dev libxslt1-dev libyaml-dev curl zlib1g-dev 3. 下载Metasploitgit clone https://github.com/rapid7/metasploit-framework.git 4. 进入Metasploit目录: cd metasploit-framework 5. 安装Metasploit: sudo ./msfconsole 6. 运行Metasploit: msfconsole 7. 如果需要更新Metasploit,可以使用以下命令: sudo git pull 8. 如果需要卸载Metasploit,可以使用以下命令: sudo rm -rf /opt/metasploit-framework 以上就是在Ubuntu安装Metasploit的步骤。 ### 回答2: Metasploit是一款知名的漏洞测试平台,常用于渗透测试等相关领域。在Ubuntu安装Metasploit可以是您的网络安全测试工作更加高效、有力。在本文中,我们将介绍如何在Ubuntu系统上安装Metasploit。 步骤1:先更新系统 在安装Metasploit之前,您应该先更新您的Ubuntu系统。打开终端窗口,运行以下命令更新系统: sudo apt update && sudo apt upgrade 步骤2:安装依赖库 换言之许多软件都需要一些列其他的核心库和工具的支撑才能运行,Metasploit也不例外。打开终端窗口,运行以下命令安装所需的依赖库: sudo apt install curl git gnupg-agent apt-transport-https dirmngr 步骤3:获取Metasploit软件的密钥 Metasploit需要通过密钥管理系统来访问,因此我们需要获取Metasploit的密钥。打开终端窗口,运行以下命令取得Metasploit密钥: curl -fsSL https://apt.metasploit.com/metasploit-framework.gpg.key | sudo apt-key add - 步骤4:加入Metasploit软件源 密钥获取完毕后,我们要将Metasploit加入Ubuntu的软件源。打开终端窗口,运行以下命令添加Metasploit软件源: echo "deb [arch=amd64] https://apt.metasploit.com/ xenial main" | sudo tee /etc/apt/sources.list.d/metasploit-framework.list 步骤5:安装Metasploit 最后一步,我们需要运行以下命令来安装Metasploit: sudo apt update && sudo apt install metasploit-framework 安装完毕后,你可以在终端窗口中输入msfconsole命令即可启动Metasploit。 您可能会遇到一些问题,例如安装时错误或依赖关系问题等。您可以通过充分了解错误和问题的原因来解决这些问题。有关Metasploit的详细信息,参阅Metasploit文档。 ### 回答3: Metasploit是一款流行的网络渗透测试工具,它可以帮助网络管理员测试网络系统的安全性。在Ubuntu系统上安装Metasploit相对容易,只需要按照以下步骤操作即可: 1.打开Ubuntu终端,通过命令“sudo su”获取root权限。 2.更新Ubuntu系统的软件包列表,使用命令“apt-get update”进行包更新,以确保系统能够获取Metasploit相关的软件包。 3.安装依赖软件包,使用命令“apt-get install git-core build-essential libreadline-dev libssl-dev libpq5 libpq-dev libreadline5 libsqlite3-dev libpcap-dev openjdk-8-jre subversion”进行相关软件包的安装。 4.前往Metasploit的官方网站http://www.metasploit.com下载最新版本的Metasploit框架,选择“Download Now”按钮进行下载。 5.下载完成后进入下载目录,使用命令“tar xvzf metasploit-latest.tar.gz”进行解压。 6.安装Ruby,使用命令“apt-get install ruby-full”,如果Ruby已经安装则可以跳过这一步。 7.进入Metasploit框架的解压目录,运行命令“cd metasploit-framework”进入目录。 8.运行命令“bundle install”进行安装,等待安装完成即可使用Metasploit了。 总结起来,在安装Metasploit时需要依赖安装一些软件包,其中主要安装Ruby、Git以及Java SDK。Metasploit安装过程需要一定的耐心和时间,需要确保在安装的过程中不出错,最后才能保证能够正常地使用Metasploit框架进行网络渗透测试。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值