-
Notifications
You must be signed in to change notification settings - Fork 20
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
updated dnscommon for NS, PTR, MX records and enhancement for 'AAAA' and 'TXT' records #166
base: master
Are you sure you want to change the base?
Conversation
updated dnsquery.r2py and librepy.r2py for DNS measurements. |
if answer_type in simple_answers: | ||
read_index, resource_data['address'] = _parse_answer_address(read_index, dns_query_data) | ||
elif answer_type == 'NS': | ||
read_index, resource_data['nameserver'] = _parse_address(read_index,dns_query_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please combine all the answer types that are treated the same way under a single elif
branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not combine all because when you query for MX or reverse or AAAA etc then you have additional section containing extra data. We don't need that but if we don't separate then packet dictionary will contain mixed details. So by separating, packet dictionary will contain all information with their respective query types.
for eg.
;; QUESTION SECTION:
;google.com. IN MX
;; ANSWER SECTION:
google.com. 600 IN MX 20 alt1.aspmx.l.google.com.
google.com. 600 IN MX 30 alt2.aspmx.l.google.com.
google.com. 600 IN MX 40 alt3.aspmx.l.google.com.
google.com. 600 IN MX 10 aspmx.l.google.com.
google.com. 600 IN MX 50 alt4.aspmx.l.google.com.
;; ADDITIONAL SECTION:
alt1.aspmx.l.google.com. 156 IN A 64.233.186.27
or
;google.com. IN NS
;; ANSWER SECTION:
google.com. 14400 IN NS ns4.google.com.
google.com. 14400 IN NS ns1.google.com.
google.com. 14400 IN NS ns2.google.com.
google.com. 14400 IN NS ns3.google.com.
;; ADDITIONAL SECTION:
ns1.google.com. 13328 IN A 216.239.32.10
ns2.google.com. 13956 IN A 216.239.34.10
ns3.google.com. 2225 IN A 216.239.36.10
ns4.google.com. 2315 IN A 216.239.38.10
|
patch for issue #167 , added code for NS and PTR type of queries separately.
_parse_answer_address was limited to converting answer into address but NS should provide naming servers for NS type of queries and domain name for PTR types.
After this code we have following results for NS and PTR types:
matches with - dig -x '173.252.120.6' (for facebook IP)
matches with - -dig google.com NS (for google's NS)
matches with - dig google.com MX
matches with - dig @8.8.8.8 google.com TXT
matches with - dig facebook.com AAAA