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

#can_cleanupObject

Returns the value of attribute can_cleanup


14
15
16
# File 'lib/msf/core/payload/pingback.rb', line 14

def can_cleanup
  @can_cleanup
end

#pingback_uuidObject

Returns the value of attribute pingback_uuid


13
14
15
# File 'lib/msf/core/payload/pingback.rb', line 13

def pingback_uuid
  @pingback_uuid
end

Instance Method Details

#generate_pingback_uuidObject

Generate a Pingback UUID and write it to the database


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

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

#initialize(info = {}) ⇒ Object


34
35
36
37
38
# File 'lib/msf/core/payload/pingback.rb', line 34

def initialize(info = {})
  super(info)
  self.can_cleanup = false
  self
end