You can also accomplish this by using command-line tools, which I find to be faster and simpler, and depending on your needs, can also be scripted. For example:
tshark -r file.pcap -Y dns.resp.ttl -T fields -e dns.resp.ttl -E aggregator=/s | sort -nr | head -1
This command:
- Utilizes the Wireshark command-line companion capture tool
tshark
to read the given file, filtering only for those packets containing a dns.resp.ttl field and then writing only that field to stdout
, which is then piped to sort
sort
is then instructed to conduct a reverse numeric sort (so highest-to-lowest value instead of the default lowest-to-highest) and pipe that output to head
head -1
will then display only the 1st line of output (instead of the default 10 lines), which will be the largest value ... probably*.
Refer to the tshark
man page for more details about the options I used, such as -Y
and -e
, and to the sort
and head
man pages for more details about those commands.
*You should know that it's possible for some DNS packets to contain more than one occurrence of the dns.resp.ttl field, so this command may not always give you the largest overall value if the largest value happens to be contained within a packet with multiple occurrences of that field and where it isn't the first occurrence. This is also true for the Wireshark solution though. In other words, when you sort the column from high-to-low, the largest value may not necessarily be the first one if a packet contains multiple occurrences of the field because the sort only takes into account the value of the first occurrence.