-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feature request: return CODE #17
Comments
I found the return code but to be more precise I would like to have all the information massdns provides. Can you point me out where these fields exist in the DNSMessage returned by resolver.query? Example:
|
async_dns/async_dns/core/record.py Lines 233 to 246 in 03fede6
|
The SERVFAIL status currently raises an Assertion Exception. I believe, the DNSMessage should be returned and it should be up to the developer to determine what to do with that status. Another solution would be having an specific query method that does that. What do you think? python -m async_dns.resolver -n 8.8.8.8 -t a -- message.acronis.com
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/kali/Documents/mapless/samples/.venv/lib/python3.8/site-packages/async_dns/resolver/__main__.py", line 57, in <module>
loop.run_until_complete(resolve_hostnames(_parse_args()))
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/kali/Documents/mapless/samples/.venv/lib/python3.8/site-packages/async_dns/resolver/__main__.py", line 46, in resolve_hostnames
res = fut.result()
File "/home/kali/Documents/mapless/samples/.venv/lib/python3.8/site-packages/async_dns/resolver/__main__.py", line 24, in resolve_hostname
return await resolver.query(hostname, qtype)
File "/home/kali/Documents/mapless/samples/.venv/lib/python3.8/site-packages/async_dns/resolver/__init__.py", line 38, in query
result, _cached = await self.query_with_timeout(fqdn, qtype, timeout, tick)
File "/home/kali/Documents/mapless/samples/.venv/lib/python3.8/site-packages/async_dns/resolver/__init__.py", line 51, in query_with_timeout
return await asyncio.wait_for(self._query(fqdn, qtype, tick), timeout)
File "/usr/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
return fut.result()
File "/home/kali/Documents/mapless/samples/.venv/lib/python3.8/site-packages/async_dns/resolver/__init__.py", line 66, in _query
return await self._query_once(fqdn, qtype, tick)
File "/home/kali/Documents/mapless/samples/.venv/lib/python3.8/site-packages/async_dns/resolver/query.py", line 33, in query
remote_res = await self.query_remote(domain, nameservers)
File "/home/kali/Documents/mapless/samples/.venv/lib/python3.8/site-packages/async_dns/resolver/query.py", line 90, in query_remote
inter_res = await self.query_remote_once(domain, nameservers)
File "/home/kali/Documents/mapless/samples/.venv/lib/python3.8/site-packages/async_dns/resolver/query.py", line 148, in query_remote_once
inter_res = await self.request_remote(nameservers, req)
File "/home/kali/Documents/mapless/samples/.venv/lib/python3.8/site-packages/async_dns/resolver/query.py", line 178, in request_remote
raise last_err
File "/home/kali/Documents/mapless/samples/.venv/lib/python3.8/site-packages/async_dns/resolver/query.py", line 160, in request_remote
assert inter_res.r != 2, 'Remote server fail'
AssertionError: Remote server fail |
Or maybe have an specific Exception type so handling it is more straight forward. |
I agree with this, so there should be a way to make a raw response. |
can you write the code here |
There is a client to get the raw response from remote server now. See readme for more detail. |
In some applications it is useful to know which was the DNS reply return code, specially SERVFAIL, NXDOMAIN and REFUSED. I am trying to use the lib to build a DNS brute-forcer for domain enumeration and performance looks great. However it would be of great value to also store those failed requests to detect subdomain takeover opportunities.
If you can give me some basic guidance I could probably implement this myself.
Thanks!
The text was updated successfully, but these errors were encountered: