-
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 RPORT tab completion crash when connected to remote dataservice #15194
Conversation
Looks like this needs to handle the msfconsole crashing on tab completion still 👀 |
if res.empty? | ||
res << rand(1..65534).to_s | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can anyone explain why we were returning a random port suggestion when we couldn't find one in the DB?
Can confirm that with new changes this fixes the tab completion error.
|
lib/rex/ui/text/input/readline.rb
Outdated
@rl_saved_proc = tab_complete_proc | ||
::Readline.completion_proc = wrap_tab_compete_proc(tab_complete_proc) | ||
|
||
@rl_saved_proc = wrap_tab_compete_proc(tab_complete_proc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this wraps the previous readline completion proc in a try/catch, not sure if that's what we want to happen here? 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's wrapping the tab_complete_proc
that gets passed in with initialize
. The previous tab_complete_proc
is getting overwritten here
484e832
to
fa19fa9
Compare
Tested with:
|
fa19fa9
to
134e820
Compare
@msjenkins-r7 retest this please |
Release NotesFixed a bug where msfconsole would crash when connected to a remote dataservice and tab completing possible RPORT values. |
Fixes #15075
Removes usage of
has_host?
from theoption_values_target_ports
module ofmodule_option_tab_completion
.This is the last remaining use of the method in the code base, so I deleted the original method definition since it's breaking things and we don't want it being used in the future.
Verification
List the steps needed to make sure this thing works
msfconsole
use auxiliary/scanner/ssh/ssh_login
set RHOSTS 1.1.1.1
set RPORT <TAB>