我正在尝试运行msfdb,但似乎无法运行,因为我得到了一个LoadError和两个ThreadErrors。这是完整的堆栈:
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require': cannot load such file -- net/smtp (LoadError)
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
from /usr/share/metasploit-framework/lib/rex/proto/sms/model.rb:29:in `<top (required)>'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `const_get'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `cget'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:237:in `block (2 levels) in eager_load'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:26:in `block in ls'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `each_child'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `ls'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:232:in `block in eager_load'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `synchronize'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `eager_load'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `each'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `eager_load_all'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/application/finisher.rb:133:in `block in <module:Finisher>'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:32:in `instance_exec'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:32:in `run'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:61:in `block in run_initializers'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `each'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `call'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:60:in `run_initializers'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/application.rb:391:in `initialize!'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/railtie.rb:207:in `public_send'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/railtie.rb:207:in `method_missing'
from /usr/share/metasploit-framework/config/environment.rb:4:in `<top (required)>'
from /usr/share/metasploit-framework/lib/msfenv.rb:17:in `require'
from /usr/share/metasploit-framework/lib/msfenv.rb:17:in `<top (required)>'
from /usr/bin/msfconsole:18:in `require'
from /usr/bin/msfconsole:18:in `<main>'
/usr/bin/msfconsole: warning: Exception in finalizer #<Proc:0x00007f4a9fb4fc80 /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:85>
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `new': can't alloc thread (ThreadError)
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `create_with_logging_context'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:436:in `new'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:86:in `block in threadlocal_finalizer'
/usr/bin/msfconsole: warning: Exception in finalizer #<Proc:0x00007f4a9fb4fde8 /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:85>
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `new': can't alloc thread (ThreadError)
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `create_with_logging_context'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:436:in `new'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:86:in `block in threadlocal_finalizer'
旁注:据我所知,抛出的2个ThreadErrors是因为我内存不足吗?不过,我总共有16GB,这应该足够了。
在此之前,由于一些奇怪的原因,我无法安装某些依赖项,但我安装了Oracle Instant Client,它允许我安装ruby-oci8
,然后让我继续安装其余的依赖项。为此,我重新运行了bundle install
,并修复了大部分问题(我不得不用gem install <gem>
手动安装某些gem,但重新运行bundle install
以确保最后我拥有一切(。现在我得到了这些奇怪的LoadErrors和ThreadErrors。需要注意的一点是,我以root用户的身份执行msfdb run
和msfconsole
(这对msfdb run
来说是必要的,因为它不允许我以普通用户的身份运行它(,但当我以普通使用者的身份运行msfconsole时,metasploit会按预期加载,不会出现任何错误。有人能帮我修一下吗?
从Ruby 3.1开始,net-smtp
是一个绑定的gem。
也许,你只需要添加
gem 'net-smtp'
到您的Gemfile
。