this is all to my baby mommas out there
git-svn-id: file:///home/svn/incoming/trunk@2357 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
59992d3cca
commit
df75ef23fc
|
@ -48,11 +48,15 @@ class Client
|
|||
# Extension registration
|
||||
#
|
||||
def add_extension(name)
|
||||
Kernel.require("Rex/Post/Meterpreter/Extensions/#{name}/#{name}")
|
||||
if (Kernel.require("Rex/Post/Meterpreter/Extensions/#{name}/#{name}") == false)
|
||||
return false
|
||||
end
|
||||
|
||||
ext = eval("Rex::Post::Meterpreter::Extensions::" + name + "::" + name + ".new(self)")
|
||||
|
||||
self.extensions[ext.name] = ext
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
def register_extension_alias(name, ext)
|
||||
|
|
|
@ -118,7 +118,7 @@ class Tlv
|
|||
|
||||
if (self.type & TLV_META_TYPE_STRING == TLV_META_TYPE_STRING)
|
||||
if (raw.length > 0)
|
||||
self.value = raw[8..raw.length-2] # minus the null term
|
||||
self.value = raw[8..-2]
|
||||
else
|
||||
self.value = nil
|
||||
end
|
||||
|
@ -296,7 +296,7 @@ class Packet < GroupTlv
|
|||
method = nil
|
||||
|
||||
if (request)
|
||||
if (request.type?(ACKET_TYPE_PLAIN_REQUEST))
|
||||
if (request.type?(PACKET_TYPE_PLAIN_REQUEST))
|
||||
response_type = PACKET_TYPE_PLAIN_RESPONSE
|
||||
end
|
||||
|
||||
|
|
|
@ -93,6 +93,18 @@ module PacketDispatcher
|
|||
return bytes
|
||||
end
|
||||
|
||||
def send_request(packet, t = Client.default_timeout)
|
||||
response = send_packet_wait_response(packet, t)
|
||||
|
||||
if (response == nil)
|
||||
raise RuntimeError, packet.method + ": No response was received.", caller
|
||||
elsif (response.result != 0)
|
||||
raise RuntimeError, packet.method + ": Operation failed: #{response.result}", caller
|
||||
end
|
||||
|
||||
return response
|
||||
end
|
||||
|
||||
# Transmits a packet and waits for a response
|
||||
def send_packet_wait_response(packet, t)
|
||||
# First, add the waiter association for the supplied packet
|
||||
|
|
Loading…
Reference in New Issue