FS#66480 - [metasploit] irb.rb not found
Attached to Project:
Community Packages
Opened by gch (gch) - Thursday, 30 April 2020, 16:10 GMT
Last edited by Levente Polyak (anthraxx) - Monday, 18 July 2022, 17:55 GMT
Opened by gch (gch) - Thursday, 30 April 2020, 16:10 GMT
Last edited by Levente Polyak (anthraxx) - Monday, 18 July 2022, 17:55 GMT
|
Details
Description:
Cannot run 'irb' in msfconsole. Package version : community/metasploit 5.0.86-1 Steps to reproduce: In msfconsole, run 'irb' then enter. The following message is displayed: ``` [-] Error while running command irb: cannot load such file -- irb.rb ``` I'm not sure this is due to the archlinux package. By looking in the source code, msfconsole try to run load('irb.rb') in lib/rex/ui/text/irb_shell.rb. I have two 'irb.rb' files on my system: - /usr/lib/ruby/gems/2.7.0/gems/irb-1.2.1/lib - /opt/ruby2.6/lib/ruby/2.6.0/ I can bypass this failure with the following: ``` msf5> irb -e '$LOAD_PATH << "/opt/ruby2.6/lib/ruby/2.6.0/"' # or the 1st one [*] Starting IRB shell... [*] You are in the "framework" object /opt/ruby2.6/lib/ruby/2.6.0/irb/workspace.rb:52: warning: calling private without arguments inside a method may not have the intended effect irb: warn: can't alias jobs from irb_jobs. >> 1+1 =>2 ``` And yes 'irb -e "<ruby code>"' works. I don't get the warning message when add "/usr/lib/ruby/gems/2.7.0/gems/irb-1.2.1/lib" to $LOAD_PATH. |
This task depends upon
The workaround that works with the standard ruby package is (as you said):
```
$ msfconsole -q
msf5 > irb -e '$LOAD_PATH << "/usr/lib/ruby/gems/2.7.0/gems/irb-1.2.1/lib/"'
msf5 > irb
[*] Starting IRB shell...
[*] You are in the "framework" object
irb: warn: can't alias jobs from irb_jobs.
>>
```
I think this report could be closed.
When ghc said "I think this report could be closed." it's because he think this issue a support demand rather than a bug report.
Also when he says "I figured this out by testing the default installation on various OS and using various installation methods.", he means the fact that irb.rb exists in /opt/ruby2.6/lib/ruby/2.6.0/ not the fact that the bug exists on other oses.
if irb is required, which seems to be the case for this feature, it should be declared explicitly so bundler can pick it up.
In the meantime we should maybe add a sed command in a prepare() statement to temporarily patch/workaround this.