Land #10464, prompt to use plain module name

GSoC/Meterpreter_Web_Console
William Vu 2018-08-15 20:55:28 -05:00
commit 101539a1bc
No known key found for this signature in database
GPG Key ID: 68BD00CE25866743
2 changed files with 19 additions and 0 deletions

View File

@ -503,6 +503,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: