1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-05 14:57:30 +01:00

Land #6862, jar payloads

lands FireFarts jar payload pr
This commit is contained in:
David Maloney 2016-05-11 09:56:41 -05:00
commit 993709e076
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
2 changed files with 8 additions and 3 deletions

View File

@ -2229,6 +2229,7 @@ require 'msf/core/exe/segment_appender'
"exe-service",
"exe-small",
"hta-psh",
"jar",
"loop-vbs",
"macho",
"msi",

View File

@ -18,6 +18,7 @@ require 'msf/core/payload_generator'
class MsfVenomError < StandardError; end
class HelpError < StandardError; end
class UsageError < MsfVenomError; end
class NoTemplateError < MsfVenomError; end
class IncompatibleError < MsfVenomError; end
@ -95,7 +96,7 @@ def parse_args(args)
"\t" + ::Msf::Util::EXE.to_executable_fmt_formats.join(", ") + "\n" +
"Transform formats\n" +
"\t" + ::Msf::Simple::Buffer.transform_formats.join(", ")
raise UsageError, msg
raise HelpError, msg
end
opt.on('-e', '--encoder <encoder>', String, 'The encoder to use') do |e|
@ -116,7 +117,7 @@ def parse_args(args)
Msf::Module::Platform.subclasses.each {|c| supported_platforms << "#{c.realname.downcase}"}
msg = "Platforms\n" +
"\t" + supported_platforms * ", "
raise UsageError, msg
raise HelpError, msg
end
opt.on('-s', '--space <length>', Integer, 'The maximum size of the resulting payload') do |s|
@ -160,7 +161,7 @@ def parse_args(args)
end
opt.on_tail('-h', '--help', 'Show this message') do
raise UsageError, "#{opt}"
raise HelpError, "#{opt}"
end
begin
@ -280,6 +281,9 @@ end
begin
generator_opts = parse_args(ARGV)
rescue HelpError => e
$stderr.puts e.message
exit(1)
rescue MsfVenomError, Msf::OptionValidateError => e
$stderr.puts "Error: #{e.message}"
exit(1)