Class/Module Index [+]

Quicksearch

Rex::Post::Meterpreter::Extensions::Lanattacks::Lanattacks

This meterpreter extension can currently run DHCP and TFTP servers

Public Class Methods

new(client) click to toggle source
# File lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb, line 17
def initialize(client)
        super(client, 'lanattacks')

        client.register_extension_aliases(
                [{
                                'name' => 'lanattacks',
                                'ext'  => self
                 },])
end

Public Instance Methods

add_tftp_file(filename, data) click to toggle source
# File lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb, line 83
def add_tftp_file(filename, data)
        request = Packet.create_request('lanattacks_add_tftp_file')
        request.add_tlv(TLV_TYPE_LANATTACKS_OPTION_NAME, filename)
        request.add_tlv(TLV_TYPE_LANATTACKS_RAW, data, false, true) #compress it
        client.send_request(request)
        true
end
dhcp_log() click to toggle source
# File lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb, line 59
def dhcp_log
        response = client.send_request(Packet.create_request('lanattacks_dhcp_log'))
        entries = []
        if( response.result == 0 )
                log = response.get_tlv_value( TLV_TYPE_LANATTACKS_RAW )
                while log.length > 0
                        mac = log.slice!(0..5)
                        ip = log.slice!(0..3)
                        entries << [ mac, ip ]
                end
        end
        entries
end
load_dhcp_options(datastore) click to toggle source
# File lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb, line 45
def load_dhcp_options(datastore)
        datastore.each do |name, value|
                if Regexp.new('DHCPIPSTART|DHCPIPEND|NETMASK|ROUTER|DNSSERVER|BROADCAST|'+
                                'SERVEONCE|PXE|HOSTNAME|HOSTSTART|FILENAME|PXECONF|SRVHOST') =~ name
                        set_dhcp_option(name,value)
                end
        end
end
reset_dhcp() click to toggle source
# File lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb, line 32
def reset_dhcp
        client.send_request(Packet.create_request('lanattacks_reset_dhcp'))
        true
end
reset_tftp() click to toggle source
# File lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb, line 78
def reset_tftp
        client.send_request(Packet.create_request('lanattacks_reset_tftp'))
        true
end
set_dhcp_option(name, value) click to toggle source
# File lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb, line 37
def set_dhcp_option(name, value)
        request = Packet.create_request('lanattacks_set_dhcp_option')
        request.add_tlv(TLV_TYPE_LANATTACKS_OPTION_NAME, name)
        request.add_tlv(TLV_TYPE_LANATTACKS_OPTION, value)
        client.send_request(request)
        true
end
start_dhcp() click to toggle source
# File lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb, line 27
def start_dhcp
        client.send_request(Packet.create_request('lanattacks_start_dhcp'))
        true
end
start_tftp() click to toggle source
# File lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb, line 73
def start_tftp
        client.send_request(Packet.create_request('lanattacks_start_tftp'))
        true
end
stop_dhcp() click to toggle source
# File lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb, line 54
def stop_dhcp
        client.send_request(Packet.create_request('lanattacks_stop_dhcp'))
        true
end
stop_tftp() click to toggle source
# File lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb, line 91
def stop_tftp
        client.send_request(Packet.create_request('lanattacks_stop_tftp'))
        true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.