我在 /opt/metasploit 的 ubuntu 14.04(LTS) 中安装了 metasploit v4。我也安装了 postgresql。我对 metasploit 和 postgresql 很陌生。我启动了metasploit,但是无法连接数据库,所以我更改了这个文件/opt/metasploit/apps/pro/ui/config/database.yml,我只是将密码更改为“testtest”,文件内容是:
development:
adapter: "postgresql"
database: "msf3"
username: "msf3"
password: "testtest"
port: 7337
host: "localhost"
pool: 256
timeout: 5
production:
adapter: "postgresql"
database: "msf3"
username: "msf3"
password: "testtest"
port: 7337
host: "localhost"
pool: 256
timeout: 5
所以我这样做:
service postgresql restart
service metasploit restart
并且那些成功执行。我运行“msfconsole”,然后得到“msf>”,我运行这个:
msf> db_connect msf3:testtest@127.0.0.1/msf3
msf> db_stats
[*] postgresql selected, no connection
我不知道会发生什么,所以我再次运行 msfconsole,我得到了这个:
[-] Failed to connect to the database: FATAL: password authentication failed for user "msf3"
我可以使用 postgres 创建新用户和数据库,然后使用 db_connect 进行连接。但每次,我都必须再次运行 db_connect。所以我认为 metasploit 默认使用 msf3 作为用户和数据库。我想连接到 msf3。我应该怎么办?