Class: Rex::Post::Meterpreter::Extensions::Extapi::Ntds::Ntds

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

Overview

This meterpreter extension contains extended API functions for parsing the NT Directory Service database.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Ntds

Returns a new instance of Ntds.



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

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



34
35
36
# File 'lib/rex/post/meterpreter/extensions/extapi/ntds/ntds.rb', line 34

def client
  @client
end

Instance Method Details

#parse(filepath) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rex/post/meterpreter/extensions/extapi/ntds/ntds.rb', line 22

def parse(filepath)
  request = Packet.create_request(COMMAND_ID_EXTAPI_NTDS_PARSE)
  request.add_tlv( TLV_TYPE_NTDS_PATH, filepath)
  # wait up to 90 seconds for a response
  response = client.send_request(request, 90)
  channel_id = response.get_tlv_value(TLV_TYPE_CHANNEL_ID)
  if channel_id.nil?
    raise Exception, "We did not get a channel back!"
  end
  Rex::Post::Meterpreter::Channels::Pool.new(client, channel_id, "extapi_ntds", CHANNEL_FLAG_SYNCHRONOUS, response)
end