代码之家  ›  专栏  ›  技术社区  ›  Austin

Wireshark数据包详细信息窗格信息与tshark或scapy?

  •  -1
  • Austin  · 技术社区  · 6 年前

    我想通过Bash或Python自动检索的信息是在查看DIS协议捕获的数据包时,最后一层的数据包详细信息窗格中包含的信息。

    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获得packetdetails窗格信息?

    2 回复  |  直到 6 年前
        1
  •  1
  •   Christopher Maynard    6 年前

    你有没有试过这样的方法:

    tshark -r file.pcap -O dis
    

    tshark -r file.pcap -Y dis -T pdml > file.pdml
    

    tshark man page 有关这些选项的详细信息,请访问 Wireshark PDML wiki page 有关“数据包描述标记语言”的详细信息。

        2
  •  0
  •   Cukic0d    6 年前

    你很酷 packet.show() 看起来有点像wireshark的函数

    enter image description here

    您也可以尝试pdf转储 packet.pdfdump()

    enter image description here