Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: add faraday dependency. #12519

Closed
wants to merge 1 commit into from

Conversation

@lockcda
Copy link

lockcda commented Oct 31, 2019

If the faraday dependency is not added, then the metasploit won't start and will show the following error:

/usr/lib64/ruby/gems/2.4.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require': cannot load such file -- faraday (LoadError)
        from /usr/lib64/ruby/gems/2.4.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        (... long stack trace ...)
        from /usr/lib/metasploit9999/lib/metasploit/framework/command/base.rb:82:in `start'
        from /usr/lib/metasploit/msfconsole:49:in `<main>'
If the faraday dependency is not added, then the metasploit won't start and will show the following error:

/usr/lib64/ruby/gems/2.4.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require': cannot load such file -- faraday (LoadError)
        from /usr/lib64/ruby/gems/2.4.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        (... long stack trace ...)
        from /usr/lib/metasploit9999/lib/metasploit/framework/command/base.rb:82:in `start'
        from /usr/lib/metasploit/msfconsole:49:in `<main>'
@jmartin-r7

This comment has been minimized.

Copy link
Contributor

jmartin-r7 commented Oct 31, 2019

This does not look to be needed. I suspect since the path referenced is /usr/lib64/gems/ for the system ruby that some other gem installed in your env is getting added during startup.

As noted in the dev setup wiki an environment manager for ruby and gemsets is recommended for using metasploit-framework.




                          ooo
                         $ o$
                        o $$
              ""$$$    o" $$ oo "
          " o$"$oo$$$"o$$o$$"$$$$$ o
         $" "o$$$$$$o$$$$$$$$$$$$$$o     o
      o$"    "$$$$$$$$$$$$$$$$$$$$$$o" "oo  o
     " "     o  "$$$o   o$$$$$$$$$$$oo$$
    " $     " "o$$$$$ $$$$$$$$$$$"$$$$$$$o
  o  $       o o$$$$$"$$$$$$$$$$$o$$"""$$$$o " "
 o          o$$$$$"    "$$$$$$$$$$ "" oo $$   o $
 $  $       $$$$$  $$$oo "$$$$$$$$o o $$$o$$oo o o
o        o $$$$$oo$$$$$$o$$$$ ""$$oo$$$$$$$$"  " "o
"   o    $ ""$$$$$$$$$$$$$$  o  "$$$$$$$$$$$$   o "
"   $      "$$$$$$$$$$$$$$   "   $$$"$$$$$$$$o  o
$   o      o$"""""$$$$$$$$    oooo$$ $$$$$$$$"  "
$      o""o $$o    $$$$$$$$$$$$$$$$$ ""  o$$$   $ o
 o     " "o "$$$$  $$$$$""""""""""" $  o$$$$$"" o o
 "  " o  o$o" $$$$o   ""           o  o$$$$$"   o
  $         o$$$$$$$oo            "oo$$$$$$$"    o
  "$   o o$o $o o$$$$$"$$$$oooo$$$$$$$$$$$$$$"o$o
    "o oo  $o$"oo$$$$$o$$$$$$$$$$$$"$$$$$$$$"o$"
     "$ooo $$o$   $$$$$$$$$$$$$$$$ $$$$$$$$o"
        "" $$$$$$$$$$$$$$$$$$$$$$" """"
                         """"""



       =[ metasploit v5.0.58-dev-641ecb6                  ]
+ -- --=[ 1936 exploits - 1081 auxiliary - 333 post       ]
+ -- --=[ 556 payloads - 45 encoders - 10 nops            ]
+ -- --=[ 7 evasion                                       ]

msf5 >
@jmartin-r7 jmartin-r7 closed this Oct 31, 2019
@lockcda

This comment has been minimized.

Copy link
Author

lockcda commented Oct 31, 2019

On Gentoo you can manage the active version of Ruby and Rubygems with eselect. That's my actual configuration:

# eselect ruby list
Available Ruby profiles:
  [1]   ruby24 (with Rubygems) *
  [2]   ruby25 (with Rubygems)

And all the trace shows source files that are under /usr/lib64/ruby/gems/2.4.0/. I don't think that it's an env conflict, but I'll check the link you provided and let you know.

@lockcda

This comment has been minimized.

Copy link
Author

lockcda commented Oct 31, 2019

Well, I updated the gems with the bundle command and the result is exactly the same. And, in fact, I manually checked the ebuild and Gentoo already runs the bundle on each metasploit upgrade. It don't seems to be a gems conflict. So I would like to reopen the pull request.

@jmartin-r7

This comment has been minimized.

Copy link
Contributor

jmartin-r7 commented Oct 31, 2019

This is still related to your env and gemset. There is already a transient dependency on faraday in metasploit meaning something in the resolution on your env is still creating the issue.

See:
https://github.com/rapid7/metasploit-framework/blob/master/Gemfile.lock#L355-L357
https://github.com/rapid7/metasploit-framework/blob/master/Gemfile.lock#L172

What versions of ruby, rubygems and bundler are you on?

Note framework is no longer tested on ruby 2.4 and is not guaranteed support at this time.

@jmartin-r7

This comment has been minimized.

Copy link
Contributor

jmartin-r7 commented Oct 31, 2019

If you can post the full stack trace I may be able to reproduce the env issue now on a Gentoo VM.

@lockcda

This comment has been minimized.

Copy link
Author

lockcda commented Oct 31, 2019

I use Ruby 2.4.9p362, Rubygems 2.7.9 and bundler 1.16.1.

That's the full stack trace:

/home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require': cannot load such file -- faraday (LoadError)
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib64/ruby/gems/2.4.0/gems/sawyer-0.8.2/lib/sawyer/agent.rb:1:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib64/ruby/gems/2.4.0/gems/sawyer-0.8.2/lib/sawyer.rb:17:in `block in <top (required)>'
        from /usr/lib64/ruby/gems/2.4.0/gems/sawyer-0.8.2/lib/sawyer.rb:17:in `each'
        from /usr/lib64/ruby/gems/2.4.0/gems/sawyer-0.8.2/lib/sawyer.rb:17:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib64/ruby/gems/2.4.0/gems/octokit-4.14.0/lib/octokit/connection.rb:1:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib64/ruby/gems/2.4.0/gems/octokit-4.14.0/lib/octokit/client.rb:1:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib64/ruby/gems/2.4.0/gems/octokit-4.14.0/lib/octokit.rb:1:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib/metasploit9999/lib/msf/util/document_generator/pull_request_finder.rb:1:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib/metasploit9999/lib/msf/util/document_generator.rb:7:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib/metasploit9999/lib/msf/ui/console/command_dispatcher/core.rb:23:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib/metasploit9999/lib/msf/ui/console/command_dispatcher.rb:138:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib/metasploit9999/lib/msf/ui/console/driver.rb:6:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib/metasploit9999/lib/msf/ui/console.rb:11:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib/metasploit9999/lib/msf/ui.rb:11:in `<top (required)>'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require'
        from /home/dani/.gem/ruby/2.4.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /usr/lib64/ruby/gems/2.4.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        from /usr/lib/metasploit9999/lib/metasploit/framework/command/console.rb:60:in `driver'
        from /usr/lib/metasploit9999/lib/metasploit/framework/command/console.rb:48:in `start'
        from /usr/lib/metasploit9999/lib/metasploit/framework/command/base.rb:82:in `start'
        from /usr/lib/metasploit9999/msfconsole:49:in `<main>'

Thank you very much for your time.

@lockcda

This comment has been minimized.

Copy link
Author

lockcda commented Oct 31, 2019

Since you mentioned that ruby24 is no longer tested, I tried to run metasploit with ruby25 and the result was the same. Also, the metasploit ebuild on gentoo still has its RUBY_TARGETS on ruby24. The ruby25 is not even an option.

[I] net-analyzer/metasploit
     Available versions:  
     (4.17) (~)4.17.21-r6^s
     (9999) (**)9999*l^s
       {development +java nexpose oracle +pcap test RUBY_TARGETS="ruby24"}
     Installed versions:  9999(9999)*l^s(15:57:53 31/10/19)(java oracle pcap -development -nexpose -test RUBY_TARGETS="ruby24")
     Homepage:            http://www.metasploit.org/
     Description:         Advanced framework for developing, testing, and using vulnerability exploit code

In fact, when I run metasploit with ruby25 (after selecting ruby25 with eselect) the trace still shows the path /usr/lib64/ruby/gems/2.4.0/, so it seems that it's using 2.4 sources also with ruby25.

@lockcda

This comment has been minimized.

Copy link
Author

lockcda commented Oct 31, 2019

In order to make more tests, I created my own ebuilds for the following packages and added ruby25 to RUBY_TARGETS.

[ebuild   R   ~] dev-ruby/metasploit-payloads-1.3.78:1.3.78::dani-ebuilds  USE="-test" RUBY_TARGETS="ruby24 ruby25%*" 0 KiB
[ebuild   R   ~] dev-ruby/metasploit_payloads-mettle-0.5.7:0.5.7::dani-ebuilds  USE="-test" RUBY_TARGETS="ruby24 ruby25%*" 0 KiB
[ebuild   R   ~] dev-ruby/metasploit-concern-2.0.5:2.0::dani-ebuilds  USE="-doc -test" RUBY_TARGETS="ruby24 ruby25%*" 0 KiB
[ebuild   R   ~] dev-ruby/metasploit-model-2.0.4:2.0::dani-ebuilds [2.0.4:2.0::gentoo] USE="-doc -test" RUBY_TARGETS="ruby24 ruby25%*" 0 KiB
[ebuild   R   ~] dev-ruby/postgres_ext-3.0.1:3::dani-ebuilds [3.0.1:3::gentoo] USE="-doc -test" RUBY_TARGETS="ruby24 ruby25%* (-ruby23%)" 0 KiB
[ebuild   R   ~] dev-ruby/metasploit_data_models-2.0.16:2.0.16::dani-ebuilds [2.0.16:2.0.16::gentoo] USE="-doc -test" RUBY_TARGETS="ruby24 ruby25%*" 0 KiB
[ebuild   R   ~] dev-ruby/metasploit-credential-2.0.14:2.0.14::dani-ebuilds [2.0.14:2.0.14::gentoo] USE="-doc -test" RUBY_TARGETS="ruby24 ruby25%*" 0 KiB
[ebuild   R   *] net-analyzer/metasploit-9999:9999::dani-ebuilds [9999:9999::gentoo] USE="java oracle pcap (-development) -nexpose (-test)" RUBY_TARGETS="ruby24 ruby25%*" 0 KiB

It starts fine, but it breaks on dev-ruby/metasploit-model-2.0.4 since it's expecting activemodel (~> 4.2.6), but on ruby25 I have activemodel-5.2.3 installed. It makes me think that the problems might be in the metasploit-model package.

That's the shown error:

 * Running prepare phase for ruby25 ...
fatal: not a git repository (or any of the parent directories): .git
Resolving dependencies...
Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:                                                                                                                                                                                                                                                                 
    metasploit-model was resolved to 2.0.4, which depends on                                                                                                                                                                                                                  
      activemodel (~> 4.2.6)                                                                                                                                                                                                                                                  

Could not find gem 'activemodel (~> 4.2.6)', which is required by gem 'metasploit-model', in any of the sources.

I'll let you know if I can link the metasploit-model with activemodel-5.2.3.

@jmartin-r7

This comment has been minimized.

Copy link
Contributor

jmartin-r7 commented Oct 31, 2019

Unfortunately Gentoo is a special beast. Like Kali and other pentesting focused distros the community packaging for Gentoo is not maintained by the metasploit-framework project as the OS has guidelines that do not align with how framework builds and distributes packages. This does not mean it will not work, only that in many cases this repo is not the location for env based issues.

From gentoo docs:

Warning
On maintainer's words: Very delicate package

Doing some exploratory testing now, I am finding the install process in Gentoo using emerge seems to be well behind the current state of the project. Code is currently tested on ruby 2.5 and 2.6.

One would suggestion would be removing the emerge package and installing a user level ruby env manager like rvm or rbenv that provide user and app specific ruby sandboxes. Note the validation test I used to check 2.4 would load on a supported OS used an ubuntu docker container. This does mean you will have to install equivalent dependency packages to what are noted here to be able to consume a git based checkout of the repository.

The following got a loaded console on this vagrant box.

cd ~/
sudo echo 'CONFIG_PROTECT="-*"' >> /etc/portage/make.conf
sudo emerge --sync
sudo emerge --oneshot portage
sudo emerge --ask dev-db/postgresql
sudo emerge --ask dev-vcs/git
sudo emerge --ask net-libs/libpcap
command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
command curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
\curl -sSL https://get.rvm.io | bash -s stable
source /home/vagrant/.rvm/scripts/rvm
rvm install 2.6.5
git clone https://github.com/rapid7/metasploit-framework
cd metasploit-framework
bundle install

Also consider joining #slack or IRC found @ https://metasploit.com/ my handle there is Op3n4M3. Many community members monitor both and can provide recommendations around env and config issues.

@jmartin-r7

This comment has been minimized.

Copy link
Contributor

jmartin-r7 commented Oct 31, 2019

Looking at your notes on setting up emerge, the recipe is setting dependencies for ruby that does not match how ruby expects to set dependencies. For this projects all gems are controlled with rubygems and bundler and our dependencies update weekly with Gemfile.lock.

Framework is currently locked to RAILS 4.x compatibility, while there is work ongoing that allows upgrade to RAILS 5.x packages there are many locks in the tree that keep the project on 4.x for now.

@lockcda

This comment has been minimized.

Copy link
Author

lockcda commented Oct 31, 2019

After a manual install of the following gems:

gem install metasploit-model
gem install postgres_ext
gem install metasploit_payloads-mettle

I was able the compile metasploit with ruby25 with my custom ebuilds. But the result was the same:

Traceback (most recent call last):ork console...-
        82: from /usr/lib/metasploit/msfconsole:49:in `<main>'
        81: from /usr/lib/metasploit9999/lib/metasploit/framework/command/base.rb:82:in `start'
        80: from /usr/lib/metasploit9999/lib/metasploit/framework/command/console.rb:48:in `start'
        79: from /usr/lib/metasploit9999/lib/metasploit/framework/command/console.rb:60:in `driver'
        78: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        77: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        76: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        75: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        74: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
        73: from /usr/lib/metasploit9999/lib/msf/ui.rb:11:in `<top (required)>'
        72: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        71: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        70: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        69: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        68: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
        67: from /usr/lib/metasploit9999/lib/msf/ui/console.rb:11:in `<top (required)>'
        66: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        65: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        64: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        63: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        62: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
        61: from /usr/lib/metasploit9999/lib/msf/ui/console/driver.rb:6:in `<top (required)>'
        60: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        59: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        58: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        57: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        56: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
        55: from /usr/lib/metasploit9999/lib/msf/ui/console/command_dispatcher.rb:138:in `<top (required)>'
        54: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        53: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        52: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        51: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        50: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
        49: from /usr/lib/metasploit9999/lib/msf/ui/console/command_dispatcher/core.rb:23:in `<top (required)>'
        48: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        47: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        46: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        45: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        44: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
        43: from /usr/lib/metasploit9999/lib/msf/util/document_generator.rb:7:in `<top (required)>'
        42: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        41: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        40: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        39: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        38: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
        37: from /usr/lib/metasploit9999/lib/msf/util/document_generator/pull_request_finder.rb:1:in `<top (required)>'
        36: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        35: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        34: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        33: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        32: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
        31: from /usr/lib64/ruby/gems/2.5.0/gems/octokit-4.14.0/lib/octokit.rb:1:in `<top (required)>'
        30: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        29: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        28: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        27: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        26: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
        25: from /usr/lib64/ruby/gems/2.5.0/gems/octokit-4.14.0/lib/octokit/client.rb:1:in `<top (required)>'
        24: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        23: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        22: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        21: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        20: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
        19: from /usr/lib64/ruby/gems/2.5.0/gems/octokit-4.14.0/lib/octokit/connection.rb:1:in `<top (required)>'
        18: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
        17: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
        16: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
        15: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
        14: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
        13: from /usr/lib64/ruby/gems/2.5.0/gems/sawyer-0.8.2/lib/sawyer.rb:17:in `<top (required)>'
        12: from /usr/lib64/ruby/gems/2.5.0/gems/sawyer-0.8.2/lib/sawyer.rb:17:in `each'
        11: from /usr/lib64/ruby/gems/2.5.0/gems/sawyer-0.8.2/lib/sawyer.rb:17:in `block in <top (required)>'
        10: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
         9: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
         8: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
         7: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
         6: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require'
         5: from /usr/lib64/ruby/gems/2.5.0/gems/sawyer-0.8.2/lib/sawyer/agent.rb:1:in `<top (required)>'
         4: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `require'
         3: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
         2: from /usr/local/lib64/ruby/gems/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:274:in `block in require'
         1: from /usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require_with_backports'
/usr/lib64/ruby/gems/2.5.0/gems/backports-3.11.4/lib/backports/std_lib.rb:9:in `require': cannot load such file -- faraday (LoadError)

So, as you said, it seems to be a Gentoo specific problem. I will evaluate 2 possible solutions:

  • Remove the metasploit from emerge and try a local user installation, as you suggested.
  • Revert all the changes I made and just make a patch on my Gentoo for metasploit in order to add the faraday dependency at the gemspec file.

Obviously, the easier solution is the second, since it's easy to patch the sources with Gentoo and since I'll keep the metasploit upgrades with the system upgrades. Also, the metasploit "works fine" if I add the faraday dependency (nothing failed in the past, everything was working with the faraday dependency).

Do you want/need a report about the results I get?

@lockcda

This comment has been minimized.

Copy link
Author

lockcda commented Oct 31, 2019

By the way: I suspect that the problem is that activesupport, activemodel and activerecord on Gentoo keeps linked with the 4.2 branch instead than the 5.2 branch. And it seems to be because of an outdated gem for metasploit-model, postgres_ext and metasploit_playloads-mettle.

@jmartin-r7

This comment has been minimized.

Copy link
Contributor

jmartin-r7 commented Oct 31, 2019

These are intentional and required by the project. Metasploit-framework is not RAILS 5.x compatible at this time.

@lockcda

This comment has been minimized.

Copy link
Author

lockcda commented Oct 31, 2019

So then I think that the best option is the second: just make a local patch. Do you agree?

@jmartin-r7

This comment has been minimized.

Copy link
Contributor

jmartin-r7 commented Oct 31, 2019

It is the simplest.

Best is subjective, if I had my preference I would like to see the emerge packaging only be dependent on a supported ruby, postgresql and libpcap installed then shifting all the other dependencies to being installed into a unique gemset using bundler when compiling framework. This would keep from placing metasploit specific gems into a system wide ruby gemset.

@lockcda

This comment has been minimized.

Copy link
Author

lockcda commented Oct 31, 2019

Well, I finally did both: patching and nvm. And nvm is a better choince, since gentoo is still stuck at the 4.x branch of metasploit (even with the 9999 version). With nvm I was easily able to install the master branch. Thanks for the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.