Monkey patch xmlrpc to handle 64-bit integers (meterpreter file sizes) and deal with nil more gracefully.
git-svn-id: file:///home/svn/framework3/trunk@12466 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
4053764f21
commit
882c4b52f8
|
@ -5,8 +5,37 @@ require "rex"
|
|||
|
||||
module Msf
|
||||
module RPC
|
||||
|
||||
|
||||
module MonkeyPatcher
|
||||
def initialize(*args)
|
||||
|
||||
# Enable Bigint processing (required for big file sizes,etc)
|
||||
if XMLRPC::Config.const_defined?(:ENABLE_BIGINT)
|
||||
XMLRPC::Config.send(:remove_const, :ENABLE_BIGINT)
|
||||
XMLRPC::Config.const_set(:ENABLE_BIGINT, true)
|
||||
end
|
||||
|
||||
# Enable nils in requests
|
||||
if XMLRPC::Config.const_defined?(:ENABLE_NIL_CREATE)
|
||||
XMLRPC::Config.send(:remove_const, :ENABLE_NIL_CREATE)
|
||||
XMLRPC::Config.const_set(:ENABLE_NIL_CREATE, true)
|
||||
end
|
||||
|
||||
# Enable nils in replies
|
||||
if XMLRPC::Config.const_defined?(:ENABLE_NIL_PARSER)
|
||||
XMLRPC::Config.send(:remove_const, :ENABLE_NIL_PARSER)
|
||||
XMLRPC::Config.const_set(:ENABLE_NIL_PARSER, true)
|
||||
end
|
||||
|
||||
super(*args)
|
||||
end
|
||||
end
|
||||
|
||||
class Service < ::XMLRPC::BasicServer
|
||||
|
||||
include MonkeyPatcher
|
||||
|
||||
attr_accessor :service, :state, :on_input, :on_output, :on_error
|
||||
attr_accessor :dispatcher_timeout
|
||||
|
||||
|
@ -113,6 +142,8 @@ end
|
|||
|
||||
class WebService < ::XMLRPC::BasicServer
|
||||
|
||||
include MonkeyPatcher
|
||||
|
||||
attr_accessor :service, :state, :srvhost, :srvport, :uri
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue