Land #10464, prompt to use plain module name

4.x
William Vu 2018-08-15 20:55:28 -05:00 committed by Metasploit
parent 902d2bca96
commit e11266f0a0
No known key found for this signature in database
GPG Key ID: CDFB5FA52007B954
2 changed files with 19 additions and 0 deletions

View File

@ -543,6 +543,13 @@ protected
print_error("Permission denied exec: #{line}")
end
self.busy = false
return
elsif framework.modules.create(method)
super
if prompt_yesno "This is a module we can load. Do you want to use #{method}?"
run_single "use #{method}"
end
return
end
end

View File

@ -429,6 +429,18 @@ protected
rlog(buf, log_source) if (log_source)
end
#
# Prompt the user for input if possible. Special edition for use inside commands.
#
def prompt_yesno(query)
p = "#{query} [y/N]"
old_p = [self.prompt.sub(/#{self.prompt_char} $/, ''), self.prompt_char]
update_prompt p, ' ', true
/^y/ === get_input_line
ensure
update_prompt *old_p, true
end
attr_writer :input, :output # :nodoc:
attr_accessor :stop_flag, :init_prompt, :cont_prompt # :nodoc:
attr_accessor :prompt # :nodoc: