Commit Graph

26 Commits

Author SHA1 Message Date
adfoster-r7 49a7caf097 Fix windows DNS crash on bootup 2024-10-01 13:04:27 +01:00
Stephen Fewer ad98d749ca Instead of only setting a single domain name via self.domain, set self.searchlist which already supports an array of items (thanks Spencer!).
Co-authored-by: Spencer McIntyre <58950994+smcintyre-r7@users.noreply.github.com>
2024-09-23 15:50:24 +01:00
sfewer-r7 9be50f74a8 The first array item will either be nil, or an array of domain names, so we pick the first one to avoid a NoMethodError for a =~ operation on an array object, during a call to the method valid? 2024-09-19 10:40:01 +01:00
Spencer McIntyre cf6d324832 Nameservers from resolv.conf must be IP addresses
Fixes an infinite recursion error where Metasploit would attempt to
resolve a nameserver specified as a hostname in /etc/resolv.conf while
initializing.

Values for the namserver key in the resolv.conf file must be IP
addresses per the man page while the Resolver class in theory allows
them to be added by hostname however an existing one must be defined by
which it will be resolved.

This notably prevents IPv6 addresses with a scope ID from being allowed
in Ruby versions < 3.1.
2024-04-25 16:21:04 -04:00
Spencer McIntyre 20f73867ca Print the default domain and search list too 2024-02-08 11:22:32 -05:00
adfoster-r7 7ce13101df Ensure DNS command config loading does not crash msfconsole 2024-01-29 13:23:18 +00:00
adfoster-r7 f56c9fc9ac Land #18662, Fix dns resolution skipping over nameservers with valid responses 2024-01-19 16:44:16 +00:00
h00die 6a851855a8 spelling fixes for lib folder 2024-01-06 15:54:49 -05:00
Dean Welch f92b2662c4 Fix dns resolution skipping over nameservers with valid responses 2024-01-04 14:10:45 +00:00
Ashley Donaldson 473ded345b Fix UDP detection when DNS resolution is not on 2023-11-23 10:34:09 +11:00
bcoles 431804ef15 Fix typos: Replace 'the the' with 'the' 2022-12-04 17:41:24 +11:00
Jon Hart a2a932e176 Dont store AXFR answers if there are no answers 2016-02-04 10:28:11 -08:00
Jon Hart 6882bf275e Break out of the wait loop for this ns after a response is received 2016-02-04 10:07:53 -08:00
jvazquez-r7 6962fcf2fd Check the query result before accessing the header 2015-08-24 09:22:42 -05:00
HD Moore c80017992a A dirty patch for a number of Net::DNS/dns_enum issues 2015-06-06 13:48:52 -05:00
Tab Assassin 7e5e0f7fc8 Retab lib 2013-08-30 16:28:33 -05:00
Tod Beardsley 2bfe5ee5a6 Add a ResolverError class 2012-09-04 19:20:31 -05:00
Tod Beardsley e128fc87f2 Looks like it should be ResolverError 2012-09-04 19:19:53 -05:00
Daniel Miller 1aa83b830f Let Resolver#send_tcp take a block
This solves the looping problem. Since the TCP connection wouldn't
necessarily close, we couldn't count on a 0-length recv, and the
connection was timing out. Changed it so send_tcp can take a block, in
which we do parsing. AXFR responses are sandwiched between SOA answers,
so when the second one is reached, the transfer is done.

This is also cleaner for existing code that uses send_tcp, since if no
block is passed, it just returns the first response and tears down the
connection, just like it used to.
2012-08-20 20:51:18 -05:00
Daniel Miller c015121dc0 Make Resolver#axfr use Resolver#send_tcp
This required some changes to send_tcp: it now loops, reading as many
length-prefixed DNS responses as are available before the connection
closes. This shouldn't affect other uses of the function, since most
questions only have one response in answer.
2012-08-19 17:21:37 -05:00
Daniel Miller 7005216d1f Fix axfr support for auxiliary/gather/enum_dns
AXFR support in net-dns is broken. This fixes it, and makes the
requisite modifications to enum_dns module. Basic problem is that AXFR
responses consist of a chain of DNS replies, not a single reply with
multiple answers. Previously, only the first of these replies, the SOA
record, was returned. Also added some exception handling to avoid
problems like #483.
2012-08-16 20:40:24 -05:00
HD Moore d656e3185f Mark all libraries as defaulting to 8-bit strings 2012-06-29 00:18:28 -05:00
HD Moore 1b5cc24eab See #434. Some libraries used the wrong exception class
git-svn-id: file:///home/svn/framework3/trunk@7325 4d416f70-5f16-0410-b530-b9f4589650da
2009-11-02 18:20:02 +00:00
Ramon de C Valle f124597a56 Code cleanups
git-svn-id: file:///home/svn/framework3/trunk@5773 4d416f70-5f16-0410-b530-b9f4589650da
2008-10-19 21:03:39 +00:00
HD Moore 30e29858a2 Fix the resolver on darwin
git-svn-id: file:///home/svn/framework3/trunk@5598 4d416f70-5f16-0410-b530-b9f4589650da
2008-07-25 22:42:04 +00:00
HD Moore b70ce0ae10 Import the Net-DNS library
git-svn-id: file:///home/svn/framework3/trunk@5574 4d416f70-5f16-0410-b530-b9f4589650da
2008-07-23 17:32:05 +00:00