hannob / snallygaster

Tool to scan for secret files on HTTP servers
BSD Zero Clause License
2.07k stars 228 forks source link

Exception after DNS timeout #55

Closed cweiske closed 3 years ago

cweiske commented 3 years ago

I ran snallygaster against some domains hosted in china that really take long to resolve, and it crashed:

...
[[debug]] Scanning birdytone.com
...
[[debug]] Running test_vb_test test
[[debug]] Running test_headerinject test
[[debug]] Running test_wpdebug test
[[debug]] Running test_axfr test
Traceback (most recent call last):
  File "/usr/local/bin/snallygaster", line 979, in <module>
    test(host)
  File "/usr/local/bin/snallygaster", line 758, in test_axfr
    ipv6 = dns.resolver.resolve(r, 'aaaa').rrset
  File "/usr/lib/python3/dist-packages/dns/resolver.py", line 1205, in resolve
    return get_default_resolver().resolve(qname, rdtype, rdclass, tcp, source,
  File "/usr/lib/python3/dist-packages/dns/resolver.py", line 1043, in resolve
    timeout = self._compute_timeout(start, lifetime)
  File "/usr/lib/python3/dist-packages/dns/resolver.py", line 950, in _compute_timeout
    raise Timeout(timeout=duration)
dns.exception.Timeout: The DNS operation timed out after 5.002015590667725 seconds
Oh oh... an unhandled exception has happened. This shouldn't be.
Please report a bug and include all output.

called with
/usr/local/bin/snallygaster -d api.libratone.com birdytone.com birdytone.com.cn ask.birdytone.com ask.birdytone.com.cn
hannob commented 3 years ago

I can't reproduce it here, but it is probably wise to handle this timeout exception. Done with https://github.com/hannob/snallygaster/commit/bd59a246de281729d6102504707e25b7b83188f8