Sha256: 8f137bc3e6888256bfde34e3be1f48ec3a1e89a028019766dd210dfb9c0b114e

Contents?: true

Size: 1.3 KB

Versions: 5

Compression:

Stored size: 1.3 KB

Contents

# -*- coding: binary -*-

module Rex
  module Post
    module Meterpreter
      module Extensions
        module Extapi
          module Pageant
            ###
            # PageantJacker extension - Hijack and interact with Pageant
            #
            # Stuart Morgan <stuart.morgan@mwrinfosecurity.com>
            #
            ###
            class Pageant
              def initialize(client)
                @client = client
              end

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

                packet_request = Packet.create_request('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

              attr_accessor :client
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rex-2.0.13 lib/rex/post/meterpreter/extensions/extapi/pageant/pageant.rb
rex-2.0.12 lib/rex/post/meterpreter/extensions/extapi/pageant/pageant.rb
rex-2.0.11 lib/rex/post/meterpreter/extensions/extapi/pageant/pageant.rb
rex-2.0.10 lib/rex/post/meterpreter/extensions/extapi/pageant/pageant.rb
rex-2.0.9 lib/rex/post/meterpreter/extensions/extapi/pageant/pageant.rb