Redesign constants
parent
160147b370
commit
cbc1bd9966
|
@ -5,50 +5,24 @@ require 'msf/core/exploit/exe'
|
|||
|
||||
module Msf
|
||||
|
||||
###
|
||||
#
|
||||
# This mixin provides an interface to generating cmdstagers
|
||||
#
|
||||
###
|
||||
module Exploit::CmdStager
|
||||
|
||||
include Msf::Exploit::EXE
|
||||
|
||||
# Constant for stagers - used when creating an stager instance.
|
||||
STAGERS = {
|
||||
:bourne => {
|
||||
:klass => Rex::Exploitation::CmdStagerBourne,
|
||||
:decoder => false
|
||||
},
|
||||
:debug_asm => {
|
||||
:klass => Rex::Exploitation::CmdStagerDebugAsm,
|
||||
:decoder => true
|
||||
},
|
||||
:debug_write => {
|
||||
:klass => Rex::Exploitation::CmdStagerDebugWrite,
|
||||
:decoder => true
|
||||
},
|
||||
:echo => {
|
||||
:klass => Rex::Exploitation::CmdStagerEcho,
|
||||
:decoder => false
|
||||
},
|
||||
:printf => {
|
||||
:klass => Rex::Exploitation::CmdStagerPrintf,
|
||||
:decoder => false
|
||||
},
|
||||
:vbs => {
|
||||
:klass => Rex::Exploitation::CmdStagerVBS,
|
||||
:decoder => true
|
||||
},
|
||||
:vbs_adodb => {
|
||||
:klass => Rex::Exploitation::CmdStagerVBS,
|
||||
:decoder => true
|
||||
},
|
||||
:tftp => {
|
||||
:klass => Rex::Exploitation::CmdStagerTFTP,
|
||||
:decoder => false
|
||||
}
|
||||
:bourne => Rex::Exploitation::CmdStagerBourne,
|
||||
:debug_asm => Rex::Exploitation::CmdStagerDebugAsm,
|
||||
:debug_write => Rex::Exploitation::CmdStagerDebugWrite,
|
||||
:echo => Rex::Exploitation::CmdStagerEcho,
|
||||
:printf => Rex::Exploitation::CmdStagerPrintf,
|
||||
:vbs => Rex::Exploitation::CmdStagerVBS,
|
||||
:vbs_adodb => Rex::Exploitation::CmdStagerVBS,
|
||||
:tftp => Rex::Exploitation::CmdStagerTFTP
|
||||
}
|
||||
|
||||
# Constant for decoders - used when checking the default flavor decoder.
|
||||
DECODERS = {
|
||||
:debug_asm => File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "debug_asm"),
|
||||
:debug_write => File.join(Msf::Config.install_root, "data", "exploits", "cmdstager", "debug_write"),
|
||||
|
@ -192,7 +166,7 @@ module Exploit::CmdStager
|
|||
#
|
||||
# @return [Rex::Exploitation::CmdStagerBase] The cmd stager to use.
|
||||
def create_stager
|
||||
STAGERS[flavor][:klass].new(exe)
|
||||
STAGERS[flavor].new(exe)
|
||||
end
|
||||
|
||||
# Returns the default decoder stub for the input flavor.
|
||||
|
@ -205,13 +179,12 @@ module Exploit::CmdStager
|
|||
DECODERS[f]
|
||||
end
|
||||
|
||||
# Returns the better cmd stager decoder stub to use for the input flavor.
|
||||
# Answers if the input flavor needs a decoder stub.
|
||||
#
|
||||
# @param f [Symbol] the input flavor.
|
||||
# @return [Symbol] the decoder to use.
|
||||
# @return [nil] if there isn't a best decoder to use for the current flavor.
|
||||
# @return [Boolean] true if the flavor needs a decoder, false otherwise.
|
||||
def decoder_required?(f)
|
||||
STAGERS[f][:decoder]
|
||||
!DECODERS[f].nil?
|
||||
end
|
||||
|
||||
# Selects the correct cmd stager decoder to use based on three rules: (1) use
|
||||
|
@ -307,5 +280,4 @@ module Exploit::CmdStager
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue