我想通过Bash或Python自动检索的信息是查看DIS协议捕获的数据包时最后一层的“数据包详细信息”窗格中包含的信息。
到目前为止,我已经达到了可以使用Python中的Scapy库读取Packet Bytes窗格信息的程度,但这对我来说很难解释/使用。
from scapy.all import sniff
capture = sniff(filter="dst 10.6.255.255 and port 3000", count=5)
packet = capture[0]
print(packet.show())
raw = packet.lastlayer()
from scapy.utils import hexdump
hexdump(raw)
有没有什么办法可以使用Python或Bash获取Packet Details窗格信息?
你尝试过这样的事情:
tshark -r file.pcap -O dis
甚至
tshark -r file.pcap -Y dis -T pdml > file.pdml
有关这些选项的更多信息,请参阅tshark man page;有关“数据包描述标记语言”的更多信息,请参阅Wireshark PDML wiki page。