import os
import pyshark
path = "C:./BGP/BGP\\"
files = os.listdir(path)
print(files)
for file in files:
ps = pyshark.FileCapture(path+file,tshark_path="C:\\Wireshark\\Wireshark.exe")
for pkt in ps:
try:
print(pkt.ip.get_field_by_showname('Protocol'))
print(pkt.ETH.get_field_by_showname('Source'))
print(pkt.ip.get_field_by_showname('Source'))
print(pkt.ip.get_field_by_showname('Destination'))
print(pkt.ip.get_field_by_showname('Flags'))
print(pkt.tcp.get_field_by_showname('Source Port'))
print(pkt.bgp.get_field_by_showname('Length'))
except Exception as e:
print("ETH/IP/BGP不存在")
pyshark抓包
最新推荐文章于 2025-04-28 10:38:11 发布
1885

被折叠的 条评论
为什么被折叠?



