简体   繁体   English

如何使用Scapy解析数据包的DNS部分的大小?

[英]How can I parse the size of the DNS section of a packet using scapy?

I am trying to only get the amount of bytes in the DNS section of the packet. 我正在尝试仅获取数据包的DNS部分中的字节数。 I have imported a pcap file and can iterate through each packet I am just confused since I don't see any way online to just get the amount of bytes of the DNS. 我已经导入了一个pcap文件,并且可以遍历我感到困惑的每个数据包,因为我看不到任何在线获取DNS字节数的方法。 Thanks! 谢谢!

Wireshark Cap Example Wireshark帽示例

In the above image how am I able to only get the bytes highlighted 在上图中,我如何只能突出显示字节

如果您使用的是Scapy,那就是len(packet[DNS])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM