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

Installed gems are not found #163

Open
sfjuocekr opened this issue Sep 3, 2021 · 11 comments
Open

Installed gems are not found #163

sfjuocekr opened this issue Sep 3, 2021 · 11 comments

Comments

@sfjuocekr
Copy link

`
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?

@github-actions
Copy link

github-actions bot commented Sep 5, 2021

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.

@adfoster-r7
Copy link
Contributor

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

@sfjuocekr
Copy link
Author

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.

@github-actions
Copy link

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.

@github-actions
Copy link

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.

@adfoster-r7
Copy link
Contributor

Looks like an issue with the nightly installers

@adfoster-r7 adfoster-r7 transferred this issue from rapid7/metasploit-framework Nov 10, 2021
@adfoster-r7 adfoster-r7 reopened this Nov 11, 2021
@jmartin-tech
Copy link
Contributor

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.

@sfjuocekr
Copy link
Author

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

@jmartin-tech
Copy link
Contributor

jmartin-tech commented Jan 10, 2022

@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?

@Hamza8162
Copy link

l

@PLayboimacks
Copy link

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants