Class: Ronin::Recon::DNS::ReverseLookup

Inherits:
Ronin::Recon::DNSWorker show all
Defined in:
lib/ronin/recon/builtin/dns/reverse_lookup.rb

Overview

Performs reverse DNS lookup on an IP address and finds it's host name.

Constant Summary

Constants included from Mixins::DNS

Mixins::DNS::IDN, Mixins::DNS::RECORD_TYPES

Instance Attribute Summary

Attributes included from Mixins::DNS

#dns_resolver

Instance Method Summary collapse

Methods included from Mixins::DNS

#dns_get_a_address, #dns_get_a_addresses, #dns_get_a_record, #dns_get_a_records, #dns_get_aaaa_address, #dns_get_aaaa_addresses, #dns_get_aaaa_record, #dns_get_aaaa_records, #dns_get_address, #dns_get_addresses, #dns_get_any_records, #dns_get_cname, #dns_get_cname_record, #dns_get_hinfo_record, #dns_get_loc_record, #dns_get_mailservers, #dns_get_minfo_record, #dns_get_mx_records, #dns_get_name, #dns_get_names, #dns_get_nameservers, #dns_get_ns_records, #dns_get_ptr_name, #dns_get_ptr_names, #dns_get_ptr_record, #dns_get_ptr_records, #dns_get_record, #dns_get_records, #dns_get_soa_record, #dns_get_srv_records, #dns_get_txt_record, #dns_get_txt_records, #dns_get_txt_string, #dns_get_txt_strings, #dns_get_wks_records, #initialize

Methods inherited from Worker

accepts, concurrency, #initialize, intensity, outputs, register, run

Instance Method Details

#process(ip) {|host| ... } ⇒ Object

Reverse DNS looks up an IP address and finds it's host name.

Parameters:

Yields:

  • (host)

Yield Parameters:



51
52
53
54
55
56
57
58
# File 'lib/ronin/recon/builtin/dns/reverse_lookup.rb', line 51

def process(ip)
  unless ip.host
    # NOTE: only query IP addresses not associated with a hostname
    dns_get_ptr_names(ip.address).each do |host_name|
      yield Host.new(host_name.chomp('.'))
    end
  end
end