-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
Fix RequestError class undefined method issue #14887
Conversation
For some reason I can't reproduce the original error (without the fix applied):
|
I am wrong. |
Thanks for trying that out! Yea, I was using https://ruby-doc.org/core-2.6/Symbol.html |
The fix seems good to me, we currently aim to have framework working with Ruby 2.5, 2.6, 2.7 - and soon in the future 3.0 metasploit-framework/.github/workflows/verify.yml Lines 49 to 52 in 09704e7
Although Ruby 2.5 will be EOL soon enough:
Just verified the behavior of 2.7.2 :001 > 'a'.start_with? 'a'
=> true
2.7.2 :002 > :a.start_with? 'a'
=> true
2.7.2 :003 > RUBY_DESCRIPTION
=> "ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]" With Ruby 2.6: 2.6.5 :001 > 'a'.start_with? 'a'
=> true
2.6.5 :002 > :a.start_with? 'a'
Traceback (most recent call last):
21: from /Users/user/.rvm/gems/ruby-2.6.5/bin/ruby_executable_hooks:24:in `<main>'
20: from /Users/user/.rvm/gems/ruby-2.6.5/bin/ruby_executable_hooks:24:in `eval'
19: from /Users/user/.rvm/gems/ruby-2.6.5/bin/irb:23:in `<main>'
18: from /Users/user/.rvm/gems/ruby-2.6.5/bin/irb:23:in `load'
17: from /Users/user/.rvm/gems/ruby-2.6.5/gems/irb-1.3.2/exe/irb:11:in `<top (required)>'
(irb):2:in `<main>': undefined method `start_with?' for :a:Symbol (NoMethodError)
2.6.5 :003 > RUBY_DESCRIPTION
=> "ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin18]" |
Release NotesFixed a previous feature which added the readability of Meterpreter error messages via replacing the command ID with the command name to now work with older versions of Ruby. |
If Metasploit receives an error response from Mettle, Metasploit attempts to return which command failed. The search for the command id currently throws a
NoMethodError
becausestart_with?
is called on aSymbol
instead of aString
. This change just makes sure the variable used is a string beforestart_with?
is called on it.Verification
msfconsole
rm blah.notrealext
Scenarios
Before fix
After fix