有人可以告诉我如何使用 tcpdump 过滤掉特定源和目标 ip 上的 udp 或 tcp 流量并将输出保存到 csv 文件中吗? 如果我可以使用 etl 工具将 pcap 文件转换为 csv,则不需要 csv 文件。
此外,我对收集数据时的 100 毫秒时间分辨率感兴趣,我可以使用 tcpdump 实现吗?
谢谢。
最佳答案
您可以使用 this link 中说明的方法其中解释了一种使用 tshark 的方法。
# tshark -r traffic.pcap -T fields -e ip.src -E separator=, -E occurrence=f > traffic.csv
-r: to read the .pcap file.
-T fields: different fields which are needed to capture.
-E separator: if there are multiple fields extracting separator is used to differentiate.
-E occurrence: Which occurrence is used for the field which has multiple occurrence, ‘f’ is for first and it store the fields inside the .csv file.Multiple fields
# tshark -r traffic.pcap -T fields -e ip.src -e frame.len -e ip.proto -E separatorr=, -E occurrence=f > traffic.csv
关于networking - tcpdump 将 tcp 流量过滤到 csv 文件中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37410687/