commenting
git-svn-id: file:///home/svn/incoming/trunk@2738 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
45073e184a
commit
41b656d45e
|
@ -264,14 +264,18 @@ protected
|
|||
return nil
|
||||
end
|
||||
|
||||
#
|
||||
# Convert individual key bytes into a single integer based on the
|
||||
# decoder's key size and packing requirements
|
||||
#
|
||||
def key_bytes_to_integer(key_bytes)
|
||||
return key_bytes.pack('C' + decoder_key_size.to_s).unpack(decoder_key_pack)[0]
|
||||
end
|
||||
|
||||
#
|
||||
# Convert an integer into the individual key bytes based on the
|
||||
# decoder's key size and packing requirements
|
||||
#
|
||||
def integer_to_key_bytes(integer)
|
||||
return [ integer.to_i ].pack(decoder_key_pack).unpack('C' + decoder_key_size.to_s)
|
||||
end
|
||||
|
|
|
@ -18,22 +18,37 @@ class Framework
|
|||
self.modules = ModuleManager.new
|
||||
end
|
||||
|
||||
#
|
||||
# Returns the module set for encoders
|
||||
#
|
||||
def encoders
|
||||
return modules.encoders
|
||||
end
|
||||
|
||||
#
|
||||
# Returns the module set for exploits
|
||||
#
|
||||
def exploits
|
||||
return modules.exploits
|
||||
end
|
||||
|
||||
#
|
||||
# Returns the module set for nops
|
||||
#
|
||||
def nops
|
||||
return modules.nops
|
||||
end
|
||||
|
||||
#
|
||||
# Returns the module set for payloads
|
||||
#
|
||||
def payloads
|
||||
return modules.payloads
|
||||
end
|
||||
|
||||
#
|
||||
# Returns the module set for recon modules
|
||||
#
|
||||
def recon
|
||||
return modules.recon
|
||||
end
|
||||
|
|
|
@ -36,6 +36,7 @@ class Msf::Module::Target
|
|||
self.platforms = Msf::Module::PlatformList.from_a(opts['Platform'])
|
||||
self.save_registers = opts['SaveRegisters']
|
||||
self.ret = opts['Ret']
|
||||
self.bruteforce = opts['Bruteforce']
|
||||
self.opts = opts
|
||||
end
|
||||
|
||||
|
@ -46,8 +47,21 @@ class Msf::Module::Target
|
|||
opts[key]
|
||||
end
|
||||
|
||||
attr_accessor :name, :platforms, :opts
|
||||
attr_accessor :ret, :save_registers
|
||||
#
|
||||
# Returns whether or not this is a bruteforce target, forces boolean
|
||||
# result.
|
||||
#
|
||||
def bruteforce?
|
||||
return (bruteforce != nil)
|
||||
end
|
||||
|
||||
attr_reader :name, :platforms, :opts, :ret, :save_registers
|
||||
attr_reader :bruteforce
|
||||
|
||||
protected
|
||||
|
||||
attr_writer :name, :platforms, :opts, :ret, :save_registers
|
||||
attr_writer :bruteforce
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -130,10 +130,12 @@ class PayloadSet < ModuleSet
|
|||
}
|
||||
end
|
||||
|
||||
#
|
||||
# Called when a new payload module class is loaded up. For the payload
|
||||
# set we simply create an instance of the class and do some magic to figure
|
||||
# out if it's a single, stager, or stage. Depending on which it is, we
|
||||
# add it to the appropriate list
|
||||
#
|
||||
def add_module(pmodule, name)
|
||||
if (md = name.match(/^(singles|stagers|stages)#{File::SEPARATOR}(.*)$/))
|
||||
name = md[2]
|
||||
|
@ -212,23 +214,31 @@ class PayloadSet < ModuleSet
|
|||
|
||||
protected
|
||||
|
||||
#
|
||||
# Return the hash of single payloads
|
||||
#
|
||||
def _singles
|
||||
return payload_type_modules[Payload::Type::Single] || {}
|
||||
end
|
||||
|
||||
#
|
||||
# Return the hash of stager payloads
|
||||
#
|
||||
def _stagers
|
||||
return payload_type_modules[Payload::Type::Stager] || {}
|
||||
end
|
||||
|
||||
#
|
||||
# Return the hash of stage payloads
|
||||
#
|
||||
def _stages
|
||||
return payload_type_modules[Payload::Type::Stage] || {}
|
||||
end
|
||||
|
||||
#
|
||||
# Builds a duplicate, extended version of the Payload base
|
||||
# class using the supplied modules.
|
||||
#
|
||||
def build_payload(*modules)
|
||||
klass = Class.new(Payload)
|
||||
|
||||
|
|
Loading…
Reference in New Issue