您的位置:首页 > 编程语言 > ASP

Ubuntu 18.04安装Metasploit Framework指南

2019-01-15 12:06 891 查看

本指南介绍了在Ubuntun Linux 18.04 LTS上安装Metasploit Framework OSS项目我建议您首先尝试使用以下安装脚本,因为它将比指南中包含的内容更多,如果您执行此操作 不希望运行开源版本或设置开发环境,并且不介意将您的电子邮件地址提供给Rapid 7用于营销。

使用安装脚本安装

从GitHub下载脚本并使其可执行。 使用-h选项进行测试以确保其正常工作

Ubuntu 18.04安装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密码,接着你要做的是就是等待安装完成。

安装完成

接着输入msfconsole

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

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

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

linuxidc@linuxidc:~/www.linuxidc.com$ sudo service postgresql status
[sudo] linuxidc 的密码:
● postgresql.service - PostgreSQL RDBMS
  Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor prese
  Active: active (exited) since Tue 2019-01-15 12:06:36 CST; 16s ago
 Main PID: 4955 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 3427)
  CGroup: /system.slice/postgresql.service

1月 15 12:06:36 linuxidc systemd[1]: Starting PostgreSQL RDBMS...
1月 15 12:06:36 linuxidc systemd[1]: Started PostgreSQL RDBMS.
lines 1-9/9 (END)

接着进入metasploit中,输入

msf5 > msfdb init
[*] exec: msfdb init

Found a database at /home/linuxidc/.msf4/db, checking to see if it is started
Database already started at /home/linuxidc/.msf4/db
Found web service config at /home/linuxidc/.msf4/msf-ws-config.ru, checking to see if it is started
MSF web service is already running as PID 4092

之后输入

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

等几分钟之后执行

search ms10

看看是不是还有

[!] Module database cache not built yet, using slow search

这个警告

如果还有那么再等一段时间再次执行,如果十分钟以后还是出现这个警告,那么可能你的步骤错了

版本查看:

linuxidc@linuxidc:~/www.linuxidc.com$ msfconsole -v
Found a database at /home/linuxidc/.msf4/db, checking to see if it is started
Starting database at /home/linuxidc/.msf4/db...success
Found web service config at /home/linuxidc/.msf4/msf-ws-config.ru, checking to see if it is started
MSF web service is already running as PID 4092
Framework Version: 5.0.1-dev-

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息