Skip to content

Commit 836feaa

Browse files
committed
Fix uuid setting, fix reverse_https x64 payload
The payload changes in this PR will be fixed up/removed in the update-x64-stagers PR.
1 parent 5f735c9 commit 836feaa

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

lib/msf/base/sessions/meterpreter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ def is_valid_session?(timeout=10)
307307

308308
begin
309309
self.machine_id = self.core.machine_id(timeout)
310+
self.payload_uuid ||= self.core.uuid(timeout)
311+
310312
return true
311313
rescue ::Rex::Post::Meterpreter::RequestError
312314
# This meterpreter doesn't support core_machine_id
@@ -329,8 +331,6 @@ def load_session_info()
329331
username = self.sys.config.getuid
330332
sysinfo = self.sys.config.sysinfo
331333

332-
self.payload_uuid = self.core.uuid unless self.payload_uuid
333-
334334
safe_info = "#{username} @ #{sysinfo['Computer']}"
335335
safe_info.force_encoding("ASCII-8BIT") if safe_info.respond_to?(:force_encoding)
336336
# Should probably be using Rex::Text.ascii_safe_hex but leave

lib/msf/core/payload/windows/reverse_https.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: binary -*-
22

33
require 'msf/core'
4+
require 'msf/core/payload/transport_config'
45
require 'msf/core/payload/windows/reverse_http'
56

67
module Msf
@@ -15,6 +16,7 @@ module Msf
1516

1617
module Payload::Windows::ReverseHttps
1718

19+
include Msf::Payload::TransportConfig
1820
include Msf::Payload::Windows::ReverseHttp
1921

2022
#

lib/rex/post/meterpreter/client_core.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,12 @@ def use(mod, opts = { })
296296
return true
297297
end
298298

299-
def uuid
299+
def uuid(timeout=nil)
300300
request = Packet.create_request('core_uuid')
301301

302-
response = client.send_request(request)
302+
args = [ request ]
303+
args << timeout if timeout
304+
response = client.send_request(*args)
303305

304306
id = response.get_tlv_value(TLV_TYPE_UUID)
305307

modules/payloads/stagers/windows/x64/reverse_https.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66

77
require 'msf/core'
8+
require 'msf/core/payload/transport_config'
89
require 'msf/core/handler/reverse_https'
910

1011
module Metasploit3
1112

1213
CachedSize = 578
1314

15+
include Msf::Payload::TransportConfig
1416
include Msf::Payload::Stager
1517
include Msf::Payload::Windows
1618

@@ -91,6 +93,13 @@ def initialize(info = {})
9193
))
9294
end
9395

96+
#
97+
# Generate the transport-specific configuration
98+
#
99+
def transport_config(opts={})
100+
transport_config_reverse_https(opts)
101+
end
102+
94103
#
95104
# Do not transmit the stage over the connection. We handle this via HTTPS
96105
#

0 commit comments

Comments
 (0)