Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试对以前捕获的 Pcap 文件进行排序,我想构建一个 ip 源和目标列表,以便可以对它们进行计算。
我曾尝试使用搜索功能搜索 pcap 文件,但由于 IP 地址失败,有什么想法吗?
最终,我希望代码使用以下代码实时嗅探,然后在 ip 地址时建立一个列表。
newpkt = sniff(count = 100, prn=lambda x:x.sprintf("{IP:%IP.src% -> %IP.dst%\n} {Raw:%Raw.load%\n}"))
这是任何可能需要它的人的结果
from scapy.all import * pkts = rdpcap("capture.cap") test = "" for pkt in pkts: temp = pkt.sprintf("%IP.src%,%IP.dst%,") test = test + temp print test