Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash due to DNS timeout #76

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

undergroundwires
Copy link
Contributor

@undergroundwires undergroundwires commented Jul 31, 2022

Fixes crash due to dns.resolver.LifetimeTimeout: The resolution lifetime expired after 19.275 seconds.

snallygaster crashes during axfr test if the DNS server of the target responds slowly.
It should not crash completely but instead pass the test as desired behavior.

During crash, snallygaster logs to stderr the following:

Traceback (most recent call last):
  File "/tools/snallygaster/bin/snallygaster", line 1022, in <module>
    test(host)
  File "/tools/snallygaster/bin/snallygaster", line 801, in test_axfr
    ipv4 = dns.resolver.resolve(r, 'a').rrset
  File "/tools/snallygaster/lib/python3.10/site-packages/dns/resolver.py", line 1193, in resolve
    return get_default_resolver().resolve(qname, rdtype, rdclass, tcp, source,
  File "/tools/snallygaster/lib/python3.10/site-packages/dns/resolver.py", line 1066, in resolve
    timeout = self._compute_timeout(start, lifetime,
  File "/tools/snallygaster/lib/python3.10/site-packages/dns/resolver.py", line 879, in _compute_timeout
    raise LifetimeTimeout(timeout=duration, errors=errors)
dns.resolver.LifetimeTimeout: The resolution lifetime expired after 19.275 seconds: 

And stdout to:

Oh oh... an unhandled exception has happened. This shouldn't be.
Please report a bug and include all output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant