Bundler 找不到 gem "sysrandom" 的兼容版本

Bundler could not find compatible versions for gem "sysrandom"

安装后 PentestBox for installing penetration testing tools on windows 10 It was working great but some of the tools was outdated like metasploit, so I tried updating all using PentestBox Update Manager,但完成更新后 msfconsole 一直给我这个错误

Bundler could not find compatible versions for gem "sysrandom":
  In Gemfile:
    metasploit-framework x86-mingw32 was resolved to 5.0.0, which depends on sysrandom x86-mingw32

  Could not find gem 'sysrandom', which is required by gem 'metasploit-framework', in any of the sources.

而且我在一般情况下确实吸收了 ruby 语言,所以我该怎么办?

您链接到的 metasploit 版本似乎已经几年没有更新了。它没有将 sysrandom 列为 Gemfile 中的依赖项。

有一个 newer version 确实有 sysrandom 作为依赖项,这里是:

https://github.com/rapid7/metasploit-framework/blob/master/metasploit-framework.gemspec#L106

我不确定为什么 pentestbox 使用这么旧的版本,但我假设 "update" 实际上更新到 rapid7 版本的 metasploit(因为它正在寻找只存在于那里的 sysrandom)。

您可以尝试以下几种方法:

  • bundle install 应该安装所有依赖项(不使用为 pentestbox 构建的控制台工具)
  • 正在删除 Gemfile.lock 和 运行 bundle install。我通常不推荐这样做,但如果某处似乎存在版本不匹配,有时这会解决依赖项错误。您应该能够再次重新检出该文件(假设它在本地版本化)

如果您可以 post 您下载的 metasploit 版本的 git 提交哈希,这可能有助于提供额外的解决建议。