Land @busterb's #9261, which makes the default prompt include the longer name of the module,
avoiding ambiguity and providing more context
This commit is contained in:
commit
73742d7de5
|
@ -24,6 +24,10 @@ module Msf::Module::FullName
|
|||
type + '/' + refname
|
||||
end
|
||||
|
||||
def promptname
|
||||
refname
|
||||
end
|
||||
|
||||
def shortname
|
||||
refname.split('/').last
|
||||
end
|
||||
|
@ -55,9 +59,16 @@ module Msf::Module::FullName
|
|||
end
|
||||
|
||||
#
|
||||
# Returns the module's framework short name. This is a
|
||||
# possibly conflicting name used for things like console
|
||||
# prompts.
|
||||
# Returns the module's framework prompt-friendly name.
|
||||
#
|
||||
# reverse_tcp
|
||||
#
|
||||
def promptname
|
||||
self.class.promptname
|
||||
end
|
||||
|
||||
#
|
||||
# Returns the module's framework short name.
|
||||
#
|
||||
# reverse_tcp
|
||||
#
|
||||
|
|
|
@ -1107,7 +1107,7 @@ class Core
|
|||
if active_module
|
||||
# intentionally += and not << because we don't want to modify
|
||||
# datastore or the constant DefaultPrompt
|
||||
prompt += " #{active_module.type}(%bld%red#{active_module.shortname}%clr)"
|
||||
prompt += " #{active_module.type}(%bld%red#{active_module.promptname}%clr)"
|
||||
end
|
||||
prompt_char = framework.datastore['PromptChar'] || Msf::Ui::Console::Driver::DefaultPromptChar
|
||||
driver.update_prompt("#{prompt} ", prompt_char, true)
|
||||
|
|
|
@ -661,7 +661,7 @@ module Msf
|
|||
# Update the command prompt
|
||||
prompt = framework.datastore['Prompt'] || Msf::Ui::Console::Driver::DefaultPrompt
|
||||
prompt_char = framework.datastore['PromptChar'] || Msf::Ui::Console::Driver::DefaultPromptChar
|
||||
driver.update_prompt("#{prompt} #{mod.type}(%bld%red#{mod.shortname}%clr) ", prompt_char, true)
|
||||
driver.update_prompt("#{prompt} #{mod.type}(%bld%red#{mod.promptname}%clr) ", prompt_char, true)
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue