blechschmidt / massdns

A high-performance DNS stub resolver for bulk lookups and reconnaissance (subdomain enumeration)
GNU General Public License v3.0
3.08k stars 460 forks source link

Errors when processing large file #97

Closed yr-or closed 3 years ago

yr-or commented 3 years ago

I'm struggling to find the cause of two errors that I get when I try to run massdns on a file of generated subdomains. Most of the subdomains are being resolved but I get the error "Error sending: Bad address" and "Error sending: Address family not supported by protocol" seemingly randomly. I've changed the hashmap-size and interval but still get this error. The subdomains being resolved all appear to be valid and were generated with alt-dns. Is there anyway to find out which subdomains exactly are causing this error?

I've also tried running it on a Ubuntu VM and Windows, both successfully compile and run, but give the same errors.

blechschmidt commented 3 years ago

Hi,

could you please run the code in branch issue-97 and post the additional output added to the error messages? (https://github.com/blechschmidt/massdns/tree/issue-97) In case the error appears again, could you please compile massdns using make asan (on Linux) and tell me if there are complaints by the address sanitizer?

yr-or commented 3 years ago

Here is an excerpt of the output, I used subdomains for google.com.

Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:4860:4860::8844]:53, query: A corpnat-104-132-118-85.corp.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:428::1]:53, query: A rate-limited-proxy-108-177-69-21.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:4b8:3:201::902]:53, query: A corpnat-104-132-84-85.corp.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2604:a880:0:1010::b:4001]:53, query: A corpnat-104-132-159-64.corp.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:4860:4860::8888]:53, query: A guestnat-104-132-220-105.corp.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:470:2351::1]:53, query: A mail-qt1-f175.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:67c:28a4::]:53, query: A png2-dev3-app02.corp.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:470:1f1a:78e::2]:53, query: A google-proxy-66-249-80-206.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2a0d:2a00:1::2]:53, query: A mail-wm1-f88.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:bc8:32d7:307::301]:53, query: A 60-199-175-174.cache.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2607:5300:203:439c::102]:53, query: A kpfe5.ad.corp.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2620:10a:80bb::20]:53, query: A guestnat-104-132-134-102.corp.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:470:2351:11::1]:53, query: A rate-limited-proxy-108-177-73-92.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:4b8:3:201::902]:53, query: A mail-vk1-f157.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:4860:4860::8888]:53, query: A guestnat-104-133-90-96.corp.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2607:5300:203:1797::53]:53, query: A rate-limited-proxy-108-177-69-84.google.com.) Error sending: Address family not supported by protocol (fd: 6, resolver: [2001:19f0:6401:b3d:5400:2ff:fe5a:fb9f]:53, query: A guestnat-104-132-125-103.corp.google.com.)

I have also found that these errors occur only when I use a custom nameservers.txt file from https://public-dns.info/ when I use the included resolvers.txt file, it appears to run correctly, also from the output from the Issue-97 branch I can see that it is only the IPV6 resolvers that are causing the error. However when trying the exact same nameservers file on a new linux installation on a separate network, it appears to run perfectly fine.

Here is the output from make asan:

mkdir -p bin cc -O0 -g -DDEBUG -std=c11 -DHAVE_EPOLL -DHAVE_SYSINFO -Wall -fstack-protector-strong -fsanitize=address -lasan src/main.c -o bin/massdns

blechschmidt commented 2 years ago

Today I also encountered this bug which should have been fixed by 2b394082ea8b45b850718861185194920604e49d. The commit message includes a detailed description of the issue.