Module: Msf::Payload::Pingback

Defined in:
lib/msf/core/payload/pingback.rb

Overview

This class provides methods for calculating, extracting, and parsing unique ID values used by payloads.

Defined Under Namespace

Modules: Options

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pingback_uuidObject

Returns the value of attribute pingback_uuid.



11
12
13
# File 'lib/msf/core/payload/pingback.rb', line 11

def pingback_uuid
  @pingback_uuid
end

Instance Method Details

#generate_pingback_uuidObject

Generate a Pingback UUID and write it to the database



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/msf/core/payload/pingback.rb', line 14

def generate_pingback_uuid
  self.pingback_uuid ||= SecureRandom.uuid()
  self.pingback_uuid.to_s.gsub!("-", "")
  datastore['PingbackUUID'] = self.pingback_uuid
  vprint_status("PingbackUUID = #{datastore['PingbackUUID']}")
  if framework.db.active
    vprint_status("Writing UUID #{datastore['PingbackUUID']} to database...")
    framework.db.create_payload(name: datastore['PayloadUUIDName'],
                         uuid: datastore['PingbackUUID'],
                         description: 'pingback',
                         platform: platform.platforms.first.realname.downcase)
  else
    print_warning("Unable to save UUID #{datastore['PingbackUUID']} to database -- database support not active")
  end
  self.pingback_uuid
end