如何在Ubuntu 18.04/Debian 9上安装Metasploit框架

时间:2020-02-23 14:32:47  来源:igfitidea点击:

在本文中,我们将讨论如何在Ubuntu 18.04/debian 9上安装Metasploit框架。
Metasploit框架是一个开源项目,提供了用于执行广泛的安全审计和穿透测试的基础架构,内容和工具。

Metasploit的商业版本可供更喜欢使用Web界面以最优先的用户使用。
Metasploit框架运行以下Services.PostGRESQL数据库服务器 - Metasploit使用以将数据存储在Project.Ruby上railsmetasploit服务

Metasploit框架要求

以下是在Ubuntu 18.04/Debian 9上运行Metasploit框架的最低硬件要求。

2 GHz + Processor4 GB RAM可用(推荐8 GB)1 GB可用磁盘空间(推荐50 GB)Ubuntu 18.04/Debian 9的64位版本

在Ubuntu 18.04/Debian 9上安装Metasploit框架

在Ubuntu 18.04/debian 9上安装Metasploit框架的最简单方法来自Metasploit安装程序。
此安装程序附带运行Metasploit框架所需的所有依赖项和工具。

通过在终端中运行下面的命令下载Metasploit安装程序。

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

下载脚本后,使其可执行

chmod 755 msfinstall

然后执行:

# ./msfinstall
 Adding metasploit-framework to your repository list..OK
 Updating package cache..OK
 Checking for and installing update..
 Reading package lists… Done
 Building dependency tree       
 Reading state information… Done
 The following NEW packages will be installed:
   metasploit-framework
 0 upgraded, 1 newly installed, 0 to remove and 122 not upgraded.
 Need to get 169 MB of archives.
 After this operation, 397 MB of additional disk space will be used.
 Get:1 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid/main amd64 metasploit-framework amd64 4.17.35+20190105104028~1rapid7-1 [169 MB]
 Fetched 169 MB in 4s (42.3 MB/s)               
 debconf: delaying package configuration, since apt-utils is not installed
 Selecting previously unselected package metasploit-framework.
 (Reading database … 34892 files and directories currently installed.)
 Preparing to unpack …/metasploit-framework_4.17.35+20190105104028~1rapid7-1_amd64.deb …
 Unpacking metasploit-framework (4.17.35+20190105104028~1rapid7-1) …
 Setting up metasploit-framework (4.17.35+20190105104028~1rapid7-1) …
 update-alternatives: using /opt/metasploit-framework/bin/msfbinscan to provide /usr/bin/msfbinscan (msfbinscan) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/msfconsole to provide /usr/bin/msfconsole (msfconsole) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/msfd to provide /usr/bin/msfd (msfd) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/msfdb to provide /usr/bin/msfdb (msfdb) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/msfelfscan to provide /usr/bin/msfelfscan (msfelfscan) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/msfmachscan to provide /usr/bin/msfmachscan (msfmachscan) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/msfpescan to provide /usr/bin/msfpescan (msfpescan) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/msfrop to provide /usr/bin/msfrop (msfrop) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/msfrpc to provide /usr/bin/msfrpc (msfrpc) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/msfrpcd to provide /usr/bin/msfrpcd (msfrpcd) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/msfupdate to provide /usr/bin/msfupdate (msfupdate) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/msfvenom to provide /usr/bin/msfvenom (msfvenom) in auto mode
 update-alternatives: using /opt/metasploit-framework/bin/metasploit-aggregator to provide /usr/bin/metasploit-aggregator (metasploit-aggregator) in auto mode
 Run msfconsole to get started

创建和初始化MSF数据库。

$msfdb init
 Creating database at /home/jmutai/.msf4/db
 Starting database at /home/jmutai/.msf4/db…success
 Creating database users
 Creating initial database schema

启动MSFconsole.

现在数据库是初始化的,我们可以启动MSFconsole

$msfconsole

示例输出

验证数据库连接 db_status命令如下所示。

msf > db_status
 [*] postgresql connected to msf
 msf >

更新Metasploit框架

要在Ubuntu 18.04/debian上更新Metasploit框架9.运行命令:

# msfupdate
 Updating package cache..OK
 Checking for and installing update..
 Reading package lists… Done
 Building dependency tree       
 Reading state information… Done
 metasploit-framework is already the newest version (4.17.35+20190105104028~1rapid7-1).
 0 upgraded, 0 newly installed, 0 to remove and 123 not upgraded.

我们可以使用以下方式查看框架版本:

# msfconsole  --version
 Framework Version: 4.17.35-dev