mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-05 14:57:30 +01:00
commit
993709e076
@ -2229,6 +2229,7 @@ require 'msf/core/exe/segment_appender'
|
||||
"exe-service",
|
||||
"exe-small",
|
||||
"hta-psh",
|
||||
"jar",
|
||||
"loop-vbs",
|
||||
"macho",
|
||||
"msi",
|
||||
|
10
msfvenom
10
msfvenom
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user