Bug 278534 - security/metasploit: Cannot launch after update
Summary: security/metasploit: Cannot launch after update
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Lorenzo Salvadore
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-22 20:36 UTC by d0wq92
Modified: 2024-05-03 15:36 UTC (History)
2 users (show)

See Also:
salvadore: maintainer-feedback+


Attachments
Update Metasploit to 6.3.60 and address updated dependency requirements. (2.07 KB, patch)
2024-05-02 16:17 UTC, tanawts
no flags Details | Diff
Patch to address updated dependency requirements (1.55 KB, patch)
2024-05-03 15:03 UTC, tanawts
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description d0wq92 2024-04-22 20:36:32 UTC
😞 I was happy that Metasploit got an update after long time. After updating it just won't start.


Error: https://forums.freebsd.org/attachments/msfconsole-error-jpg.18851/  < screenshot of error i posted on forum.

Error message in text below.
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dice@chibacity:~ % msfconsole
Could not find compatible versions

Because every version of sinatra depends on rack >= 3.0.0, < 4
  and every version of thin depends on rack >= 1, < 3,
  every version of sinatra is incompatible with thin >= 0.
And because every version of metasploit-framework depends on thin >= 0,
  every version of sinatra is incompatible with metasploit-framework >= 0.
So, because every version of metasploit-framework depends on sinatra >= 0
  and Gemfile depends on metasploit-framework >= 0,
  version solving has failed.

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

i am not the only one, it doesn't work on any one's PC
Comment 1 d0wq92 2024-04-22 20:45:48 UTC
seems like sirDice was able to fix it somehow , see his post here :



 https://forums.FreeBSD.org/threads/i-updated-the-metasploit-framework-and-it-doesnt-open-anymore.93188/post-652490

.



I posted this , thinking it might help Devs to tackle the issue more efficiently.
Comment 2 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-04-30 15:59:00 UTC
I confirm the bug.

Hopefully the maintainer is able to help. In the meantime I am also going to take a look to sirDice's solution.
Comment 3 tanawts 2024-04-30 21:33:32 UTC
Bug Acknowledged -- I see the form post regarding the quick fix with:
 rubygem-mini_portile2>=2.8.2:devel/rubygem-mini_portile2 \

Will test and submit a patch if everything tests out clean.

Thanks for reporting!!!
Comment 4 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-05-01 08:49:54 UTC
I have tested sirDice's suggestion too and it worked for me as well.
Comment 5 tanawts 2024-05-02 16:17:21 UTC
Created attachment 250332 [details]
Update Metasploit to 6.3.60 and address updated dependency  requirements.

Updating Metasploit from upstream 6.3.50 to 6.3.60

Adding updated dependencies for:
rubygem-sinatra2>=0:www/rubygem-sinatra2
rubygem-mini_portile2>=2.8.2:devel/rubygem-mini_portile2
Comment 6 d0wq92 2024-05-02 18:27:59 UTC
(In reply to Lorenzo Salvadore from comment #2)
Thanks.
(In reply to tanawts from comment #3)
Thanks again.
Comment 7 d0wq92 2024-05-02 18:38:57 UTC
(In reply to tanawts from comment #5)

hello, 

I tried 'pkg update and then pkg upgrade' but there's not Metasploit update shown 
and the error still remains.

I don't have a port but a stable package installed.


(In reply to Lorenzo Salvadore from comment #4)

hello, 
do you have port or package of Metasploit?
Comment 8 tanawts 2024-05-02 19:26:17 UTC
@d0wq92, you will have to be patient as someone with FreeBSD Commit level privileges will need to commit my patch to the main ports repo for replication. After that, you can perform sync your ports and update as needed. 

Details on working with ports and packages can be found in the FreeBSD Handbook.
https://docs.freebsd.org/en/books/handbook/ports/#ports-using

If you'd like to test the attached patch out yourself, after downloading it, you can apply the patch via:
# cd /usr/ports/security/metasploit/
# patch -R < metasploit.diff

Your make && make install && msfconsole commands should work after that.
Comment 9 d0wq92 2024-05-03 10:51:44 UTC
(In reply to tanawts from comment #8)

Ok, thanks.
Comment 10 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-05-03 13:24:28 UTC
(In reply to tanawts from comment #8)

Have you tested the patch succesfully?

I get the following error message when I try to start msfconsole, which must be due to the update (I had already tested the rest of the patch successfully):

---
Could not find compatible versions

Because every version of metasploit-framework depends on metasploit-payloads = 2.0.166
  and metasploit-payloads = 2.0.166 could not be found in locally installed gems,
  metasploit-framework cannot be used.
So, because Gemfile depends on metasploit-framework >= 0,
  version solving has failed.
---

Also, if you update DISTVERSION you need to remove PORTREVISION.
Comment 11 tanawts 2024-05-03 15:03:37 UTC
Created attachment 250354 [details]
Patch to address updated dependency requirements

Adding updated dependencies for:
rubygem-sinatra2>=0:www/rubygem-sinatra2
rubygem-mini_portile2>=2.8.2:devel/rubygem-mini_portile2
Comment 12 tanawts 2024-05-03 15:05:15 UTC
Thanks for the catch Lorenzo, got too greedy. I will submit a separate ticket & patch to handle the roll up for updating to 6.3.60 since it's going to affect dependent rubygems.

The new patch should properly address d0wq92's bug appropriately.

Thanks again!
Comment 13 commit-hook freebsd_committer freebsd_triage 2024-05-03 15:32:26 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6a4499516682ad70be53b7ed6d37c5502caa4f87

commit 6a4499516682ad70be53b7ed6d37c5502caa4f87
Author:     Tanawts <tanawts@gmail.com>
AuthorDate: 2024-05-03 15:24:58 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2024-05-03 15:31:33 +0000

    security/metasploit: Fix crash at start

    Fix crash at start due to issues with dependencies:

    Could not find compatible versions

    Because every version of sinatra depends on rack >= 3.0.0, < 4
      and every version of thin depends on rack >= 1, < 3,
      every version of sinatra is incompatible with thin >= 0.
    And because every version of metasploit-framework depends on thin >= 0,
      every version of sinatra is incompatible with metasploit-framework >= 0.
    So, because every version of metasploit-framework depends on sinatra >= 0
      and Gemfile depends on metasploit-framework >= 0,
      version solving has failed.

    PR:             278534
    Reported by:    d0wq92 <dimoj30024@picdv.com>

 security/metasploit/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Comment 14 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-05-03 15:36:41 UTC
Committed, thanks!

I have only added a PORTREVISION bump, which is required due to the changes in dependencies.