我正在尝试执行以下步骤:
是否可以提取这样的信息?
我编写了Python类来提取Packet Header,Packet的Ethernet,Packet IP,Packet TCP信息。我需要可以提取这样的信息的指导吗? hva_pcao.py,hva_pckt rdr = pcap.open_offline('xsupport.pcap')
i = 0
for hdr, data in rdr:
if i ==2:
print(hdr)
eth = Eth.decode(data)
if eth is None: continue
print(str(eth))
ip = Ip.decode(eth.pl)
if ip is None: continue
print(str(ip))
tcp = Tcp.decode(ip.pl)
if tcp is None: continue
print(str(tcp))
print((repr(tcp.flags) + " - " + repr(tcp.kFlags_FIN) + " * " + repr(tcp.kFlags_ACK)))
# break
我的预期输出是:分析数据包并显示未正确设置的连接