You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Pyshark to parse different types of packets.
For some reason, I cannot get all the DNS answers.
there are two issues, first, not all answers are available to get. I have a packet which shows 4 different Answers in Wireshark, but only one answer is shown in the dns.Answers object, or have another packet which has 11 answers in Wireshark, but only 3 are showing in the object.
The second issue is a unique and stable way to get the answers. for some packets, I can get the only answer using answer = getattr(dns.Answers, dns.Answers.field_names[0]). But for packets with more answers, this doesn't work. and I need to get all dns.Answers.field_names, and loop through them to see which one is a domain, sample result might be like this: ['net', 'e28578.d.akamaiedge.net', 'assets.msn.com', 'assets.msn.com.edgekey.net', 'com'] and I need to discard .net and .com entries, and get the name of the domains and access the actual answer object.
Not sure if I'm doing something wrong here or this is a bug, or... Looked in the wiki and searched I the web but couldn't find anything.
Appreciate your help.
The text was updated successfully, but these errors were encountered:
Hello Everyone,
I'm using Pyshark to parse different types of packets.
For some reason, I cannot get all the DNS answers.
there are two issues, first, not all answers are available to get. I have a packet which shows 4 different Answers in Wireshark, but only one answer is shown in the
dns.Answers
object, or have another packet which has 11 answers in Wireshark, but only 3 are showing in the object.The second issue is a unique and stable way to get the answers. for some packets, I can get the only answer using
answer = getattr(dns.Answers, dns.Answers.field_names[0])
. But for packets with more answers, this doesn't work. and I need to get alldns.Answers.field_names
, and loop through them to see which one is a domain, sample result might be like this:['net', 'e28578.d.akamaiedge.net', 'assets.msn.com', 'assets.msn.com.edgekey.net', 'com']
and I need to discard .net and .com entries, and get the name of the domains and access the actual answer object.Not sure if I'm doing something wrong here or this is a bug, or... Looked in the wiki and searched I the web but couldn't find anything.
Appreciate your help.
The text was updated successfully, but these errors were encountered: