1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-12 11:52:01 +01:00

Land 9207, Expose more uuid attributes

This commit is contained in:
bwatters-r7 2017-11-29 16:25:05 -06:00
commit e8965767a0
No known key found for this signature in database
GPG Key ID: ECC0F0A52E65F268
3 changed files with 21 additions and 5 deletions

View File

@ -634,7 +634,6 @@ class ReadableText
sess_via = session.via_exploit.to_s
sess_type = session.type.to_s
sess_uuid = session.payload_uuid.to_s
sess_puid = session.payload_uuid.respond_to?(:puid_hex) ? session.payload_uuid.puid_hex : nil
sess_luri = session.exploit_datastore['LURI'] || "" if session.exploit_datastore
sess_enc = false
if session.respond_to?(:tlv_enc_key) && session.tlv_enc_key && session.tlv_enc_key[:key]
@ -652,10 +651,10 @@ class ReadableText
sess_checkin = "#{(Time.now.to_i - session.last_checkin.to_i)}s ago @ #{session.last_checkin.to_s}"
end
if session.payload_uuid.respond_to?(:puid_hex) && (uuid_info = framework.uuid_db[sess_puid])
if session.payload_uuid.registered
sess_registration = "Yes"
if uuid_info['name']
sess_registration << " - Name=\"#{uuid_info['name']}\""
if session.payload_uuid.name
sess_registration << " - Name=\"#{session.payload_uuid.name}\""
end
end

View File

@ -222,7 +222,16 @@ protected
s.set_from_exploit(assoc_exploit)
# Pass along any associated payload uuid if specified
s.payload_uuid = opts[:payload_uuid] if opts[:payload_uuid]
if opts[:payload_uuid]
s.payload_uuid = opts[:payload_uuid]
if s.payload_uuid.respond_to?(:puid_hex) && (uuid_info = framework.uuid_db[s.payload_uuid.puid_hex])
s.payload_uuid.registered = true
s.payload_uuid.name = uuid_info['name']
s.payload_uuid.timestamp = uuid_info['timestamp']
else
s.payload_uuid.registered = false
end
end
# If the session is valid, register it with the framework and
# notify any waiters we may have.

View File

@ -254,6 +254,10 @@ class Msf::Payload::UUID
self.xor1 = opts[:xor1]
self.xor2 = opts[:xor2]
self.timestamp = nil
self.name = nil
self.registered = false
if opts[:seed]
self.puid = self.class.seed_to_puid(opts[:seed])
end
@ -367,6 +371,10 @@ class Msf::Payload::UUID
self
end
attr_accessor :registered
attr_accessor :timestamp
attr_accessor :name
attr_reader :arch
attr_reader :platform