使用 metasploit 時,
1. 啓動 postgresql
service postgresql start
2. 自行測試 postgresql 是否安裝成功
根據需要,自行 修改 postgres 默認密碼,是否允許遠程登錄
3. 初始化MSF數據庫(關鍵步驟!)
msfdb init
4. 啓動 msfconsole
msfconsole
5. 檢測 db 連接狀態
db_status
6. 如果連接異常會顯示
msf > db_status
[*] postgresql selected, no connection
7. 手動連接數據庫
msf > db_connect msf:[email protected]/msf
8. 如果不想每次都手動連接,可以修改配置文件,設置數據庫密碼
vi /usr/share/metasploit-framework/config/database.yml
將 password 修改爲 你的密碼