more docs
git-svn-id: file:///home/svn/incoming/trunk@2974 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
81c8cf3104
commit
712f7ef776
|
@ -26,12 +26,20 @@ class Framework
|
|||
# should be tied to the framework, such as modules.
|
||||
#
|
||||
module Offspring
|
||||
|
||||
#
|
||||
# A reference to the framework instance from which this offspring was
|
||||
# derived.
|
||||
#
|
||||
attr_accessor :framework
|
||||
end
|
||||
|
||||
require 'msf/core/module_manager'
|
||||
require 'msf/core/session_manager'
|
||||
|
||||
#
|
||||
# Creates an instance of the framework context.
|
||||
#
|
||||
def initialize()
|
||||
self.events = EventDispatcher.new
|
||||
self.modules = ModuleManager.new(self)
|
||||
|
@ -41,14 +49,14 @@ class Framework
|
|||
end
|
||||
|
||||
#
|
||||
# Returns the module set for encoders
|
||||
# Returns the module set for encoders.
|
||||
#
|
||||
def encoders
|
||||
return modules.encoders
|
||||
end
|
||||
|
||||
#
|
||||
# Returns the module set for exploits
|
||||
# Returns the module set for exploits.
|
||||
#
|
||||
def exploits
|
||||
return modules.exploits
|
||||
|
@ -75,19 +83,38 @@ class Framework
|
|||
return modules.recon
|
||||
end
|
||||
|
||||
#
|
||||
# Event management interface for registering event handler subscribers and
|
||||
# for interacting with the correlation engine.
|
||||
#
|
||||
attr_reader :events
|
||||
#
|
||||
# Module manager that contains information about all loaded modules,
|
||||
# regardless of type.
|
||||
#
|
||||
attr_reader :modules
|
||||
#
|
||||
# Session manager that tracks sessions associated with this framework
|
||||
# instance over the course of their lifetime.
|
||||
#
|
||||
attr_reader :sessions
|
||||
#
|
||||
# The global framework datastore that can be used by modules.
|
||||
#
|
||||
attr_reader :datastore
|
||||
#
|
||||
# Background job management specific to things spawned from this instance
|
||||
# of the framework.
|
||||
#
|
||||
attr_reader :jobs
|
||||
|
||||
protected
|
||||
|
||||
attr_writer :events
|
||||
attr_writer :modules
|
||||
attr_writer :sessions
|
||||
attr_writer :datastore
|
||||
attr_writer :jobs
|
||||
attr_writer :events # :nodoc:
|
||||
attr_writer :modules # :nodoc:
|
||||
attr_writer :sessions # :nodoc:
|
||||
attr_writer :datastore # :nodoc:
|
||||
attr_writer :jobs # :nodoc:
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ protected
|
|||
session_waiter_event.notify(session)
|
||||
end
|
||||
|
||||
attr_accessor :session_waiter_event
|
||||
attr_accessor :session_waiter_event # :nodoc:
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -60,14 +60,14 @@ class PayloadSet < ModuleSet
|
|||
# Performs custom filtering during each_module enumeration. This allows us
|
||||
# to filter out certain stagers as necessary.
|
||||
#
|
||||
# TODO: stager-based customf iltering
|
||||
#
|
||||
def each_module_filter(opts, name, mod)
|
||||
return false
|
||||
end
|
||||
|
||||
# Build the actual hash of alias names based on all the permutations
|
||||
# of singles, stagers, and stages
|
||||
#
|
||||
# This method builds the hash of alias names based on all the permutations
|
||||
# of singles, stagers, and stages.
|
||||
#
|
||||
def recalculate
|
||||
# Reset the current hash associations
|
||||
self.each_key { |key|
|
||||
|
@ -105,10 +105,8 @@ class PayloadSet < ModuleSet
|
|||
if ((stager_arch) and
|
||||
(stage_arch) and
|
||||
((stager_arch & stage_arch).empty?))
|
||||
dlog("Stager #{stager_name} and stage #{stage_name} have incompatible architectures:",
|
||||
dlog("Stager #{stager_name} and stage #{stage_name} have incompatible architectures: #{stager_arch.join} - #{stage_arch.join}",
|
||||
'core', LEV_3)
|
||||
dlog(" Stager: #{stager_arch.join}.", 'core', LEV_3)
|
||||
dlog(" Stage: #{stage_arch.join}.", 'core', LEV_3)
|
||||
next
|
||||
end
|
||||
|
||||
|
@ -116,10 +114,8 @@ class PayloadSet < ModuleSet
|
|||
if ((stager_platform) and
|
||||
(stage_platform) and
|
||||
(stager_platform & stage_platform).empty?)
|
||||
dlog("Stager #{stager_name} and stage #{stage_name} have incompatible platforms:",
|
||||
dlog("Stager #{stager_name} and stage #{stage_name} have incompatible platforms: #{stager_platform.names} - #{stage_platform.names}",
|
||||
'core', LEV_3)
|
||||
dlog(" Stager: #{stager_platform.names}.", 'core', LEV_3)
|
||||
dlog(" Stage: #{stage_platform.names}.", 'core', LEV_3)
|
||||
next
|
||||
end
|
||||
|
||||
|
@ -164,10 +160,10 @@ 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
|
||||
# This method is 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, file_path = nil)
|
||||
if (md = name.match(/^(singles|stagers|stages)#{File::SEPARATOR}(.*)$/))
|
||||
|
@ -210,7 +206,8 @@ class PayloadSet < ModuleSet
|
|||
end
|
||||
|
||||
#
|
||||
# Adds a single payload to the set and adds it to the singles hash
|
||||
# This method adds a single payload to the set and adds it to the singles
|
||||
# hash.
|
||||
#
|
||||
def add_single(p, name)
|
||||
p.framework = framework
|
||||
|
@ -228,8 +225,8 @@ class PayloadSet < ModuleSet
|
|||
end
|
||||
|
||||
#
|
||||
# Adds a stage payload to the set and adds it to the stages hash
|
||||
# using the supplied handler type.
|
||||
# This method adds a stage payload to the set and adds it to the stages
|
||||
# hash using the supplied handler type.
|
||||
#
|
||||
def add_stage(p, full_name, stage_name, handler_type)
|
||||
p.framework = framework
|
||||
|
@ -264,7 +261,18 @@ class PayloadSet < ModuleSet
|
|||
self._instances[name]
|
||||
end
|
||||
|
||||
attr_reader :stages, :singles, :sizes
|
||||
#
|
||||
# The list of stages that have been loaded.
|
||||
#
|
||||
attr_reader :stages
|
||||
#
|
||||
# The list of stagers that have been loaded.
|
||||
#
|
||||
attr_reader :singles
|
||||
#
|
||||
# The sizes of all the built payloads thus far.
|
||||
#
|
||||
attr_reader :sizes
|
||||
|
||||
protected
|
||||
|
||||
|
@ -306,9 +314,9 @@ protected
|
|||
return klass
|
||||
end
|
||||
|
||||
attr_accessor :manager, :payload_type_modules
|
||||
attr_writer :stages, :singles, :sizes
|
||||
attr_accessor :_instances
|
||||
attr_accessor :manager, :payload_type_modules # :nodoc:
|
||||
attr_writer :stages, :singles, :sizes # :nodoc:
|
||||
attr_accessor :_instances # :nodoc:
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue