Fully-qualifiy Msf::MODULE_TYPES constants
MSP-11126 Fully-qualify `Msf::MODULE_TYPES`, `Msf::MODULE_ANY`, Msf::MODULE_ENCODER`, `Msf::MODULE_EXPLOIT`, `Msf::MODULE_NOP`, `Msf::MODULE_AUX`, `Msf::MODULE_PAYLOAD`, `Msf::MODULE_POST` so that their usage isn't dependent on nested lexical scoping.bug/bundler_fix
parent
7ffd07c44d
commit
0c00c7cc50
|
@ -20,17 +20,17 @@ class ReadableText
|
||||||
# @return [String] formatted text output of the dump.
|
# @return [String] formatted text output of the dump.
|
||||||
def self.dump_module(mod, indent = " ")
|
def self.dump_module(mod, indent = " ")
|
||||||
case mod.type
|
case mod.type
|
||||||
when MODULE_PAYLOAD
|
when Msf::MODULE_PAYLOAD
|
||||||
return dump_payload_module(mod, indent)
|
return dump_payload_module(mod, indent)
|
||||||
when MODULE_NOP
|
when Msf::MODULE_NOP
|
||||||
return dump_basic_module(mod, indent)
|
return dump_basic_module(mod, indent)
|
||||||
when MODULE_ENCODER
|
when Msf::MODULE_ENCODER
|
||||||
return dump_basic_module(mod, indent)
|
return dump_basic_module(mod, indent)
|
||||||
when MODULE_EXPLOIT
|
when Msf::MODULE_EXPLOIT
|
||||||
return dump_exploit_module(mod, indent)
|
return dump_exploit_module(mod, indent)
|
||||||
when MODULE_AUX
|
when Msf::MODULE_AUX
|
||||||
return dump_auxiliary_module(mod, indent)
|
return dump_auxiliary_module(mod, indent)
|
||||||
when MODULE_POST
|
when Msf::MODULE_POST
|
||||||
return dump_post_module(mod, indent)
|
return dump_post_module(mod, indent)
|
||||||
else
|
else
|
||||||
return dump_generic_module(mod, indent)
|
return dump_generic_module(mod, indent)
|
||||||
|
|
|
@ -54,12 +54,12 @@ module Framework
|
||||||
|
|
||||||
ModuleSimplifiers =
|
ModuleSimplifiers =
|
||||||
{
|
{
|
||||||
MODULE_ENCODER => Msf::Simple::Encoder,
|
Msf::MODULE_ENCODER => Msf::Simple::Encoder,
|
||||||
MODULE_EXPLOIT => Msf::Simple::Exploit,
|
Msf::MODULE_EXPLOIT => Msf::Simple::Exploit,
|
||||||
MODULE_NOP => Msf::Simple::Nop,
|
Msf::MODULE_NOP => Msf::Simple::Nop,
|
||||||
MODULE_PAYLOAD => Msf::Simple::Payload,
|
Msf::MODULE_PAYLOAD => Msf::Simple::Payload,
|
||||||
MODULE_AUX => Msf::Simple::Auxiliary,
|
Msf::MODULE_AUX => Msf::Simple::Auxiliary,
|
||||||
MODULE_POST => Msf::Simple::Post,
|
Msf::MODULE_POST => Msf::Simple::Post,
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -21,14 +21,14 @@ class Auxiliary < Msf::Module
|
||||||
# Returns MODULE_AUX to indicate that this is an auxiliary module.
|
# Returns MODULE_AUX to indicate that this is an auxiliary module.
|
||||||
#
|
#
|
||||||
def self.type
|
def self.type
|
||||||
MODULE_AUX
|
Msf::MODULE_AUX
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns MODULE_AUX to indicate that this is an auxiliary module.
|
# Returns MODULE_AUX to indicate that this is an auxiliary module.
|
||||||
#
|
#
|
||||||
def type
|
def type
|
||||||
MODULE_AUX
|
Msf::MODULE_AUX
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -150,14 +150,14 @@ class Encoder < Module
|
||||||
# Returns MODULE_ENCODER to indicate that this is an encoder module.
|
# Returns MODULE_ENCODER to indicate that this is an encoder module.
|
||||||
#
|
#
|
||||||
def self.type
|
def self.type
|
||||||
return MODULE_ENCODER
|
return Msf::MODULE_ENCODER
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns MODULE_ENCODER to indicate that this is an encoder module.
|
# Returns MODULE_ENCODER to indicate that this is an encoder module.
|
||||||
#
|
#
|
||||||
def type
|
def type
|
||||||
return MODULE_ENCODER
|
return Msf::MODULE_ENCODER
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -621,14 +621,14 @@ class Exploit < Msf::Module
|
||||||
# Returns MODULE_EXPLOIT to indicate that this is an exploit module.
|
# Returns MODULE_EXPLOIT to indicate that this is an exploit module.
|
||||||
#
|
#
|
||||||
def self.type
|
def self.type
|
||||||
MODULE_EXPLOIT
|
Msf::MODULE_EXPLOIT
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns MODULE_EXPLOIT to indicate that this is an exploit module.
|
# Returns MODULE_EXPLOIT to indicate that this is an exploit module.
|
||||||
#
|
#
|
||||||
def type
|
def type
|
||||||
MODULE_EXPLOIT
|
Msf::MODULE_EXPLOIT
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -69,7 +69,7 @@ class Framework
|
||||||
def initialize(opts={})
|
def initialize(opts={})
|
||||||
|
|
||||||
# Allow specific module types to be loaded
|
# Allow specific module types to be loaded
|
||||||
types = opts[:module_types] || MODULE_TYPES
|
types = opts[:module_types] || Msf::MODULE_TYPES
|
||||||
|
|
||||||
self.threads = ThreadManager.new(self)
|
self.threads = ThreadManager.new(self)
|
||||||
self.events = EventDispatcher.new(self)
|
self.events = EventDispatcher.new(self)
|
||||||
|
|
|
@ -17,11 +17,11 @@ module Msf::Module::Compatibility
|
||||||
return true if (mod == nil)
|
return true if (mod == nil)
|
||||||
|
|
||||||
# Determine which hash to used based on the supplied module type
|
# Determine which hash to used based on the supplied module type
|
||||||
if (mod.type == MODULE_ENCODER)
|
if (mod.type == Msf::MODULE_ENCODER)
|
||||||
ch = self.compat['Encoder']
|
ch = self.compat['Encoder']
|
||||||
elsif (mod.type == MODULE_NOP)
|
elsif (mod.type == Msf::MODULE_NOP)
|
||||||
ch = self.compat['Nop']
|
ch = self.compat['Nop']
|
||||||
elsif (mod.type == MODULE_PAYLOAD)
|
elsif (mod.type == Msf::MODULE_PAYLOAD)
|
||||||
ch = self.compat['Payload']
|
ch = self.compat['Payload']
|
||||||
if self.respond_to?("target") and self.target and self.target['Payload'] and self.target['Payload']['Compat']
|
if self.respond_to?("target") and self.target and self.target['Payload'] and self.target['Payload']['Compat']
|
||||||
ch = ch.merge(self.target['Payload']['Compat'])
|
ch = ch.merge(self.target['Payload']['Compat'])
|
||||||
|
|
|
@ -18,42 +18,42 @@ module Msf::Module::Type
|
||||||
# Returns true if this module is an auxiliary module.
|
# Returns true if this module is an auxiliary module.
|
||||||
#
|
#
|
||||||
def auxiliary?
|
def auxiliary?
|
||||||
(type == MODULE_AUX)
|
(type == Msf::MODULE_AUX)
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns true if this module is an encoder module.
|
# Returns true if this module is an encoder module.
|
||||||
#
|
#
|
||||||
def encoder?
|
def encoder?
|
||||||
(type == MODULE_ENCODER)
|
(type == Msf::MODULE_ENCODER)
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns true if this module is an exploit module.
|
# Returns true if this module is an exploit module.
|
||||||
#
|
#
|
||||||
def exploit?
|
def exploit?
|
||||||
(type == MODULE_EXPLOIT)
|
(type == Msf::MODULE_EXPLOIT)
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns true if this module is a nop module.
|
# Returns true if this module is a nop module.
|
||||||
#
|
#
|
||||||
def nop?
|
def nop?
|
||||||
(type == MODULE_NOP)
|
(type == Msf::MODULE_NOP)
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns true if this module is a payload module.
|
# Returns true if this module is a payload module.
|
||||||
#
|
#
|
||||||
def payload?
|
def payload?
|
||||||
(type == MODULE_PAYLOAD)
|
(type == Msf::MODULE_PAYLOAD)
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns true if this module is an post-exploitation module.
|
# Returns true if this module is an post-exploitation module.
|
||||||
#
|
#
|
||||||
def post?
|
def post?
|
||||||
(type == MODULE_POST)
|
(type == Msf::MODULE_POST)
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -14,14 +14,14 @@ class Nop < Msf::Module
|
||||||
# Returns MODULE_NOP to indicate that this is a NOP module.
|
# Returns MODULE_NOP to indicate that this is a NOP module.
|
||||||
#
|
#
|
||||||
def self.type
|
def self.type
|
||||||
return MODULE_NOP
|
return Msf::MODULE_NOP
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns MODULE_NOP to indicate that this is a NOP module.
|
# Returns MODULE_NOP to indicate that this is a NOP module.
|
||||||
#
|
#
|
||||||
def type
|
def type
|
||||||
return MODULE_NOP
|
return Msf::MODULE_NOP
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -102,14 +102,14 @@ class Payload < Msf::Module
|
||||||
# Returns MODULE_PAYLOAD to indicate that this is a payload module.
|
# Returns MODULE_PAYLOAD to indicate that this is a payload module.
|
||||||
#
|
#
|
||||||
def self.type
|
def self.type
|
||||||
return MODULE_PAYLOAD
|
return Msf::MODULE_PAYLOAD
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns MODULE_PAYLOAD to indicate that this is a payload module.
|
# Returns MODULE_PAYLOAD to indicate that this is a payload module.
|
||||||
#
|
#
|
||||||
def type
|
def type
|
||||||
return MODULE_PAYLOAD
|
return Msf::MODULE_PAYLOAD
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -21,7 +21,7 @@ class PayloadSet < ModuleSet
|
||||||
# set class that has custom handling for payloads.
|
# set class that has custom handling for payloads.
|
||||||
#
|
#
|
||||||
def initialize
|
def initialize
|
||||||
super(MODULE_PAYLOAD)
|
super(Msf::MODULE_PAYLOAD)
|
||||||
|
|
||||||
# A hash of each of the payload types that holds an array
|
# A hash of each of the payload types that holds an array
|
||||||
# for all of the associated modules
|
# for all of the associated modules
|
||||||
|
|
|
@ -2364,17 +2364,17 @@ class Core
|
||||||
dispatcher = nil
|
dispatcher = nil
|
||||||
|
|
||||||
case mod.type
|
case mod.type
|
||||||
when MODULE_ENCODER
|
when Msf::MODULE_ENCODER
|
||||||
dispatcher = Msf::Ui::Console::CommandDispatcher::Encoder
|
dispatcher = Msf::Ui::Console::CommandDispatcher::Encoder
|
||||||
when MODULE_EXPLOIT
|
when Msf::MODULE_EXPLOIT
|
||||||
dispatcher = Msf::Ui::Console::CommandDispatcher::Exploit
|
dispatcher = Msf::Ui::Console::CommandDispatcher::Exploit
|
||||||
when MODULE_NOP
|
when Msf::MODULE_NOP
|
||||||
dispatcher = Msf::Ui::Console::CommandDispatcher::Nop
|
dispatcher = Msf::Ui::Console::CommandDispatcher::Nop
|
||||||
when MODULE_PAYLOAD
|
when Msf::MODULE_PAYLOAD
|
||||||
dispatcher = Msf::Ui::Console::CommandDispatcher::Payload
|
dispatcher = Msf::Ui::Console::CommandDispatcher::Payload
|
||||||
when MODULE_AUX
|
when Msf::MODULE_AUX
|
||||||
dispatcher = Msf::Ui::Console::CommandDispatcher::Auxiliary
|
dispatcher = Msf::Ui::Console::CommandDispatcher::Auxiliary
|
||||||
when MODULE_POST
|
when Msf::MODULE_POST
|
||||||
dispatcher = Msf::Ui::Console::CommandDispatcher::Post
|
dispatcher = Msf::Ui::Console::CommandDispatcher::Post
|
||||||
else
|
else
|
||||||
print_error("Unsupported module type: #{mod.type}")
|
print_error("Unsupported module type: #{mod.type}")
|
||||||
|
|
Loading…
Reference in New Issue