配置msf連接postgresql數據庫


  BackTrack 5 R3版本的Metasploit在每次的升級后總會出現奇奇怪怪的錯誤,主要是Ruby的庫出錯,網上找了一些解決的辦法,但每次更新后又會出錯,蛋碎。

  解決方法:

  BackTrack 5中默認自動開啟端口7337。

1、查看PostgreSQL端口是否開啟:

root@bt:~# netstat -tnpl |grep postgres

 

如果沒有開啟輸入service postgresql start開啟:

root@bt:~# service postgresql start

 2、查看msf的配置,里面有數據庫用戶和密碼

root@bt:~# cat /opt/metasploit/config/database.yml

#
# These settings are for the database used by the Metasploit Framework
# unstable tree included in this installer, not the commercial editions.
#
development:
adapter: "postgresql"
database: "msf3dev"
username: "msf3"
password: "4bfedfc2"
port: 7337
host: "localhost"
pool: 256
timeout: 5

production:
adapter: "postgresql"
database: "msf3dev"
username: "msf3"
password: "4bfedfc2"
port: 7337
host: "localhost"
pool: 256
timeout: 5

 

3、開啟msf專業版
 

# /opt/metasploit/msfpro

 

4、查看連接狀態:

db_status

5、連接數據庫:

db_connect用戶名:口令@服務器地址:端口/數據庫名稱
db_connect msf3:4bfedfc2@127.0.0.1:7337/msf3

 

6、使用hosts命令檢查數據庫是否可以正常使用。

msf > hosts

 

 

7、使用db_disconnect命令可以斷開與數據庫的鏈接:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM