basic module display info

git-svn-id: file:///home/svn/incoming/trunk@2714 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Miller 2005-07-10 21:01:05 +00:00
parent 9fe92b5347
commit f0e18799ba
4 changed files with 13 additions and 7 deletions

View File

@ -22,7 +22,9 @@ class ReadableText
when MODULE_PAYLOAD when MODULE_PAYLOAD
return dump_payload_module(mod, indent) return dump_payload_module(mod, indent)
when MODULE_NOP when MODULE_NOP
return dump_nop_module(mod, indent) return dump_basic_module(mod, indent)
when MODULE_ENCODER
return dump_basic_module(mod, indent)
when MODULE_EXPLOIT when MODULE_EXPLOIT
return dump_exploit_module(mod, indent) return dump_exploit_module(mod, indent)
else else
@ -77,14 +79,14 @@ class ReadableText
end end
# #
# Dumps information about a nop module. # Dumps information about a module, just the basics.
# #
def self.dump_nop_module(mod, indent) def self.dump_basic_module(mod, indent)
# General # General
output = "\n" output = "\n"
output += " Name: #{mod.name}\n" output += " Name: #{mod.name}\n"
output += " Version: #{mod.version}\n" output += " Version: #{mod.version}\n"
#output += " Platform: #{mod.platform_to_s}\n" output += " Platform: #{mod.platform_to_s}\n"
output += " Arch: #{mod.arch.to_s}\n" output += " Arch: #{mod.arch.to_s}\n"
output += "\n" output += "\n"

View File

@ -57,9 +57,11 @@ class Payload
# Prepend a comment # Prepend a comment
if (fmt != 'raw' and opts['NoComment'] != true) if (fmt != 'raw' and opts['NoComment'] != true)
((ds = payload.datastore.to_s) and ds.length > 0) ? ds += "\n" : ds = ''
buf = Buffer.comment( buf = Buffer.comment(
"#{payload.refname} - http://www.metasploit.com\n" + "#{payload.refname} - http://www.metasploit.com\n" +
"#{payload.datastore.to_s}\n" + "#{ds}" +
((opts['Encoder']) ? "Encoder=" + opts['Encoder'].refname + "\n" : ''), fmt) + buf ((opts['Encoder']) ? "Encoder=" + opts['Encoder'].refname + "\n" : ''), fmt) + buf
end end

View File

@ -44,7 +44,7 @@ class DataStore < Hash
if (var == nil or val == nil) if (var == nil or val == nil)
var = "unknown" if (!var) var = "unknown" if (!var)
raise ArgumentParseError, "Invalid option specified: #{var}", caller raise Rex::ArgumentParseError, "Invalid option specified: #{var}", caller
end end
# Store the value # Store the value

View File

@ -140,7 +140,9 @@ class Module
# Return a comma separated list of supported platforms, if any # Return a comma separated list of supported platforms, if any
# #
def platform_to_s def platform_to_s
return platform.join(", ") # TODO: fix me spoonm!
return "TODO"
end end
# #