Bug 262289 - security/metasploit: Can not launch metasploit
Summary: security/metasploit: Can not launch metasploit
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Loïc Bartoletti
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-02 08:24 UTC by Loïc Bartoletti
Modified: 2022-09-15 17:02 UTC (History)
5 users (show)

See Also:
tanawts: maintainer-feedback+
tanawts: maintainer-feedback+
tanawts: merge-quarterly?


Attachments
pkg-message patch (441 bytes, patch)
2022-05-27 16:40 UTC, tanawts
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Loïc Bartoletti freebsd_committer freebsd_triage 2022-03-02 08:24:23 UTC
It looks like that metasploit seems to require win32api... well an ifdef seems missing somewhere.

Same problem with mfsdb

```
msfconsole 
> Bundler could not find compatible versions for gem "win32api":
  In Gemfile:
    metasploit-framework was resolved to 6.1.24, which depends on
      win32api

Could not find gem 'win32api', which is required by gem 'metasploit-framework', in any of the sources.
```
Comment 1 tanawts 2022-03-02 19:51:16 UTC
Did you try to run "bundle install" in
/usr/local/share/metasploit?
Metasploit needs this after each update so that the rubygems are being updated.
Comment 2 Jim Long 2022-03-02 20:54:57 UTC
Thank you for your suggestion.  This resolves my issue.  Can a fix to this effect be added to any of:

  * the post-installation script, so it happens automagically on
    installation or upgrade?

  * the post-installation message, so the the user is reminded to 
    do it manually on installation or upgrade?

  * the error message diagnostic (probably least preferable option)?

Thanks again!
Comment 3 Loïc Bartoletti freebsd_committer freebsd_triage 2022-03-04 16:59:47 UTC
(In reply to Jim Long from comment #2)

>  * the post-installation message, so the the user is reminded to 
    do it manually on installation or upgrade?

This is worth a pkg-message!
Comment 4 Fernando Apesteguía freebsd_committer freebsd_triage 2022-03-17 09:14:34 UTC
^Triage: Reporter is committer, assign accordingly.
Comment 5 tanawts 2022-05-27 16:40:47 UTC
Created attachment 234270 [details]
pkg-message  patch

Patch to include instructions for installation of win32api
Comment 6 tanawts 2022-05-27 16:42:21 UTC
Attached is a pkg-message patch to include the instructions for win32api installation. Since this collection requires the intended unprivileged users to install the dependencies, there wasn't a good way to include automated installation via the port, hence the inclusion of the recommended pkg-message file.

Thank you!
Comment 7 Jim Long 2022-05-27 17:43:04 UTC
Thank you!  Your work in bringing this software to the community is appreciated.
Comment 8 tanawts 2022-05-27 21:27:44 UTC
Thanks! Once I see the pkg-message patch has been accepted and committed, I'll submit a separate ticket for an update to the newest Metasploit version as well.
Comment 9 tanawts 2022-06-26 21:41:45 UTC
Loïc Bartoletti, if you have commit entitlements, can you please update the port with the attached patch to address the reported bug?

Thank you!
Comment 10 tanawts 2022-07-20 16:54:19 UTC
Patch has been provided against this bug ticket - Please merge into branch

Thank you.
Comment 11 Loïc Bartoletti freebsd_committer freebsd_triage 2022-09-15 17:02:59 UTC
mmm, I get a problem using bundle:

```
/usr/local/share/metasploit  bundle install                                                            ✔  19:01:24 
Following files may not be writable, so sudo is needed:
  /usr/local/share/metasploit


Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle config set --local path 'vendor/bundle'
      bundle install

  to install the gems into ./vendor/bundle/, or you can enter your password
  and install the bundled gems to RubyGems using sudo.

  Password:
```

Even after:
 bundle config set --local path 'vendor/bundle'

there is the same error