啟動 metasploit 后葱她,發(fā)現(xiàn)沒有自動連接 postgresql 數(shù)據(jù)庫
連接的命令為
db_connect 用戶名:密碼@ip/數(shù)據(jù)庫名
連接默認數(shù)據(jù)庫的命令為
db_connect msf3:toor@127.0.0.1/msf3
如果還是無法連接凤覆,則嘗試以下步驟
- 使用
service postgresql status
查看并確保 postgresql 服務已經(jīng)啟動惹挟,然后使用su postgres
命令切換到 postgre 賬戶
使用
createuser msf3 –P
命令創(chuàng)建一個 postgresql 數(shù)據(jù)庫賬戶
命令中的msf3是要創(chuàng)建的用戶名蒲凶,-P 表示立即給角色指定一個口令
接下來根據(jù)提示輸入兩次气筋,此次使用toor
作為密碼使用
createdb --owner=msf3 msf3
創(chuàng)建數(shù)據(jù)庫
owner參數(shù)表示數(shù)據(jù)庫的所有者,此次指定給剛剛創(chuàng)建的msf3旋圆,最后一個“msf3”表示數(shù)據(jù)庫的名稱使用
exit
命令退出當前用戶宠默,回到 root 用戶手動連接的步驟
再次嘗試db_connect msf3:msf@localhost/msf3