update winpmem dump handler for 64-bit support

bug/bundler_fix
Brent Cook 2017-06-21 03:02:50 -05:00
parent c3090a4f9c
commit 401d3eb9cf
3 changed files with 8 additions and 5 deletions

View File

@ -5,7 +5,7 @@ module Meterpreter
module Extensions
module Winpmem
TLV_TYPE_WINPMEM_ERROR_CODE = TLV_META_TYPE_UINT | (TLV_EXTENSIONS + 1)
TLV_TYPE_WINPMEM_MEMORY_SIZE = TLV_META_TYPE_UINT | (TLV_EXTENSIONS + 2)
TLV_TYPE_WINPMEM_MEMORY_SIZE = TLV_META_TYPE_QWORD | (TLV_EXTENSIONS + 2)
end
end
end

View File

@ -43,8 +43,10 @@ class Winpmem < Extension
channel_id = response.get_tlv_value(TLV_TYPE_CHANNEL_ID)
raise Exception, "We did not get a channel back!" if channel_id.nil?
#Open the compressed Channel
channel = Rex::Post::Meterpreter::Channels::Pool.new(client, channel_id, "winpmem", CHANNEL_FLAG_SYNCHRONOUS | CHANNEL_FLAG_COMPRESS)
# Open the compressed Channel
channel = Rex::Post::Meterpreter::Channels::Pool.new(client, channel_id, "winpmem",
CHANNEL_FLAG_SYNCHRONOUS | CHANNEL_FLAG_COMPRESS)
return memory_size, response_code, channel
end
end

View File

@ -60,12 +60,13 @@ module Ui
end
print_good("Driver PMEM loaded successfully")
#Arbitrary big buffer size, could be optimized
buffer_size = 2**17
buffer_size = 2 ** 17
bytes_read = 0
next_message_byte = memory_size / 10
print_good("memory_size #{memory_size}")
begin
data = channel.read(buffer_size)
until channel.eof
until channel.eof || data.nil?
fd.write(data)
bytes_read += data.length
data = channel.read(buffer_size)