Skip to content

Commit 9630d46

Browse files
author
Tod Beardsley
committed
Land rapid7#4012, info showing actions
2 parents 309d578 + 5c4f610 commit 9630d46

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

lib/msf/base/serializer/readable_text.rb

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def self.dump_module(mod, indent = " ")
3131
when MODULE_AUX
3232
return dump_auxiliary_module(mod, indent)
3333
when MODULE_POST
34-
return dump_basic_module(mod, indent)
34+
return dump_post_module(mod, indent)
3535
else
3636
return dump_generic_module(mod, indent)
3737
end
@@ -232,6 +232,57 @@ def self.dump_auxiliary_module(mod, indent = '')
232232
}
233233
output << "\n"
234234

235+
# Actions
236+
if mod.action
237+
output << "Available actions:\n"
238+
output << dump_module_actions(mod, indent)
239+
end
240+
241+
# Options
242+
if (mod.options.has_options?)
243+
output << "Basic options:\n"
244+
output << dump_options(mod, indent)
245+
output << "\n"
246+
end
247+
248+
# Description
249+
output << "Description:\n"
250+
output << word_wrap(Rex::Text.compress(mod.description))
251+
output << "\n"
252+
253+
# References
254+
output << dump_references(mod, indent)
255+
256+
return output
257+
end
258+
259+
# Dumps information about a post module.
260+
#
261+
# @param mod [Msf::Post] the post module.
262+
# @param indent [String] the indentation to use.
263+
# @return [String] the string form of the information.
264+
def self.dump_post_module(mod, indent = '')
265+
output = "\n"
266+
output << " Name: #{mod.name}\n"
267+
output << " Module: #{mod.fullname}\n"
268+
output << " Platform: #{mod.platform_to_s}\n"
269+
output << " Arch: #{mod.arch_to_s}\n"
270+
output << " Rank: #{mod.rank_to_s.capitalize}\n"
271+
output << "\n"
272+
273+
# Authors
274+
output << "Provided by:\n"
275+
mod.each_author { |author|
276+
output << indent + author.to_s + "\n"
277+
}
278+
output << "\n"
279+
280+
# Actions
281+
if mod.action
282+
output << "Available actions:\n"
283+
output << dump_module_actions(mod, indent)
284+
end
285+
235286
# Options
236287
if (mod.options.has_options?)
237288
output << "Basic options:\n"

0 commit comments

Comments
 (0)