Path: blob/master/lib/rex/post/meterpreter/extensions/extapi/ntds/ntds.rb
19639 views
# -*- coding: binary -*-12module Rex3module Post4module Meterpreter5module Extensions6module Extapi7module Ntds89###10#11# This meterpreter extension contains extended API functions for12# parsing the NT Directory Service database.13#14###15class Ntds1617def initialize(client)18@client = client19end2021def parse(filepath)22request = Packet.create_request(COMMAND_ID_EXTAPI_NTDS_PARSE)23request.add_tlv( TLV_TYPE_NTDS_PATH, filepath)24# wait up to 90 seconds for a response25response = client.send_request(request, 90)26channel_id = response.get_tlv_value(TLV_TYPE_CHANNEL_ID)27if channel_id.nil?28raise Exception, "We did not get a channel back!"29end30Rex::Post::Meterpreter::Channels::Pool.new(client, channel_id, "extapi_ntds", CHANNEL_FLAG_SYNCHRONOUS, response)31end3233attr_accessor :client3435end3637end; end; end; end; end; end38394041