2012-06-29 05:18:28 +00:00
|
|
|
# -*- coding: binary -*-
|
2005-07-09 21:18:49 +00:00
|
|
|
require 'msf/core'
|
2010-01-15 00:32:48 +00:00
|
|
|
require 'msf/core/module'
|
2005-05-21 17:57:00 +00:00
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
2005-06-04 18:55:20 +00:00
|
|
|
###
|
|
|
|
#
|
2005-11-02 16:49:45 +00:00
|
|
|
# This module exposes an interface that is used when wanting to receive
|
|
|
|
# notifications about events pertaining to exploitation.
|
2005-06-04 18:55:20 +00:00
|
|
|
#
|
|
|
|
###
|
2005-10-30 22:20:29 +00:00
|
|
|
module ExploitEvent
|
2005-05-21 17:57:00 +00:00
|
|
|
|
2005-06-05 00:03:23 +00:00
|
|
|
#
|
2005-11-02 16:49:45 +00:00
|
|
|
# This method is called when an exploit succeeds.
|
2005-06-05 00:03:23 +00:00
|
|
|
#
|
2005-10-30 22:20:29 +00:00
|
|
|
def on_exploit_success(exploit, session)
|
2005-05-21 17:57:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2005-06-04 18:55:20 +00:00
|
|
|
###
|
|
|
|
#
|
|
|
|
# The exploit class acts as the base class for all exploit modules. It
|
|
|
|
# provides a common interface for interacting with exploits at the most basic
|
|
|
|
# level.
|
|
|
|
#
|
|
|
|
###
|
|
|
|
class Exploit < Msf::Module
|
|
|
|
|
2013-05-22 05:11:33 +00:00
|
|
|
require 'msf/core/post'
|
|
|
|
require 'msf/core/exploit/local'
|
2012-06-10 08:15:48 +00:00
|
|
|
|
|
|
|
##
|
2013-03-08 00:20:08 +00:00
|
|
|
# Exceptions
|
2012-06-10 08:15:48 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
# Indicate that the exploit should abort because it has completed
|
|
|
|
class Complete < RuntimeError
|
|
|
|
end
|
|
|
|
|
|
|
|
# Indicate that the exploit should abort because it has failed
|
|
|
|
class Failed < RuntimeError
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2005-11-15 15:11:43 +00:00
|
|
|
##
|
|
|
|
#
|
|
|
|
# Default compatibility settings for exploit modules.
|
|
|
|
#
|
|
|
|
##
|
2005-10-19 01:48:10 +00:00
|
|
|
module CompatDefaults
|
|
|
|
#
|
|
|
|
# Default compatibility specifications for payloads
|
|
|
|
#
|
2010-03-17 18:41:09 +00:00
|
|
|
Payload =
|
|
|
|
{
|
2007-09-30 17:54:15 +00:00
|
|
|
# Support reverse, bind, and noconn connection types
|
2005-10-19 01:48:10 +00:00
|
|
|
# for all exploits unless expressly disabled.
|
2007-09-30 17:54:15 +00:00
|
|
|
'ConnectionType' => 'reverse bind noconn none tunnel',
|
2005-10-19 01:48:10 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2005-11-15 15:11:43 +00:00
|
|
|
##
|
2005-06-04 22:26:42 +00:00
|
|
|
#
|
|
|
|
# The various check codes that can be returned from the ``check'' routine.
|
|
|
|
#
|
2005-11-15 15:11:43 +00:00
|
|
|
##
|
2005-06-04 22:26:42 +00:00
|
|
|
module CheckCode
|
2005-10-19 03:20:20 +00:00
|
|
|
|
2010-10-15 12:24:17 +00:00
|
|
|
#
|
|
|
|
# Can't tell if the target is exploitable or not.
|
|
|
|
#
|
2012-06-10 08:15:48 +00:00
|
|
|
Unknown = [ 'unknown', "Cannot reliably check exploitability."]
|
2010-10-15 12:24:17 +00:00
|
|
|
|
2005-10-19 03:20:20 +00:00
|
|
|
#
|
|
|
|
# The target is safe and is therefore not exploitable.
|
|
|
|
#
|
2012-06-10 08:15:48 +00:00
|
|
|
Safe = [ 'safe', "The target is not exploitable." ]
|
2005-10-19 03:20:20 +00:00
|
|
|
|
|
|
|
#
|
2007-02-11 03:16:08 +00:00
|
|
|
# The target is running the service in question but may not be
|
2005-10-19 03:20:20 +00:00
|
|
|
# exploitable.
|
|
|
|
#
|
2012-06-10 08:15:48 +00:00
|
|
|
Detected = [ 'detected', "The target service is running, but could not be validated." ]
|
2005-10-19 03:20:20 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The target appears to be vulnerable.
|
|
|
|
#
|
2012-06-10 08:15:48 +00:00
|
|
|
Appears = [ 'appears', "The target appears to be vulnerable." ]
|
2005-10-19 03:20:20 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The target is vulnerable.
|
|
|
|
#
|
2012-06-10 08:15:48 +00:00
|
|
|
Vulnerable = [ 'vulnerable', "The target is vulnerable." ]
|
2005-10-19 03:20:20 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The exploit does not support the check method.
|
|
|
|
#
|
2012-06-10 08:15:48 +00:00
|
|
|
Unsupported = [ 'unsupported', "This exploit does not support check." ]
|
|
|
|
end
|
|
|
|
|
2005-06-04 22:26:42 +00:00
|
|
|
#
|
|
|
|
# The various basic types of exploits
|
|
|
|
#
|
|
|
|
module Type
|
2005-10-19 03:20:20 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Indicates that the exploit is a remote exploit.
|
|
|
|
#
|
2005-06-04 22:26:42 +00:00
|
|
|
Remote = "remote"
|
2005-10-19 03:20:20 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Indicates that the exploit is a local exploit.
|
|
|
|
#
|
2005-06-04 22:26:42 +00:00
|
|
|
Local = "local"
|
2005-10-19 03:20:20 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Indicates that the exploit can work anywhere it damn pleases.
|
|
|
|
#
|
2005-06-04 22:26:42 +00:00
|
|
|
Omni = "omnipresent"
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
2005-06-04 22:39:12 +00:00
|
|
|
# The types of stances an exploit can take, such as passive or aggressive.
|
|
|
|
# Stances indicate whether or not the exploit triggers the exploit without
|
|
|
|
# waiting for one or more conditions to be met (aggressive) or whether it
|
|
|
|
# must wait for certain conditions to be satisfied before the exploit can
|
|
|
|
# be initiated (passive)
|
2005-06-04 22:26:42 +00:00
|
|
|
#
|
|
|
|
module Stance
|
2005-10-19 03:20:20 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Used to indicate that an exploit takes an aggressive stance. This
|
|
|
|
# means that the exploit proactively triggers a vulnerability.
|
|
|
|
#
|
2010-03-17 18:41:09 +00:00
|
|
|
Aggressive = "aggressive"
|
2005-10-19 03:20:20 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Used to indicate that an exploit takes a passive stance. This means
|
|
|
|
# that the exploit waits for interaction from a client or other entity
|
|
|
|
# before being able to trigger the vulnerability.
|
|
|
|
#
|
2005-06-04 22:39:12 +00:00
|
|
|
Passive = "passive"
|
2005-06-04 22:26:42 +00:00
|
|
|
end
|
|
|
|
|
2005-07-12 22:33:46 +00:00
|
|
|
###
|
|
|
|
#
|
|
|
|
# The remote exploit class is a specialization of the exploit module class
|
|
|
|
# that is geared toward exploits that are performed against targets other than
|
|
|
|
# the local machine. This typically implies exploiting other machines via a
|
|
|
|
# network connection, though it is not limited to this scope.
|
|
|
|
#
|
|
|
|
###
|
|
|
|
class Remote < Exploit
|
2005-10-19 03:20:20 +00:00
|
|
|
|
2005-11-24 18:50:33 +00:00
|
|
|
#
|
|
|
|
# Initializes the socket array.
|
|
|
|
#
|
|
|
|
def initialize(info)
|
|
|
|
super
|
|
|
|
|
|
|
|
self.sockets = Array.new
|
|
|
|
end
|
|
|
|
|
2005-10-19 03:20:20 +00:00
|
|
|
#
|
|
|
|
# Returns the fact that this exploit is a remote exploit.
|
|
|
|
#
|
2005-07-12 22:33:46 +00:00
|
|
|
def exploit_type
|
|
|
|
Exploit::Type::Remote
|
|
|
|
end
|
2005-11-24 18:50:33 +00:00
|
|
|
|
2005-12-15 04:46:52 +00:00
|
|
|
#
|
|
|
|
# Adds a socket to the list of sockets opened by this exploit.
|
|
|
|
#
|
|
|
|
def add_socket(sock)
|
|
|
|
self.sockets << sock
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Removes a socket from the list of sockets.
|
|
|
|
#
|
|
|
|
def remove_socket(sock)
|
|
|
|
self.sockets.delete(sock)
|
|
|
|
end
|
|
|
|
|
2005-11-24 18:50:33 +00:00
|
|
|
#
|
|
|
|
# This method is called once a new session has been created on behalf of
|
|
|
|
# this exploit instance and all socket connections created by this
|
|
|
|
# exploit should be closed.
|
|
|
|
#
|
|
|
|
def abort_sockets
|
|
|
|
sockets.delete_if { |sock|
|
|
|
|
|
|
|
|
begin
|
2010-05-01 16:26:24 +00:00
|
|
|
sock.close
|
|
|
|
rescue ::Exception
|
2005-11-24 18:50:33 +00:00
|
|
|
end
|
|
|
|
true
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
#
|
|
|
|
# The list of sockets established by this exploit.
|
|
|
|
#
|
|
|
|
attr_accessor :sockets
|
|
|
|
|
2005-07-12 22:33:46 +00:00
|
|
|
end
|
|
|
|
|
2005-11-26 00:04:26 +00:00
|
|
|
#
|
2009-10-23 04:32:26 +00:00
|
|
|
# Load all of the exploit mixins
|
2005-11-26 00:04:26 +00:00
|
|
|
#
|
2009-10-23 04:32:26 +00:00
|
|
|
require 'msf/core/exploit/mixins'
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2006-10-16 08:06:52 +00:00
|
|
|
#
|
|
|
|
# Returns an array of all of the exploit mixins. Lame algorithm right now.
|
|
|
|
# We search the Msf::Exploit namespace for all modules that do not have any
|
|
|
|
# constants in them. In the future we can replace this with a better
|
|
|
|
# algorithm. It's just important that it returns an array of all of the
|
|
|
|
# mixin modules.
|
|
|
|
#
|
2013-05-24 19:13:10 +00:00
|
|
|
# @return [Array]
|
2006-10-16 08:06:52 +00:00
|
|
|
def self.mixins
|
|
|
|
mixins = []
|
2010-03-17 18:41:09 +00:00
|
|
|
wl = [ Msf::Exploit ]
|
2006-10-16 08:06:52 +00:00
|
|
|
visited = {}
|
|
|
|
|
|
|
|
until wl.length == 0
|
|
|
|
wl.delete_if { |mod|
|
|
|
|
mod.constants.each { |const|
|
|
|
|
child = mod.const_get(const)
|
|
|
|
|
|
|
|
next if child.to_s !~ /^Msf::Exploit/
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2006-10-16 08:06:52 +00:00
|
|
|
next if visited[child]
|
2010-03-17 18:41:09 +00:00
|
|
|
|
|
|
|
next if child.kind_of?(::Module) == false
|
2006-10-16 08:06:52 +00:00
|
|
|
|
|
|
|
visited[child] = true
|
|
|
|
|
|
|
|
if child.constants.length > 0
|
|
|
|
wl << child
|
|
|
|
else
|
|
|
|
mixins << child
|
|
|
|
end
|
|
|
|
}
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2006-10-16 08:06:52 +00:00
|
|
|
true
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
return mixins
|
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2005-06-05 00:03:23 +00:00
|
|
|
#
|
2005-10-19 03:20:20 +00:00
|
|
|
# Creates an instance of the exploit module. Mad skillz.
|
2005-06-05 00:03:23 +00:00
|
|
|
#
|
|
|
|
def initialize(info = {})
|
2006-01-03 04:43:40 +00:00
|
|
|
|
|
|
|
# Ghetto compat mirroring for payload compatibilities. This mirrors
|
|
|
|
#
|
|
|
|
# Payload => Compat => xyz
|
|
|
|
#
|
|
|
|
# to
|
|
|
|
#
|
|
|
|
# Compat => Payload => xyz
|
|
|
|
if (info['Payload'] and info['Payload']['Compat'])
|
|
|
|
info['Compat'] = Hash.new if (info['Compat'] == nil)
|
|
|
|
info['Compat']['Payload'] = Hash.new if (info['Compat']['Payload'] == nil)
|
|
|
|
info['Compat']['Payload'].update(info['Payload']['Compat'])
|
|
|
|
end
|
|
|
|
|
|
|
|
# Call the parent constructor after making any necessary modifications
|
|
|
|
# to the information hash.
|
2005-06-05 00:03:23 +00:00
|
|
|
super(info)
|
2005-06-05 04:27:57 +00:00
|
|
|
|
|
|
|
self.targets = Rex::Transformer.transform(info['Targets'], Array,
|
|
|
|
[ Target ], 'Targets')
|
2005-07-11 15:34:31 +00:00
|
|
|
self.default_target = info['DefaultTarget']
|
2005-07-15 23:46:05 +00:00
|
|
|
self.payload_info = info['Payload'] || {}
|
2012-06-10 08:15:48 +00:00
|
|
|
self.successful = false
|
2005-11-27 18:42:44 +00:00
|
|
|
self.session_count = 0
|
2006-07-29 22:37:39 +00:00
|
|
|
self.active_timeout = 120
|
2012-06-10 08:15:48 +00:00
|
|
|
self.fail_reason = Failure::None
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2006-07-29 22:37:39 +00:00
|
|
|
if (info['Payload'] and info['Payload']['ActiveTimeout'])
|
|
|
|
self.active_timeout = info['Payload']['ActiveTimeout'].to_i
|
|
|
|
end
|
2006-10-17 00:16:04 +00:00
|
|
|
|
|
|
|
# All exploits can increase the delay when waiting for a session.
|
|
|
|
# However, this only applies to aggressive exploits.
|
|
|
|
if aggressive?
|
|
|
|
register_advanced_options(
|
|
|
|
[
|
|
|
|
OptInt.new('WfsDelay', [ false, "Additional delay when waiting for a session", 0 ])
|
|
|
|
], Msf::Exploit)
|
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2007-08-31 04:01:30 +00:00
|
|
|
# Allow all exploits to leverage context keyed encoding
|
|
|
|
register_advanced_options(
|
|
|
|
[
|
|
|
|
OptBool.new('EnableContextEncoding', [ false, "Use transient context when encoding payloads", false ]),
|
|
|
|
OptPath.new('ContextInformationFile', [ false, "The information file that contains context information", nil ])
|
|
|
|
], Msf::Exploit)
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2009-09-24 20:36:30 +00:00
|
|
|
# Allow all exploits to disable their payload handlers
|
|
|
|
register_advanced_options(
|
|
|
|
[
|
|
|
|
OptBool.new('DisablePayloadHandler', [ false, "Disable the handler code for the selected payload", false ])
|
2010-03-17 18:41:09 +00:00
|
|
|
], Msf::Exploit)
|
2005-06-05 00:03:23 +00:00
|
|
|
end
|
|
|
|
|
2005-06-04 22:26:42 +00:00
|
|
|
##
|
|
|
|
#
|
2005-06-05 00:03:23 +00:00
|
|
|
# Core exploit interface
|
|
|
|
#
|
|
|
|
# These are the methods that exploits will override to perform various
|
|
|
|
# tasks, such as checking a target to see if it's vulnerable, automatically
|
|
|
|
# selecting a target, or performing an exploit.
|
2005-06-04 22:26:42 +00:00
|
|
|
#
|
|
|
|
##
|
|
|
|
|
2005-06-04 22:39:12 +00:00
|
|
|
#
|
|
|
|
# Kicks off the actual exploit. Prior to this call, the framework will
|
|
|
|
# have validated the data store using the options associated with this
|
|
|
|
# exploit module. It will also pre-generate the desired payload, though
|
2010-03-17 18:41:09 +00:00
|
|
|
# exploits can re-generate the payload if necessary.
|
2005-10-19 03:20:20 +00:00
|
|
|
#
|
|
|
|
# This method is designed to be overriden by exploit modules.
|
2005-06-04 22:39:12 +00:00
|
|
|
#
|
|
|
|
def exploit
|
|
|
|
end
|
|
|
|
|
2006-09-17 00:39:23 +00:00
|
|
|
#
|
2009-10-28 18:04:50 +00:00
|
|
|
# Performs last-minute sanity checking of auxiliary parameters. This method
|
2006-09-17 00:39:23 +00:00
|
|
|
# is called during automated exploitation attempts and allows an
|
2009-10-28 18:04:50 +00:00
|
|
|
# auxiliary module to filter bad attempts, obtain more information, and choose
|
|
|
|
# better parameters based on the available data. Returning anything that
|
|
|
|
# evaluates to "false" will cause this specific auxiliary attempt to
|
2006-09-17 00:39:23 +00:00
|
|
|
# be skipped. This method can and will change datastore values and
|
|
|
|
# may interact with the backend database.
|
|
|
|
#
|
|
|
|
def autofilter
|
|
|
|
true
|
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2009-10-28 18:04:50 +00:00
|
|
|
#
|
2010-03-17 18:41:09 +00:00
|
|
|
# Provides a list of ports that can be used for matching this module
|
2009-10-28 18:04:50 +00:00
|
|
|
# against target systems.
|
|
|
|
#
|
|
|
|
def autofilter_ports
|
|
|
|
@autofilter_ports || []
|
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2009-10-28 18:04:50 +00:00
|
|
|
#
|
2010-03-17 18:41:09 +00:00
|
|
|
# Provides a list of services that can be used for matching this module
|
2009-10-28 18:04:50 +00:00
|
|
|
# against target systems.
|
2010-03-17 18:41:09 +00:00
|
|
|
#
|
2009-10-28 18:04:50 +00:00
|
|
|
def autofilter_services
|
2010-03-17 18:41:09 +00:00
|
|
|
@autofilter_services || []
|
2009-10-28 18:04:50 +00:00
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2009-10-28 18:04:50 +00:00
|
|
|
#
|
|
|
|
# Adds a port into the list of ports
|
|
|
|
#
|
|
|
|
def register_autofilter_ports(ports=[])
|
|
|
|
@autofilter_ports ||= []
|
|
|
|
@autofilter_ports << ports
|
|
|
|
@autofilter_ports.flatten!
|
|
|
|
@autofilter_ports.uniq!
|
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2009-10-28 18:04:50 +00:00
|
|
|
def register_autofilter_services(services=[])
|
|
|
|
@autofilter_services ||= []
|
|
|
|
@autofilter_services << services
|
|
|
|
@autofilter_services.flatten!
|
2010-03-17 18:41:09 +00:00
|
|
|
@autofilter_services.uniq!
|
2009-10-28 18:04:50 +00:00
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2005-07-15 23:46:05 +00:00
|
|
|
#
|
|
|
|
# Prepares the module for exploitation, initializes any state, and starts
|
|
|
|
# the payload handler.
|
|
|
|
#
|
|
|
|
def setup
|
2005-12-31 18:26:34 +00:00
|
|
|
# Reset the session counts to zero.
|
|
|
|
reset_session_counts
|
|
|
|
|
2009-09-24 20:36:30 +00:00
|
|
|
return if not payload_instance
|
|
|
|
return if not handler_enabled?
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2009-09-24 20:36:30 +00:00
|
|
|
# Configure the payload handler
|
|
|
|
payload_instance.exploit_config = {
|
|
|
|
'active_timeout' => self.active_timeout
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set up the payload handlers
|
|
|
|
payload_instance.setup_handler
|
|
|
|
|
|
|
|
# Start the payload handler
|
|
|
|
payload_instance.start_handler
|
|
|
|
|
2005-07-15 23:46:05 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Performs any cleanup that may be necessary, such as disconnecting
|
|
|
|
# connections and any other such fun things. If a payload is active then
|
|
|
|
# its handler cleanup routines are called as well.
|
|
|
|
#
|
|
|
|
def cleanup
|
2009-09-24 20:36:30 +00:00
|
|
|
if (payload_instance and handler_enabled?)
|
2005-07-15 23:46:05 +00:00
|
|
|
payload_instance.cleanup_handler
|
|
|
|
end
|
2011-06-12 18:32:27 +00:00
|
|
|
self.abort_sockets if self.respond_to?(:abort_sockets)
|
2005-07-15 23:46:05 +00:00
|
|
|
end
|
|
|
|
|
2005-07-13 18:06:12 +00:00
|
|
|
#
|
|
|
|
# Generates the encoded version of the supplied payload using the payload
|
|
|
|
# requirements specific to this exploit. The encoded instance is returned
|
|
|
|
# to the caller. This method is exposed in the manner that it is such
|
|
|
|
# that passive exploits and re-generate an encoded payload on the fly
|
|
|
|
# rather than having to use the pre-generated one.
|
|
|
|
#
|
|
|
|
# The return value is an EncodedPayload instance.
|
|
|
|
#
|
|
|
|
def generate_payload(pinst = nil)
|
2005-09-22 03:24:32 +00:00
|
|
|
# Set the encoded payload to the result of the encoding process
|
|
|
|
self.payload = generate_single_payload(pinst)
|
|
|
|
|
|
|
|
# Save the payload instance
|
|
|
|
self.payload_instance = (pinst) ? pinst : self.payload_instance
|
|
|
|
|
|
|
|
return self.payload
|
|
|
|
end
|
2009-12-13 19:31:17 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Allows arbitrary shellcode to be encoded from within an exploit
|
|
|
|
#
|
|
|
|
def encode_shellcode_stub(code, badchars=payload_badchars)
|
2009-12-13 19:43:17 +00:00
|
|
|
platform = self.platform
|
|
|
|
if(self.payload_instance)
|
2009-12-13 19:46:44 +00:00
|
|
|
self.payload_instance.platform
|
2009-12-13 19:43:17 +00:00
|
|
|
end
|
|
|
|
compatible_encoders.each do |name, mod|
|
2009-12-13 19:31:17 +00:00
|
|
|
begin
|
|
|
|
enc = framework.encoders.create(name)
|
2009-12-13 19:43:17 +00:00
|
|
|
raw = enc.encode(code, badchars, nil, platform)
|
2009-12-13 19:31:17 +00:00
|
|
|
return raw if raw
|
|
|
|
rescue ::Exception
|
|
|
|
end
|
|
|
|
end
|
|
|
|
nil
|
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2007-01-18 03:51:15 +00:00
|
|
|
#
|
|
|
|
# Allows the payload handler to spawn a new monitor
|
|
|
|
#
|
|
|
|
def add_handler(opts={})
|
2009-09-24 20:36:30 +00:00
|
|
|
return if not payload_instance
|
|
|
|
return if not handler_enabled?
|
|
|
|
payload_instance.add_handler(opts)
|
2007-01-18 03:51:15 +00:00
|
|
|
end
|
2005-09-22 03:24:32 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# This method generates a non-cached payload which is typically useful for
|
|
|
|
# passive exploits that will have more than one client.
|
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def generate_single_payload(pinst = nil, platform = nil, arch = nil, explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if (explicit_target == nil)
|
2005-07-13 18:06:12 +00:00
|
|
|
raise MissingTargetError, "No target has been specified.",
|
|
|
|
caller
|
|
|
|
end
|
|
|
|
|
|
|
|
# If a payload instance was supplied, use it, otherwise
|
|
|
|
# use the active payload instance
|
2005-07-15 23:46:05 +00:00
|
|
|
real_payload = (pinst) ? pinst : self.payload_instance
|
2005-07-13 18:06:12 +00:00
|
|
|
|
|
|
|
if (real_payload == nil)
|
|
|
|
raise MissingPayloadError, "No payload has been selected.",
|
|
|
|
caller
|
|
|
|
end
|
|
|
|
|
2006-08-26 02:13:25 +00:00
|
|
|
# If this is a generic payload, then we should specify the platform
|
|
|
|
# and architecture so that it knows how to pass things on.
|
|
|
|
if real_payload.kind_of?(Msf::Payload::Generic)
|
|
|
|
# Convert the architecture specified into an array.
|
|
|
|
if arch and arch.kind_of?(String)
|
|
|
|
arch = [ arch ]
|
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2006-08-26 02:13:25 +00:00
|
|
|
# Define the explicit platform and architecture information only if
|
|
|
|
# it's been specified.
|
|
|
|
if platform
|
|
|
|
real_payload.explicit_platform = Msf::Module::PlatformList.transform(platform)
|
|
|
|
end
|
|
|
|
|
|
|
|
if arch
|
|
|
|
real_payload.explicit_arch = arch
|
|
|
|
end
|
|
|
|
|
|
|
|
# Force it to reset so that it will find updated information.
|
|
|
|
real_payload.reset
|
|
|
|
end
|
|
|
|
|
2005-07-13 18:06:12 +00:00
|
|
|
# Duplicate the exploit payload requirements
|
2005-11-11 01:22:03 +00:00
|
|
|
reqs = self.payload_info.dup
|
2005-07-13 18:06:12 +00:00
|
|
|
|
|
|
|
# Pass save register requirements to the NOP generator
|
2008-08-26 22:57:06 +00:00
|
|
|
reqs['Space'] = payload_space(explicit_target)
|
2007-04-01 21:21:10 +00:00
|
|
|
reqs['SaveRegisters'] = nop_save_registers(explicit_target)
|
|
|
|
reqs['Prepend'] = payload_prepend(explicit_target)
|
|
|
|
reqs['PrependEncoder'] = payload_prepend_encoder(explicit_target)
|
|
|
|
reqs['BadChars'] = payload_badchars(explicit_target)
|
|
|
|
reqs['Append'] = payload_append(explicit_target)
|
|
|
|
reqs['MaxNops'] = payload_max_nops(explicit_target)
|
|
|
|
reqs['MinNops'] = payload_min_nops(explicit_target)
|
2006-10-16 23:59:14 +00:00
|
|
|
reqs['Encoder'] = datastore['ENCODER']
|
|
|
|
reqs['Nop'] = datastore['NOP']
|
2007-04-01 21:21:10 +00:00
|
|
|
reqs['EncoderType'] = payload_encoder_type(explicit_target)
|
|
|
|
reqs['EncoderOptions'] = payload_encoder_options(explicit_target)
|
|
|
|
reqs['ExtendedOptions'] = payload_extended_options(explicit_target)
|
2006-10-16 23:59:14 +00:00
|
|
|
|
2007-10-02 03:36:45 +00:00
|
|
|
# Pass along the encoder don't fall through flag
|
|
|
|
reqs['EncoderDontFallThrough'] = datastore['EncoderDontFallThrough']
|
|
|
|
|
2007-08-31 04:01:30 +00:00
|
|
|
# Incorporate any context encoding requirements that are needed
|
|
|
|
define_context_encoding_reqs(reqs)
|
|
|
|
|
2006-10-16 23:59:14 +00:00
|
|
|
# Call the encode begin routine.
|
|
|
|
encode_begin(real_payload, reqs)
|
|
|
|
|
|
|
|
# Generate the encoded payload.
|
|
|
|
encoded = EncodedPayload.create(real_payload, reqs)
|
2005-07-13 18:06:12 +00:00
|
|
|
|
2006-10-16 23:59:14 +00:00
|
|
|
# Call the encode end routine which is expected to return the actual
|
|
|
|
# encoded payload instance.
|
|
|
|
return encode_end(real_payload, reqs, encoded)
|
2005-07-13 18:06:12 +00:00
|
|
|
end
|
|
|
|
|
2005-09-24 19:37:27 +00:00
|
|
|
#
|
|
|
|
# Re-generates an encoded payload, typically called after something in the
|
2006-08-26 02:13:25 +00:00
|
|
|
# datastore has changed. An optional platform and architecture can be
|
|
|
|
# supplied as well.
|
2005-09-24 19:37:27 +00:00
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def regenerate_payload(platform = nil, arch = nil, explicit_target = nil)
|
|
|
|
generate_single_payload(nil, platform, arch, explicit_target)
|
2005-09-24 19:37:27 +00:00
|
|
|
end
|
|
|
|
|
2006-10-16 23:59:14 +00:00
|
|
|
#
|
|
|
|
# Called prior to encoding a payload.
|
|
|
|
#
|
|
|
|
def encode_begin(real_payload, reqs)
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Called after an encoded payload has been generated. This gives exploits
|
|
|
|
# or mixins a chance to alter the encoded payload.
|
|
|
|
#
|
|
|
|
def encode_end(real_payload, reqs, encoded)
|
|
|
|
encoded
|
|
|
|
end
|
|
|
|
|
2005-06-04 22:26:42 +00:00
|
|
|
##
|
|
|
|
#
|
|
|
|
# Feature detection
|
|
|
|
#
|
|
|
|
# These methods check to see if there is a derived implementation of
|
|
|
|
# various methods as a way of inferring whether or not a given exploit
|
|
|
|
# supports the feature.
|
|
|
|
#
|
|
|
|
##
|
|
|
|
|
2005-10-19 03:20:20 +00:00
|
|
|
#
|
|
|
|
# Returns true if the exploit module supports the check method.
|
|
|
|
#
|
2005-06-04 22:26:42 +00:00
|
|
|
def supports_check?
|
|
|
|
derived_implementor?(Msf::Exploit, 'check')
|
|
|
|
end
|
|
|
|
|
2005-10-19 03:20:20 +00:00
|
|
|
#
|
|
|
|
# Returns true if the exploit module supports the exploit method.
|
|
|
|
#
|
2005-06-04 22:39:12 +00:00
|
|
|
def supports_exploit?
|
|
|
|
derived_implementor?(Msf::Exploit, 'exploit')
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
2005-10-19 03:20:20 +00:00
|
|
|
# Returns a hash of the capabilities this exploit module has support for,
|
|
|
|
# such as whether or not it supports check and exploit.
|
2005-06-04 22:39:12 +00:00
|
|
|
#
|
|
|
|
def capabilities
|
|
|
|
{
|
|
|
|
'check' => supports_check?,
|
|
|
|
'exploit' => supports_exploit?
|
|
|
|
}
|
|
|
|
end
|
2005-06-04 22:26:42 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
#
|
2005-07-12 22:33:46 +00:00
|
|
|
# Getters/Setters
|
|
|
|
#
|
|
|
|
# Querying and set interfaces for some of the exploit's attributes.
|
2005-06-04 22:26:42 +00:00
|
|
|
#
|
|
|
|
##
|
|
|
|
|
2005-06-05 00:03:23 +00:00
|
|
|
#
|
2005-10-19 03:20:20 +00:00
|
|
|
# Returns MODULE_EXPLOIT to indicate that this is an exploit module.
|
2005-06-05 00:03:23 +00:00
|
|
|
#
|
2005-07-14 20:05:41 +00:00
|
|
|
def self.type
|
|
|
|
MODULE_EXPLOIT
|
|
|
|
end
|
|
|
|
|
2005-10-19 03:20:20 +00:00
|
|
|
#
|
|
|
|
# Returns MODULE_EXPLOIT to indicate that this is an exploit module.
|
|
|
|
#
|
2005-06-05 00:03:23 +00:00
|
|
|
def type
|
|
|
|
MODULE_EXPLOIT
|
|
|
|
end
|
|
|
|
|
2005-06-04 22:26:42 +00:00
|
|
|
#
|
|
|
|
# If we don't know the exploit type, then I guess it's omnipresent!
|
|
|
|
#
|
|
|
|
def exploit_type
|
|
|
|
Type::Omni
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generally, all exploits take an aggressive stance.
|
|
|
|
#
|
|
|
|
def stance
|
2005-07-11 15:34:31 +00:00
|
|
|
module_info['Stance'] || Stance::Aggressive
|
2005-06-04 22:39:12 +00:00
|
|
|
end
|
|
|
|
|
2006-10-17 00:16:04 +00:00
|
|
|
#
|
|
|
|
# Returns true if the exploit has an aggressive stance.
|
|
|
|
#
|
|
|
|
def aggressive?
|
|
|
|
(stance == Stance::Aggressive)
|
|
|
|
end
|
|
|
|
|
2005-09-22 04:53:46 +00:00
|
|
|
#
|
2005-11-15 15:11:43 +00:00
|
|
|
# Returns if the exploit has a passive stance.
|
2005-09-22 04:53:46 +00:00
|
|
|
#
|
|
|
|
def passive?
|
|
|
|
(stance == Stance::Passive)
|
|
|
|
end
|
|
|
|
|
2005-07-14 14:46:18 +00:00
|
|
|
#
|
2005-11-15 15:11:43 +00:00
|
|
|
# Returns the active target for this exploit. If not target has been
|
|
|
|
# defined, nil is returned. If no target was defined but there is a
|
|
|
|
# default target, that one will be automatically used.
|
2005-07-14 14:46:18 +00:00
|
|
|
#
|
|
|
|
def target
|
2010-02-12 02:11:52 +00:00
|
|
|
target_idx = target_index
|
2005-07-14 14:46:18 +00:00
|
|
|
|
|
|
|
return (target_idx) ? targets[target_idx.to_i] : nil
|
|
|
|
end
|
|
|
|
|
2006-10-11 08:31:54 +00:00
|
|
|
#
|
|
|
|
# The target index that has been selected.
|
|
|
|
#
|
|
|
|
def target_index
|
2010-02-12 02:11:52 +00:00
|
|
|
target_idx = datastore['TARGET']
|
|
|
|
|
|
|
|
# Use the default target if one was not supplied.
|
|
|
|
if (target_idx == nil and default_target and default_target >= 0)
|
|
|
|
target_idx = default_target
|
|
|
|
end
|
|
|
|
return (target_idx) ? target_idx.to_i : nil
|
2006-10-11 08:31:54 +00:00
|
|
|
end
|
|
|
|
|
2006-08-26 02:13:25 +00:00
|
|
|
#
|
|
|
|
# Returns the target's platform, or the one assigned to the module itself.
|
|
|
|
#
|
|
|
|
def target_platform
|
|
|
|
(target and target.platform) ? target.platform : platform
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the target's architecture, or the one assigned to the module
|
|
|
|
# itself.
|
|
|
|
#
|
|
|
|
def target_arch
|
|
|
|
(target and target.arch) ? target.arch : (arch == []) ? nil : arch
|
|
|
|
end
|
|
|
|
|
2005-07-14 14:46:18 +00:00
|
|
|
#
|
|
|
|
# Returns a list of compatible payloads based on platform, architecture,
|
|
|
|
# and size requirements.
|
|
|
|
#
|
|
|
|
def compatible_payloads
|
|
|
|
payloads = []
|
2010-03-17 18:41:09 +00:00
|
|
|
|
|
|
|
|
2005-12-14 00:21:23 +00:00
|
|
|
c_platform = (target and target.platform) ? target.platform : platform
|
|
|
|
c_arch = (target and target.arch) ? target.arch : (arch == []) ? nil : arch
|
2008-11-19 07:09:09 +00:00
|
|
|
c_arch ||= [ ARCH_X86 ]
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2009-12-15 13:14:01 +00:00
|
|
|
framework.payloads.each_module(
|
2005-12-14 00:21:23 +00:00
|
|
|
'Platform' => c_platform,
|
|
|
|
'Arch' => c_arch ) { |name, mod|
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2005-07-14 14:46:18 +00:00
|
|
|
# Skip over payloads that are too big
|
2010-03-17 18:41:09 +00:00
|
|
|
if ((payload_space) and
|
2006-08-28 05:45:36 +00:00
|
|
|
(framework.payloads.sizes[name]) and
|
2005-07-14 14:46:18 +00:00
|
|
|
(framework.payloads.sizes[name] > payload_space))
|
|
|
|
dlog("#{refname}: Skipping payload #{name} for being too large", 'core',
|
|
|
|
LEV_1)
|
|
|
|
next
|
|
|
|
end
|
|
|
|
|
2005-10-19 01:48:10 +00:00
|
|
|
# Are we compatible in terms of conventions and connections and
|
|
|
|
# what not?
|
|
|
|
next if (compatible?(framework.payloads.instance(name)) == false)
|
|
|
|
|
2006-09-12 05:58:07 +00:00
|
|
|
# If the payload is privileged but the exploit does not give
|
|
|
|
# privileged access, then fail it.
|
|
|
|
next if (self.privileged == false and framework.payloads.instance(name).privileged == true)
|
|
|
|
|
2005-07-14 14:46:18 +00:00
|
|
|
# This one be compatible!
|
|
|
|
payloads << [ name, mod ]
|
|
|
|
}
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2005-07-14 14:46:18 +00:00
|
|
|
return payloads;
|
|
|
|
end
|
|
|
|
|
2006-12-28 15:47:00 +00:00
|
|
|
#
|
|
|
|
# Returns a list of compatible encoders based on architecture
|
|
|
|
#
|
|
|
|
def compatible_encoders
|
|
|
|
encoders = []
|
2009-10-16 18:27:18 +00:00
|
|
|
|
2006-12-28 15:47:00 +00:00
|
|
|
c_platform = (target and target.platform) ? target.platform : platform
|
|
|
|
c_arch = (target and target.arch) ? target.arch : (arch == []) ? nil : arch
|
|
|
|
|
2009-12-13 19:43:17 +00:00
|
|
|
framework.encoders.each_module_ranked(
|
2006-12-28 15:47:00 +00:00
|
|
|
'Arch' => c_arch) { |name, mod|
|
|
|
|
|
|
|
|
encoders << [ name, mod ]
|
|
|
|
}
|
2009-10-16 18:27:18 +00:00
|
|
|
|
2006-12-28 15:47:00 +00:00
|
|
|
return encoders;
|
|
|
|
end
|
|
|
|
|
2005-10-01 05:55:15 +00:00
|
|
|
#
|
|
|
|
# This method returns the number of bytes that should be adjusted to the
|
|
|
|
# stack pointer prior to executing any code. The number of bytes to adjust
|
|
|
|
# is indicated to the routine through the payload 'StackAdjustment'
|
|
|
|
# attribute or through a target's payload 'StackAdjustment' attribute.
|
|
|
|
#
|
|
|
|
def stack_adjustment
|
|
|
|
if (target and target.payload_stack_adjustment)
|
|
|
|
adj = target.payload_stack_adjustment
|
|
|
|
else
|
|
|
|
adj = payload_info['StackAdjustment']
|
|
|
|
end
|
|
|
|
|
|
|
|
# Get the architecture for the current target or use the one specific to
|
|
|
|
# this exploit
|
|
|
|
arch = (target and target.arch) ? target.arch : self.arch
|
|
|
|
|
|
|
|
# Default to x86 if we can't find a list of architectures
|
2005-11-11 01:22:03 +00:00
|
|
|
if (arch and arch.empty? == false)
|
2005-10-01 05:55:15 +00:00
|
|
|
arch = arch.join(", ")
|
|
|
|
else
|
|
|
|
arch = 'x86'
|
|
|
|
end
|
|
|
|
|
2005-11-11 01:22:03 +00:00
|
|
|
(adj != nil) ? Rex::Arch::adjust_stack_pointer(arch, adj) || '' : ''
|
2005-10-01 05:55:15 +00:00
|
|
|
end
|
|
|
|
|
2005-07-11 15:34:31 +00:00
|
|
|
#
|
|
|
|
# Return any text that should be prepended to the payload. The payload
|
|
|
|
# module is passed so that the exploit can take a guess at architecture
|
2005-10-01 05:55:15 +00:00
|
|
|
# and platform if it's a multi exploit. This automatically takes into
|
|
|
|
# account any require stack adjustments.
|
2005-07-11 15:34:31 +00:00
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def payload_prepend(explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if (explicit_target and explicit_target.payload_prepend)
|
|
|
|
p = explicit_target.payload_prepend
|
2010-03-17 18:41:09 +00:00
|
|
|
else
|
2005-10-01 05:55:15 +00:00
|
|
|
p = payload_info['Prepend'] || ''
|
2005-09-30 07:12:32 +00:00
|
|
|
end
|
2005-10-01 05:55:15 +00:00
|
|
|
|
|
|
|
stack_adjustment + p
|
2005-07-11 15:34:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Return any text that should be appended to the payload. The payload
|
|
|
|
# module is passed so that the exploit can take a guess at architecture
|
|
|
|
# and platform if it's a multi exploit.
|
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def payload_append(explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if (explicit_target and explicit_target.payload_append)
|
|
|
|
explicit_target.payload_append
|
2005-09-30 07:12:32 +00:00
|
|
|
else
|
|
|
|
payload_info['Append'] || ''
|
|
|
|
end
|
2005-07-11 15:34:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Return any text that should be prepended to the encoder of the payload.
|
2010-03-17 18:41:09 +00:00
|
|
|
# The payload module is passed so that the exploit can take a guess
|
2005-07-11 15:34:31 +00:00
|
|
|
# at architecture and platform if it's a multi exploit.
|
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def payload_prepend_encoder(explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if (explicit_target and explicit_target.payload_prepend_encoder)
|
|
|
|
p = explicit_target.payload_prepend_encoder
|
2005-09-30 07:12:32 +00:00
|
|
|
else
|
2005-11-11 01:22:03 +00:00
|
|
|
p = payload_info['PrependEncoder'] || ''
|
2005-09-30 07:12:32 +00:00
|
|
|
end
|
2005-11-11 01:22:03 +00:00
|
|
|
|
|
|
|
p
|
2005-07-11 15:34:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
2005-07-12 22:33:46 +00:00
|
|
|
# Maximum number of nops to use as a hint to the framework.
|
|
|
|
# Nil signifies that the framework should decide.
|
2005-07-11 15:34:31 +00:00
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def payload_max_nops(explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if (explicit_target and explicit_target.payload_max_nops)
|
|
|
|
explicit_target.payload_max_nops
|
2005-09-30 07:12:32 +00:00
|
|
|
else
|
|
|
|
payload_info['MaxNops'] || nil
|
|
|
|
end
|
2005-07-12 22:33:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Minimum number of nops to use as a hint to the framework.
|
|
|
|
# Nil snigifies that the framework should decide.
|
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def payload_min_nops(explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if (explicit_target and explicit_target.payload_min_nops)
|
|
|
|
explicit_target.payload_min_nops
|
2005-09-30 07:12:32 +00:00
|
|
|
else
|
|
|
|
payload_info['MinNops'] || nil
|
|
|
|
end
|
2005-07-12 22:33:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the maximum amount of room the exploit has for a payload.
|
2005-07-11 15:34:31 +00:00
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def payload_space(explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if (explicit_target and explicit_target.payload_space)
|
|
|
|
explicit_target.payload_space
|
2005-09-30 07:12:32 +00:00
|
|
|
elsif (payload_info['Space'])
|
2005-07-15 23:46:05 +00:00
|
|
|
payload_info['Space'].to_i
|
2005-07-14 07:32:11 +00:00
|
|
|
else
|
|
|
|
nil
|
|
|
|
end
|
2005-07-11 15:34:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the bad characters that cannot be in any payload used by this
|
|
|
|
# exploit.
|
2005-06-04 22:39:12 +00:00
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def payload_badchars(explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if (explicit_target and explicit_target.payload_badchars)
|
|
|
|
explicit_target.payload_badchars
|
2006-01-06 02:25:47 +00:00
|
|
|
else
|
|
|
|
payload_info['BadChars']
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the payload encoder type that is associated with either the
|
|
|
|
# current target of the exploit in general.
|
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def payload_encoder_type(explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if (explicit_target and explicit_target.payload_encoder_type)
|
|
|
|
explicit_target.payload_encoder_type
|
2006-01-06 02:25:47 +00:00
|
|
|
else
|
|
|
|
payload_info['EncoderType']
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the payload encoder option hash that is used to initialize the
|
|
|
|
# datastore of the encoder that is selected when generating an encoded
|
|
|
|
# payload.
|
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def payload_encoder_options(explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if (explicit_target and explicit_target.payload_encoder_options)
|
|
|
|
explicit_target.payload_encoder_options
|
2006-01-06 02:25:47 +00:00
|
|
|
else
|
|
|
|
payload_info['EncoderOptions']
|
|
|
|
end
|
2005-07-11 15:34:31 +00:00
|
|
|
end
|
|
|
|
|
2006-10-16 23:59:14 +00:00
|
|
|
#
|
|
|
|
# Returns the payload extended options hash which is used to provide
|
|
|
|
# a location to store extended information that may be useful to
|
|
|
|
# a particular type of payload or mixin.
|
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def payload_extended_options(explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if explicit_target and explicit_target.payload_extended_options
|
|
|
|
explicit_target.payload_extended_options
|
2006-10-16 23:59:14 +00:00
|
|
|
else
|
|
|
|
payload_info['ExtendedOptions']
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2005-07-11 15:34:31 +00:00
|
|
|
##
|
|
|
|
#
|
2005-07-12 22:33:46 +00:00
|
|
|
# NOP requirements
|
2010-03-17 18:41:09 +00:00
|
|
|
#
|
2005-07-12 22:33:46 +00:00
|
|
|
# Hints to the nop generator on how it should perform if it's used.
|
2005-07-11 15:34:31 +00:00
|
|
|
#
|
|
|
|
##
|
|
|
|
|
|
|
|
#
|
2010-03-17 18:41:09 +00:00
|
|
|
# Returns the list of registers that the NOP generator should save,
|
2005-07-11 15:34:31 +00:00
|
|
|
# if any. It will use the current target's save registers in precedence
|
|
|
|
# over those defined globally for the exploit module.
|
|
|
|
#
|
|
|
|
# If there are no save registers, nil is returned.
|
2005-06-04 22:39:12 +00:00
|
|
|
#
|
2007-04-01 21:21:10 +00:00
|
|
|
def nop_save_registers(explicit_target = nil)
|
|
|
|
explicit_target ||= target
|
|
|
|
|
|
|
|
if (explicit_target and explicit_target.save_registers)
|
2010-03-17 18:41:09 +00:00
|
|
|
return explicit_target.save_registers
|
2005-07-11 15:34:31 +00:00
|
|
|
else
|
2005-07-12 22:42:58 +00:00
|
|
|
return module_info['SaveRegisters']
|
2005-07-11 15:34:31 +00:00
|
|
|
end
|
2005-06-04 22:26:42 +00:00
|
|
|
end
|
|
|
|
|
2005-09-24 18:02:24 +00:00
|
|
|
#
|
|
|
|
# Returns the first compatible NOP generator for this exploit's payload
|
|
|
|
# instance.
|
|
|
|
#
|
|
|
|
def nop_generator
|
|
|
|
return nil if (!payload_instance)
|
|
|
|
|
|
|
|
payload_instance.compatible_nops.each { |nopname, nopmod|
|
|
|
|
return nopmod.new
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2005-09-22 03:24:32 +00:00
|
|
|
#
|
|
|
|
# Generates a nop sled of a supplied length and returns it to the caller.
|
|
|
|
#
|
|
|
|
def make_nops(count)
|
2007-03-01 08:09:22 +00:00
|
|
|
# If we're debugging, then make_nops will return a safe sled. We
|
|
|
|
# currently assume x86.
|
|
|
|
if debugging?
|
|
|
|
return "\x90" * count
|
|
|
|
end
|
|
|
|
|
2005-09-22 03:24:32 +00:00
|
|
|
nop_sled = nil
|
|
|
|
|
|
|
|
# If there is no payload instance then we can't succeed.
|
|
|
|
return nil if (!payload_instance)
|
|
|
|
|
|
|
|
payload_instance.compatible_nops.each { |nopname, nopmod|
|
|
|
|
# Create an instance of the nop module
|
|
|
|
nop = nopmod.new
|
|
|
|
|
|
|
|
# The list of save registers
|
|
|
|
save_regs = nop_save_registers || []
|
|
|
|
|
|
|
|
if (save_regs.empty? == true)
|
|
|
|
save_regs = nil
|
|
|
|
end
|
|
|
|
|
|
|
|
begin
|
2005-12-30 02:38:18 +00:00
|
|
|
nop.copy_ui(self)
|
|
|
|
|
2005-09-22 03:24:32 +00:00
|
|
|
nop_sled = nop.generate_sled(count,
|
|
|
|
'BadChars' => payload_badchars || '',
|
|
|
|
'SaveRegisters' => save_regs)
|
|
|
|
rescue
|
2005-11-02 00:27:59 +00:00
|
|
|
wlog("#{self.refname}: Nop generator #{nop.refname} failed to generate sled for exploit: #{$!}",
|
|
|
|
'core', LEV_0)
|
2005-09-22 03:24:32 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
nop_sled
|
|
|
|
end
|
|
|
|
|
2006-10-11 08:31:54 +00:00
|
|
|
##
|
|
|
|
#
|
|
|
|
# Utility methods for generating random text that implicitly uses the
|
|
|
|
# exploit's bad character set.
|
|
|
|
#
|
|
|
|
##
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate random text characters avoiding the exploit's bad
|
|
|
|
# characters.
|
|
|
|
#
|
2007-03-06 21:02:38 +00:00
|
|
|
def rand_text(length, bad=payload_badchars)
|
2007-03-01 08:09:22 +00:00
|
|
|
if debugging?
|
|
|
|
"A" * length
|
|
|
|
else
|
2007-03-06 21:02:38 +00:00
|
|
|
Rex::Text.rand_text(length, bad)
|
2007-03-01 08:09:22 +00:00
|
|
|
end
|
2006-10-11 08:31:54 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate random english-like avoiding the exploit's bad
|
|
|
|
# characters.
|
|
|
|
#
|
2007-03-06 21:02:38 +00:00
|
|
|
def rand_text_english(length, bad=payload_badchars)
|
2007-03-01 08:09:22 +00:00
|
|
|
if debugging?
|
|
|
|
"A" * length
|
|
|
|
else
|
2007-03-06 21:02:38 +00:00
|
|
|
Rex::Text.rand_text_english(length, bad)
|
2007-03-01 08:09:22 +00:00
|
|
|
end
|
2006-10-11 08:31:54 +00:00
|
|
|
end
|
|
|
|
|
2009-04-16 03:02:41 +00:00
|
|
|
#
|
|
|
|
# Generate random high ascii characters avoiding the exploit's bad
|
|
|
|
# characters.
|
|
|
|
#
|
|
|
|
def rand_text_highascii(length, bad=payload_badchars)
|
2009-10-16 18:27:18 +00:00
|
|
|
if debugging?
|
|
|
|
"A" * length
|
|
|
|
else
|
|
|
|
Rex::Text.rand_text_highascii(length, bad)
|
|
|
|
end
|
|
|
|
end
|
2009-04-16 03:02:41 +00:00
|
|
|
|
2006-10-11 08:31:54 +00:00
|
|
|
#
|
|
|
|
# Generate random alpha characters avoiding the exploit's bad
|
|
|
|
# characters.
|
|
|
|
#
|
2007-03-06 21:02:38 +00:00
|
|
|
def rand_text_alpha(length, bad=payload_badchars)
|
2007-03-01 08:09:22 +00:00
|
|
|
if debugging?
|
|
|
|
"A" * length
|
|
|
|
else
|
2007-03-06 21:02:38 +00:00
|
|
|
Rex::Text.rand_text_alpha(length, bad)
|
2007-03-01 08:09:22 +00:00
|
|
|
end
|
2006-10-11 08:31:54 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate random alpha upper characters avoiding the exploit's bad
|
|
|
|
# characters.
|
|
|
|
#
|
2007-03-06 21:02:38 +00:00
|
|
|
def rand_text_alpha_upper(length, bad=payload_badchars)
|
2007-03-01 08:09:22 +00:00
|
|
|
if debugging?
|
|
|
|
"A" * length
|
|
|
|
else
|
2007-03-06 21:02:38 +00:00
|
|
|
Rex::Text.rand_text_alpha_upper(length, bad)
|
2007-03-01 08:09:22 +00:00
|
|
|
end
|
2006-10-11 08:31:54 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
2012-06-10 08:15:48 +00:00
|
|
|
# Generate random alpha lower characters avoiding the exploit's bad
|
2006-10-11 08:31:54 +00:00
|
|
|
# characters.
|
|
|
|
#
|
2007-03-06 21:02:38 +00:00
|
|
|
def rand_text_alpha_lower(length, bad=payload_badchars)
|
2007-03-01 08:09:22 +00:00
|
|
|
if debugging?
|
|
|
|
"a" * length
|
|
|
|
else
|
2007-03-06 21:02:38 +00:00
|
|
|
Rex::Text.rand_text_alpha_lower(length, bad)
|
2007-03-01 08:09:22 +00:00
|
|
|
end
|
2006-10-11 08:31:54 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate random alphanumeric characters avoiding the exploit's bad
|
|
|
|
# characters.
|
|
|
|
#
|
2007-03-06 21:02:38 +00:00
|
|
|
def rand_text_alphanumeric(length, bad=payload_badchars)
|
2007-03-01 08:09:22 +00:00
|
|
|
if debugging?
|
|
|
|
"A" * length
|
|
|
|
else
|
2007-03-06 21:02:38 +00:00
|
|
|
Rex::Text.rand_text_alphanumeric(length, bad)
|
2007-03-01 08:09:22 +00:00
|
|
|
end
|
2006-10-11 08:31:54 +00:00
|
|
|
end
|
|
|
|
|
2007-09-05 13:40:41 +00:00
|
|
|
#
|
|
|
|
# Generate random numeric characters avoiding the exploit's bad
|
|
|
|
# characters.
|
|
|
|
#
|
|
|
|
def rand_text_numeric(length, bad=payload_badchars)
|
|
|
|
if debugging?
|
|
|
|
"0" * length
|
|
|
|
else
|
|
|
|
Rex::Text.rand_text_numeric(length, bad)
|
|
|
|
end
|
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2007-06-29 00:29:29 +00:00
|
|
|
#
|
2010-03-17 18:41:09 +00:00
|
|
|
# Generate a random character avoiding the exploit's bad
|
2007-06-29 00:29:29 +00:00
|
|
|
# characters.
|
|
|
|
#
|
|
|
|
def rand_char(bad=payload_badchars)
|
|
|
|
if debugging?
|
|
|
|
"A"
|
|
|
|
else
|
|
|
|
Rex::Text.rand_char(bad)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2006-11-16 06:09:28 +00:00
|
|
|
#
|
|
|
|
# Generate a non-repeating static random string
|
|
|
|
#
|
2009-01-12 00:10:48 +00:00
|
|
|
def pattern_create(length, sets = nil)
|
|
|
|
Rex::Text.pattern_create(length, sets)
|
2006-11-16 06:09:28 +00:00
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2006-10-17 00:16:04 +00:00
|
|
|
#
|
|
|
|
# The default "wait for session" delay is zero for all exploits.
|
|
|
|
#
|
|
|
|
def wfs_delay
|
|
|
|
(datastore['WfsDelay'] || 0).to_i
|
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2009-09-24 20:36:30 +00:00
|
|
|
#
|
|
|
|
# Allow the user to disable the payload handler
|
|
|
|
#
|
|
|
|
def handler_enabled?
|
|
|
|
not datastore['DisablePayloadHandler']
|
|
|
|
end
|
2006-10-17 00:16:04 +00:00
|
|
|
|
2005-07-15 23:46:05 +00:00
|
|
|
##
|
|
|
|
#
|
|
|
|
# Handler interaction
|
|
|
|
#
|
|
|
|
##
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2005-07-15 23:46:05 +00:00
|
|
|
#
|
|
|
|
# Passes the connection to the associated payload handler to see if the
|
|
|
|
# exploit succeeded and a connection has been established. The return
|
|
|
|
# value can be one of the Handler::constants.
|
|
|
|
#
|
|
|
|
def handler(*args)
|
2009-09-24 20:36:30 +00:00
|
|
|
return if not payload_instance
|
|
|
|
return if not handler_enabled?
|
2011-07-04 20:09:32 +00:00
|
|
|
return payload_instance.handler(*args)
|
2005-07-15 23:46:05 +00:00
|
|
|
end
|
|
|
|
|
2005-11-27 18:42:44 +00:00
|
|
|
##
|
|
|
|
#
|
|
|
|
# Session tracking
|
|
|
|
#
|
|
|
|
##
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2005-11-27 18:42:44 +00:00
|
|
|
#
|
|
|
|
# This is called by the payload when a new session is created
|
|
|
|
#
|
|
|
|
def on_new_session(session)
|
|
|
|
self.session_count += 1
|
2012-06-10 08:15:48 +00:00
|
|
|
self.successful = true
|
2005-11-27 18:42:44 +00:00
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2005-11-27 18:42:44 +00:00
|
|
|
#
|
|
|
|
# A boolean for whether a session has been created yet
|
|
|
|
#
|
|
|
|
def session_created?
|
|
|
|
(self.session_count > 0) ? true : false
|
|
|
|
end
|
2005-12-31 18:26:34 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Reset the session counter to zero (which occurs during set up of the
|
|
|
|
# exploit prior to calling exploit).
|
|
|
|
#
|
|
|
|
def reset_session_counts
|
|
|
|
self.session_count = 0
|
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2012-06-10 08:15:48 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
# Failure tracking
|
|
|
|
##
|
2013-03-08 00:20:08 +00:00
|
|
|
|
2012-06-19 05:48:39 +00:00
|
|
|
def fail_with(reason,msg=nil)
|
2012-06-10 08:15:48 +00:00
|
|
|
self.fail_reason = reason
|
2012-06-19 05:48:39 +00:00
|
|
|
self.fail_detail = msg
|
|
|
|
raise Msf::Exploit::Failed, (msg || "No reason given")
|
2012-06-10 08:15:48 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def report_failure
|
2012-06-19 05:48:39 +00:00
|
|
|
|
2012-06-10 08:15:48 +00:00
|
|
|
return unless framework.db and framework.db.active
|
|
|
|
|
|
|
|
info = {
|
|
|
|
:timestamp => Time.now.utc,
|
|
|
|
:workspace => framework.db.find_workspace(self.workspace),
|
|
|
|
:module => self.fullname,
|
2012-06-19 05:48:39 +00:00
|
|
|
:fail_reason => self.fail_reason,
|
|
|
|
:fail_detail => self.fail_detail,
|
2012-06-10 08:15:48 +00:00
|
|
|
:target_name => self.target.name,
|
|
|
|
:username => self.owner,
|
|
|
|
:refs => self.references
|
|
|
|
}
|
|
|
|
|
|
|
|
if self.datastore['RHOST'] and self.options['RHOST']
|
|
|
|
info[:host] = self.datastore['RHOST']
|
|
|
|
end
|
|
|
|
|
|
|
|
if self.datastore['RPORT'] and self.options['RPORT']
|
|
|
|
info[:port] = self.datastore['RPORT']
|
|
|
|
if self.class.ancestors.include?(Msf::Exploit::Remote::Tcp)
|
|
|
|
info[:proto] = 'tcp'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
framework.db.report_exploit_failure(info)
|
|
|
|
end
|
|
|
|
|
2010-08-03 15:14:34 +00:00
|
|
|
##
|
|
|
|
#
|
|
|
|
# Aliases
|
|
|
|
#
|
|
|
|
# These allow access to methods inside this class, even if exploits use mixins that
|
|
|
|
# override them.
|
|
|
|
#
|
|
|
|
##
|
|
|
|
|
2010-11-11 23:01:35 +00:00
|
|
|
# Give exploits the ability to use the original +regenerate_payload+ so
|
|
|
|
# they can avoid needing additional arguments added by overridden versions.
|
|
|
|
# Used specifically by things that include +TcpServer+ (or a descendant)
|
|
|
|
# but which are active exploits.
|
2010-08-03 15:14:34 +00:00
|
|
|
alias :exploit_regenerate_payload :regenerate_payload
|
|
|
|
|
|
|
|
|
2005-07-12 22:33:46 +00:00
|
|
|
##
|
2005-07-11 15:34:31 +00:00
|
|
|
#
|
|
|
|
# Attributes
|
|
|
|
#
|
2005-07-12 22:33:46 +00:00
|
|
|
##
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2012-06-10 08:15:48 +00:00
|
|
|
#
|
|
|
|
# The reason why the exploit was not successful (one of Msf::Exploit::FailReason)
|
|
|
|
#
|
|
|
|
attr_accessor :fail_reason
|
|
|
|
|
2012-06-19 05:48:39 +00:00
|
|
|
#
|
|
|
|
# Detailed exception string indicating why the exploit was not successful
|
|
|
|
#
|
|
|
|
attr_accessor :fail_detail
|
|
|
|
|
2005-07-11 15:34:31 +00:00
|
|
|
#
|
2005-07-12 22:33:46 +00:00
|
|
|
# The list of targets.
|
2005-07-11 15:34:31 +00:00
|
|
|
#
|
2005-07-12 22:33:46 +00:00
|
|
|
attr_reader :targets
|
2005-07-11 15:34:31 +00:00
|
|
|
#
|
2005-07-12 22:33:46 +00:00
|
|
|
# The default target.
|
2005-07-11 15:34:31 +00:00
|
|
|
#
|
2005-07-12 22:33:46 +00:00
|
|
|
attr_reader :default_target
|
|
|
|
#
|
2005-07-13 18:06:12 +00:00
|
|
|
# The payload requirement hash.
|
2005-07-12 22:33:46 +00:00
|
|
|
#
|
2005-07-15 23:46:05 +00:00
|
|
|
attr_reader :payload_info
|
2005-07-13 18:06:12 +00:00
|
|
|
#
|
|
|
|
# The active payload instance.
|
|
|
|
#
|
2005-07-15 23:46:05 +00:00
|
|
|
attr_accessor :payload_instance
|
2005-07-13 18:06:12 +00:00
|
|
|
#
|
2010-03-17 18:41:09 +00:00
|
|
|
# The encoded payload instance. An instance of an
|
2005-07-15 23:46:05 +00:00
|
|
|
# EncodedPayload object.
|
2005-07-13 18:06:12 +00:00
|
|
|
#
|
2005-07-15 23:46:05 +00:00
|
|
|
attr_accessor :payload
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2005-11-27 18:42:44 +00:00
|
|
|
#
|
|
|
|
# The number of active sessions created by this instance
|
|
|
|
#
|
|
|
|
attr_reader :session_count
|
2005-07-11 15:34:31 +00:00
|
|
|
|
2012-06-10 08:15:48 +00:00
|
|
|
#
|
|
|
|
# The boolean indicating whether the exploit succeeded
|
|
|
|
#
|
|
|
|
attr_reader :successful
|
|
|
|
|
|
|
|
|
2005-07-11 15:34:31 +00:00
|
|
|
protected
|
2005-06-04 22:26:42 +00:00
|
|
|
|
2005-10-19 03:20:20 +00:00
|
|
|
#
|
|
|
|
# Writable copy of the list of targets.
|
|
|
|
#
|
2005-07-12 22:33:46 +00:00
|
|
|
attr_writer :targets
|
2005-10-19 03:20:20 +00:00
|
|
|
#
|
|
|
|
# Writable copy of the default target.
|
|
|
|
#
|
2005-07-11 15:34:31 +00:00
|
|
|
attr_writer :default_target
|
2005-10-19 03:20:20 +00:00
|
|
|
#
|
|
|
|
# Writable copy of the payload requirement hash.
|
|
|
|
#
|
2005-07-15 23:46:05 +00:00
|
|
|
attr_writer :payload_info
|
2005-11-27 18:42:44 +00:00
|
|
|
#
|
2012-06-10 08:15:48 +00:00
|
|
|
# Number of sessions created by this exploit instance.
|
2005-11-27 18:42:44 +00:00
|
|
|
#
|
|
|
|
attr_writer :session_count
|
2006-07-29 22:37:39 +00:00
|
|
|
#
|
2012-06-10 08:15:48 +00:00
|
|
|
# Maximum number of seconds for active handlers
|
2006-07-29 22:37:39 +00:00
|
|
|
#
|
|
|
|
attr_accessor :active_timeout
|
2010-03-17 18:41:09 +00:00
|
|
|
|
2012-06-10 08:15:48 +00:00
|
|
|
#
|
|
|
|
# Boolean indicating whether the exploit succeeded
|
|
|
|
#
|
|
|
|
attr_writer :successful
|
|
|
|
|
|
|
|
|
2005-10-19 01:48:10 +00:00
|
|
|
#
|
|
|
|
# Overrides the base class method and serves to initialize default
|
|
|
|
# compatibilities for exploits
|
|
|
|
#
|
|
|
|
def init_compat
|
|
|
|
super
|
|
|
|
|
|
|
|
#
|
2010-03-17 18:41:09 +00:00
|
|
|
# Merge in payload compatible defaults
|
2005-10-19 01:48:10 +00:00
|
|
|
#
|
|
|
|
p = module_info['Compat']['Payload']
|
|
|
|
|
|
|
|
CompatDefaults::Payload.each_pair { |k,v|
|
2006-01-03 04:43:40 +00:00
|
|
|
(p[k]) ? p[k] << " #{v}" : p[k] = v
|
2005-10-19 01:48:10 +00:00
|
|
|
}
|
2005-10-19 03:20:20 +00:00
|
|
|
|
|
|
|
#
|
2010-03-17 18:41:09 +00:00
|
|
|
# Set the default save registers if none have been explicitly
|
2005-10-19 03:20:20 +00:00
|
|
|
# specified.
|
|
|
|
#
|
|
|
|
if (module_info['SaveRegisters'] == nil)
|
|
|
|
module_info['SaveRegisters'] = [ 'esp', 'ebp' ]
|
|
|
|
end
|
2005-10-19 01:48:10 +00:00
|
|
|
end
|
|
|
|
|
2007-08-31 04:01:30 +00:00
|
|
|
#
|
|
|
|
# Gets the memory map file and other context information that is
|
|
|
|
# required when wanting to support context keyed encoding
|
|
|
|
#
|
|
|
|
def define_context_encoding_reqs(reqs)
|
|
|
|
return if datastore['EnableContextEncoding'] != true
|
|
|
|
|
|
|
|
# At present, we don't support any automatic methods of obtaining
|
|
|
|
# context information. In the future, we might support obtaining
|
|
|
|
# temporal information remotely.
|
|
|
|
|
|
|
|
# Pass along the information specified in our exploit datastore as
|
|
|
|
# encoder options
|
|
|
|
reqs['EncoderOptions'] = {} if reqs['EncoderOptions'].nil?
|
|
|
|
reqs['EncoderOptions']['EnableContextEncoding'] = datastore['EnableContextEncoding']
|
|
|
|
reqs['EncoderOptions']['ContextInformationFile'] = datastore['ContextInformationFile']
|
|
|
|
end
|
|
|
|
|
2005-06-04 22:26:42 +00:00
|
|
|
end
|
|
|
|
|
2008-11-09 22:23:29 +00:00
|
|
|
end
|
2010-03-17 18:41:09 +00:00
|
|
|
|