2005-07-09 21:18:49 +00:00
|
|
|
require 'msf/core'
|
2005-05-21 17:57:00 +00:00
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# Framework
|
|
|
|
# ---------
|
|
|
|
#
|
|
|
|
# This class is the primary context that modules, scripts, and user
|
|
|
|
# interfaces interact with. It ties everything together.
|
|
|
|
#
|
|
|
|
###
|
|
|
|
class Framework
|
2005-07-14 06:34:58 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Versioning information
|
|
|
|
#
|
|
|
|
Major = 3
|
|
|
|
Minor = 0
|
|
|
|
Version = "#{Major}.#{Minor}"
|
|
|
|
Revision = "$Revision$"
|
2005-07-13 18:06:12 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Mixin meant to be included into all classes that can have instances that
|
|
|
|
# should be tied to the framework, such as modules.
|
|
|
|
#
|
|
|
|
module Offspring
|
|
|
|
attr_accessor :framework
|
|
|
|
end
|
|
|
|
|
|
|
|
require 'msf/core/module_manager'
|
2005-07-16 08:12:58 +00:00
|
|
|
require 'msf/core/session_manager'
|
2005-05-21 17:57:00 +00:00
|
|
|
|
|
|
|
def initialize()
|
2005-07-14 06:34:58 +00:00
|
|
|
self.events = EventDispatcher.new
|
|
|
|
self.modules = ModuleManager.new(self)
|
2005-07-16 08:12:58 +00:00
|
|
|
self.sessions = SessionManager.new(self)
|
2005-07-14 06:34:58 +00:00
|
|
|
self.datastore = DataStore.new
|
2005-05-22 07:14:16 +00:00
|
|
|
end
|
|
|
|
|
2005-07-12 14:32:44 +00:00
|
|
|
#
|
|
|
|
# Returns the module set for encoders
|
|
|
|
#
|
2005-05-22 07:14:16 +00:00
|
|
|
def encoders
|
|
|
|
return modules.encoders
|
|
|
|
end
|
|
|
|
|
2005-07-12 14:32:44 +00:00
|
|
|
#
|
|
|
|
# Returns the module set for exploits
|
|
|
|
#
|
2005-05-22 07:25:15 +00:00
|
|
|
def exploits
|
|
|
|
return modules.exploits
|
|
|
|
end
|
|
|
|
|
2005-07-12 14:32:44 +00:00
|
|
|
#
|
|
|
|
# Returns the module set for nops
|
|
|
|
#
|
2005-05-22 07:14:16 +00:00
|
|
|
def nops
|
|
|
|
return modules.nops
|
|
|
|
end
|
|
|
|
|
2005-07-12 14:32:44 +00:00
|
|
|
#
|
|
|
|
# Returns the module set for payloads
|
|
|
|
#
|
2005-05-22 07:25:15 +00:00
|
|
|
def payloads
|
|
|
|
return modules.payloads
|
2005-05-22 07:14:16 +00:00
|
|
|
end
|
2005-05-21 17:57:00 +00:00
|
|
|
|
2005-07-12 14:32:44 +00:00
|
|
|
#
|
|
|
|
# Returns the module set for recon modules
|
|
|
|
#
|
2005-05-22 07:14:16 +00:00
|
|
|
def recon
|
|
|
|
return modules.recon
|
2005-05-21 17:57:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
attr_reader :events
|
2005-05-22 07:14:16 +00:00
|
|
|
attr_reader :modules
|
2005-07-16 08:12:58 +00:00
|
|
|
attr_reader :sessions
|
2005-07-14 06:34:58 +00:00
|
|
|
attr_reader :datastore
|
2005-05-21 17:57:00 +00:00
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
attr_writer :events
|
2005-05-22 07:14:16 +00:00
|
|
|
attr_writer :modules
|
2005-07-16 08:12:58 +00:00
|
|
|
attr_writer :sessions
|
2005-07-14 06:34:58 +00:00
|
|
|
attr_writer :datastore
|
2005-05-21 17:57:00 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|