centos搭建msf

搭建msf

官方有提供一键安装脚本,如下:

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

等安装成功直接输入msfconsole就可以运行。

卸载Postgresql数据库

这里是最关键的地方,需要把centos自带的Postgresql数据库给卸载掉,重新安装一个最新的:

1
2
3
4
5
卸载旧版Postgresql数据库
 
yum remove postgresql* ##卸载
 
rpm -qa | grep postgresql ##查看是否卸载完成

安装新版Postgresql数据库

复制代码
1)yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm    ##安装rpm文件
2)yum install postgresql10        ##安装客户端(一路默认y安装就行)

(3)yum install postgresql10-server      ##安装服务端(一路默认y安装就行)

(4)/usr/pgsql-10/bin/postgresql-10-setup initdb      ##初始化

(5)设置自动启动并且启动postgresql服务

systemctl enable postgresql-10

systemctl start postgresql-10

到这里postgresql数据库终于安装完了!!!
复制代码

下面是重点,我们安装好了数据库之后,如何将MSF连接到数据库:

cd /opt/metasploit-framework/bin/
---------不能以root用户初始化数据库
useradd msf
su msf
./msfdb init #初始化数据库
-----------一路安装即可

创建完成后在msf用户目录会生成一个.msf目录里面会有一个database.yml文件

然后,我们这时从msf账户切换到root用户:

##该操作将原配置文件覆盖。

cp /home/msf/.msf4/database.yml /opt/metasploit-framework/embedded/framework/config/

完成以上动作之后,我们再启动msf,测试数据库连接正常,这个时候就可以使用MSF了。

 

posted @   田家少闲月-  阅读(199)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· [翻译] 为什么 Tracebit 用 C# 开发
· Deepseek官网太卡,教你白嫖阿里云的Deepseek-R1满血版
· 2分钟学会 DeepSeek API,竟然比官方更好用!
· .NET 使用 DeepSeek R1 开发智能 AI 客户端
· 刚刚!百度搜索“换脑”引爆AI圈,正式接入DeepSeek R1满血版
点击右上角即可分享
微信分享提示