reenable jar format
parent
849495e658
commit
e2dd844e34
|
@ -2229,6 +2229,7 @@ require 'msf/core/exe/segment_appender'
|
||||||
"exe-service",
|
"exe-service",
|
||||||
"exe-small",
|
"exe-small",
|
||||||
"hta-psh",
|
"hta-psh",
|
||||||
|
"jar",
|
||||||
"loop-vbs",
|
"loop-vbs",
|
||||||
"macho",
|
"macho",
|
||||||
"msi",
|
"msi",
|
||||||
|
|
10
msfvenom
10
msfvenom
|
@ -18,6 +18,7 @@ require 'msf/core/payload_generator'
|
||||||
|
|
||||||
|
|
||||||
class MsfVenomError < StandardError; end
|
class MsfVenomError < StandardError; end
|
||||||
|
class HelpError < StandardError; end
|
||||||
class UsageError < MsfVenomError; end
|
class UsageError < MsfVenomError; end
|
||||||
class NoTemplateError < MsfVenomError; end
|
class NoTemplateError < MsfVenomError; end
|
||||||
class IncompatibleError < MsfVenomError; end
|
class IncompatibleError < MsfVenomError; end
|
||||||
|
@ -95,7 +96,7 @@ def parse_args(args)
|
||||||
"\t" + ::Msf::Util::EXE.to_executable_fmt_formats.join(", ") + "\n" +
|
"\t" + ::Msf::Util::EXE.to_executable_fmt_formats.join(", ") + "\n" +
|
||||||
"Transform formats\n" +
|
"Transform formats\n" +
|
||||||
"\t" + ::Msf::Simple::Buffer.transform_formats.join(", ")
|
"\t" + ::Msf::Simple::Buffer.transform_formats.join(", ")
|
||||||
raise UsageError, msg
|
raise HelpError, msg
|
||||||
end
|
end
|
||||||
|
|
||||||
opt.on('-e', '--encoder <encoder>', String, 'The encoder to use') do |e|
|
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}"}
|
Msf::Module::Platform.subclasses.each {|c| supported_platforms << "#{c.realname.downcase}"}
|
||||||
msg = "Platforms\n" +
|
msg = "Platforms\n" +
|
||||||
"\t" + supported_platforms * ", "
|
"\t" + supported_platforms * ", "
|
||||||
raise UsageError, msg
|
raise HelpError, msg
|
||||||
end
|
end
|
||||||
|
|
||||||
opt.on('-s', '--space <length>', Integer, 'The maximum size of the resulting payload') do |s|
|
opt.on('-s', '--space <length>', Integer, 'The maximum size of the resulting payload') do |s|
|
||||||
|
@ -160,7 +161,7 @@ def parse_args(args)
|
||||||
end
|
end
|
||||||
|
|
||||||
opt.on_tail('-h', '--help', 'Show this message') do
|
opt.on_tail('-h', '--help', 'Show this message') do
|
||||||
raise UsageError, "#{opt}"
|
raise HelpError, "#{opt}"
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
@ -280,6 +281,9 @@ end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
generator_opts = parse_args(ARGV)
|
generator_opts = parse_args(ARGV)
|
||||||
|
rescue HelpError => e
|
||||||
|
$stderr.puts e.message
|
||||||
|
exit(1)
|
||||||
rescue MsfVenomError, Msf::OptionValidateError => e
|
rescue MsfVenomError, Msf::OptionValidateError => e
|
||||||
$stderr.puts "Error: #{e.message}"
|
$stderr.puts "Error: #{e.message}"
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
Loading…
Reference in New Issue