rapid7 / metasploit-omnibus

Packaging metasploit-framework with omnibus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installed gems are not found

sfjuocekr opened this issue · comments

`
msf6 > sudo gem install lab
[*] exec: sudo gem install lab

Building native extensions. This could take a while...
Successfully installed aliyun-sdk-0.8.0
Successfully installed fog-aliyun-0.3.19
Successfully installed fog-1.36.0
Successfully installed lab-0.2.7
Parsing documentation for aliyun-sdk-0.8.0
Installing ri documentation for aliyun-sdk-0.8.0
Parsing documentation for fog-aliyun-0.3.19
Installing ri documentation for fog-aliyun-0.3.19
Parsing documentation for fog-1.36.0
Installing ri documentation for fog-1.36.0
Parsing documentation for lab-0.2.7
Installing ri documentation for lab-0.2.7
Done installing documentation for aliyun-sdk, fog-aliyun, fog, lab after 26 seconds
4 gems installed
msf6 > load lab
[-] Failed to load plugin from /opt/metasploit-framework/embedded/framework/plugins/lab: WARNING: Lab gem not found, Please 'gem install lab'
`

Am I doing something wrong?

It looks like there's not enough information to replicate this issue. Please provide any relevant output and logs which may be useful in diagnosing the issue.

This includes:

  • All of the item points within this tempate
  • The result of the debug command in your Metasploit console
  • Screenshots showing the issues you're having
  • Exact replication steps

The easier it is for us to replicate and debug an issue means there's a higher chance of this issue being resolved.

Are you following a tutorial/resource? It's not entirely clear what your intent is 👍

No, I was curious of what the lab was and typed: load lab.

But this holds true for all the gems that you install manually.

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

Hi again!

It’s been 60 days since anything happened on this issue, so we are going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

Looks like an issue with the nightly installers

Gems added after install will not be in Gemfile.lock and therefor not loaded by msfconsole. This is not a framework issue but a functionality of Rubygems and bundler being vendored components since Ruby 2.5.

That would mean it should work after restarting mfconsole? (it does not)

@sfjuocekr, unfortunately no. A restart of msfconsole will not add the gem to the lock file. The gem command only installs the gem in a ruby gemset however bundler inspects the environment during startup and restricts the available gems in the runtime to those specifically referenced in the Gemfile.lock as determined by the environment. For msfconsole this means to add a gem for runtime usage the gem will need to be reference as a dependency in some way and added to the environment usually for non-developer installs this is via creating a Gemfile.local and bundle install execution to update the Gemfile.lock. After all this is completed correctly starting a new msfconsole should make the gem available to the environment.

Looking further the specific plugin you attempted to load requires the lab gem which is not referenced in metastploit-framwork.gemspec or Gemfile at this time. The project's preference is that all required gems for plugins be marked as dependencies via metasploit-framework.gemspec, however in the case of the lab model the gem in questions brings with it 30+ dependencies most users will not need and is omitted from the spec. An inspection of the plugin's history shows this gem was extracted from metastploiit-framework back in 2012 when the Ruby environment's available gem restrictions were less strongly tide to a Gemfile.lock.

@adfoster-r7 I propose that the lab plugin may be something to consider treating as a developer plugin and to address this particular issue, we could improve the error message when the require 'lab' returns a LoadError to detect if the user is in a git based environment and provide updated steps and when in an installer based environment to report the plugin is not fully supported by this installation method. Thoughts?