搭建msf 官方有提供一鍵安裝腳本,如下: curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate ...
搭建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資料庫給卸載掉,重新安裝一個最新的:
卸載舊版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了。
本文來自博客園,作者:田家少閑月-,轉載請註明原文鏈接:https://www.cnblogs.com/zhaoyunxiang/p/17744099.html