Show selected auxiliary action

This commit is contained in:
William Vu 2014-10-07 14:34:41 -05:00
parent 056ee4f207
commit a8b5bf4625
No known key found for this signature in database
GPG Key ID: E761DCB4C1629024
2 changed files with 26 additions and 1 deletions

View File

@ -108,6 +108,28 @@ class ReadableText
tbl.to_s + "\n"
end
# Dumps the auxiliary's selected action
#
# @param mod [Msf::Auxiliary] the auxiliary module.
# @param indent [String] the indentation to use (only the length
# matters)
# @param h [String] the string to display as the table heading.
# @return [String] the string form of the table.
def self.dump_auxiliary_action(mod, indent = '', h = nil)
tbl = Rex::Ui::Text::Table.new(
'Indent' => indent.length,
'Header' => h,
'Columns' =>
[
'Name',
'Description',
])
tbl << [ mod.action.name || 'All', mod.action.description || '' ]
tbl.to_s + "\n"
end
# Dumps the table of payloads that are compatible with the supplied
# exploit.
#

View File

@ -3140,10 +3140,13 @@ class Core
end
end
# Print the selected target
# Print the selected target or action
if (mod.exploit? and mod.target)
mod_targ = Serializer::ReadableText.dump_exploit_target(mod, ' ')
print("\nExploit target:\n\n#{mod_targ}\n") if (mod_targ and mod_targ.length > 0)
elsif (mod.auxiliary? and mod.action)
mod_action = Serializer::ReadableText.dump_auxiliary_action(mod, ' ')
print("\nAuxiliary action:\n\n#{mod_action}\n") if (mod_action and mod_action.length > 0)
end
# Uncomment this line if u want target like msf2 format