Metasploit 无法启动

Metasploit 无法启动

我最近下载了 Metasploit,并尝试通过输入 msfconsole 来运行它,但得到了以下信息:

** Welcome to Metasploit Framework Initial Setup **
    Please answer a few questions to get started.


Would you like to use and setup a new database (recommended)? (I put Yes)
/opt/metasploit-framework/embedded/framework/msfdb:176:in `initialize': Permission denied @ rb_sysopen - /home/jackattack/.msf4/database.yml (Errno::EACCES)
    from /opt/metasploit-framework/embedded/framework/msfdb:176:in `open'
    from /opt/metasploit-framework/embedded/framework/msfdb:176:in `init_db'
    from /opt/metasploit-framework/embedded/framework/msfdb:277:in `<main>'

 ** Metasploit Framework Initial Setup Complete **

touch: cannot touch '/home/jackattack/.msf4/initial_setup_complete': Permission denied
Rails Error: Unable to access log file. Please ensure that /home/jackattack/.msf4/logs/production.log exists and is writable (ie, make it writable for user and group: chmod 0664 /home/jackattack/.msf4/logs/production.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
/opt/metasploit-framework/embedded/framework/lib/rex/logging/sinks/flatfile.rb:21:in `initialize': Permission denied @ rb_sysopen - /home/jackattack/.msf4/logs/framework.log (Errno::EACCES)
    from /opt/metasploit-framework/embedded/framework/lib/rex/logging/sinks/flatfile.rb:21:in `new'
    from /opt/metasploit-framework/embedded/framework/lib/rex/logging/sinks/flatfile.rb:21:in `initialize'
    from /opt/metasploit-framework/embedded/framework/lib/msf/base/logging.rb:24:in `new'
    from /opt/metasploit-framework/embedded/framework/lib/msf/base/logging.rb:24:in `init'
    from /opt/metasploit-framework/embedded/framework/lib/msf/base/simple/framework.rb:111:in `simplify'
    from /opt/metasploit-framework/embedded/framework/lib/msf/base/simple/framework.rb:73:in `create'
    from /opt/metasploit-framework/embedded/framework/lib/msf/ui/console/driver.rb:74:in `initialize'
    from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:62:in `new'
    from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:62:in `driver'
    from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:48:in `start'
    from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/base.rb:82:in `start'
    from /opt/metasploit-framework/bin/../embedded/framework/msfconsole:48:in `<main>'

答案1

权限被拒绝@rb_sysopen-/home/jackattack/.msf4/database.yml(Errno::EACCES)

这个问题可能是您的.msf4/database.yml文件属于另一个用户(可能是 root,您之前以 root 身份运行过 metasploit 吗?)

您可以使用 检查所有权ls -l ~/.msf4

如果您想更改它,请运行chown -R $(whoami) ~/.msf4(假设您已以身份登录jackattack

答案2

请检查您是否可以启动 posgres。您可能需要创建 posgres 用户帐户并检查一些文件权限。

相关内容