Skip to content

Commit a8b5bf4

Browse files
committed
Show selected auxiliary action
1 parent 056ee4f commit a8b5bf4

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

lib/msf/base/serializer/readable_text.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,28 @@ def self.dump_auxiliary_actions(mod, indent = '', h = nil)
108108
tbl.to_s + "\n"
109109
end
110110

111+
# Dumps the auxiliary's selected action
112+
#
113+
# @param mod [Msf::Auxiliary] the auxiliary module.
114+
# @param indent [String] the indentation to use (only the length
115+
# matters)
116+
# @param h [String] the string to display as the table heading.
117+
# @return [String] the string form of the table.
118+
def self.dump_auxiliary_action(mod, indent = '', h = nil)
119+
tbl = Rex::Ui::Text::Table.new(
120+
'Indent' => indent.length,
121+
'Header' => h,
122+
'Columns' =>
123+
[
124+
'Name',
125+
'Description',
126+
])
127+
128+
tbl << [ mod.action.name || 'All', mod.action.description || '' ]
129+
130+
tbl.to_s + "\n"
131+
end
132+
111133
# Dumps the table of payloads that are compatible with the supplied
112134
# exploit.
113135
#

lib/msf/ui/console/command_dispatcher/core.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3140,10 +3140,13 @@ def show_options(mod) # :nodoc:
31403140
end
31413141
end
31423142

3143-
# Print the selected target
3143+
# Print the selected target or action
31443144
if (mod.exploit? and mod.target)
31453145
mod_targ = Serializer::ReadableText.dump_exploit_target(mod, ' ')
31463146
print("\nExploit target:\n\n#{mod_targ}\n") if (mod_targ and mod_targ.length > 0)
3147+
elsif (mod.auxiliary? and mod.action)
3148+
mod_action = Serializer::ReadableText.dump_auxiliary_action(mod, ' ')
3149+
print("\nAuxiliary action:\n\n#{mod_action}\n") if (mod_action and mod_action.length > 0)
31473150
end
31483151

31493152
# Uncomment this line if u want target like msf2 format

0 commit comments

Comments
 (0)