metasploit不能使用默认的msf3进行连接

xin*_*a1i 2 postgresql metasploit ubuntu-14.04

我在/ 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
Run Code Online (Sandbox Code Playgroud)

所以我这样做:

service postgresql restart
service metasploit restart
Run Code Online (Sandbox Code Playgroud)

那些成功执行.我运行"msfconsole",然后得到"msf>",我运行这个:

msf> db_connect msf3:testtest@127.0.0.1/msf3
msf> db_stats
[*] postgresql selected, no connection
Run Code Online (Sandbox Code Playgroud)

我不知道会发生什么,所以我再次运行msfconsole,我得到了这个:

[-] Failed to connect to the database: FATAL:  password authentication failed for user "msf3"
Run Code Online (Sandbox Code Playgroud)

我可以使用postgres创建新用户和数据库,然后使用db_connect进行连接.但每次,我都必须再次运行db_connect.所以我认为metasploit默认使用msf3作为用户和数据库.我想连接到msf3.我该怎么办?

小智 12

在Kali Rolling 2016上有相同的错误.2打开终端并输入:

msfdb delete
msfdb init
msfconsole
Run Code Online (Sandbox Code Playgroud)

简而言之,您需要通过msf重新创建db msf使用.