丢弃数据包有效负载的工具?
我正在尝试对我拥有的 pcap 文件中的数据包进行匿名化。我需要丢弃所有数据包有效负载/内容(只留下标头信息),并且想知道是否有一个工具可以用于此目的(在 Linux 上)?我曾考虑过使用 tcpdump 来指定 snaplen,但随着标头长度的变化,我认为这行不通。
如果没有一个工具可以完成此任务,那么指向哪个编码库最好(最简单)的方向也可以。我不想走这条路,因为我几乎没有网络编程经验。
非常感谢任何帮助。
I'm trying to anonymize packets from a pcap file that I have. I need to discard all the packets payloads/content (leaving only header information) and was wondering if there would be a tool that I could use for this (on Linux)? I have thought about using tcpdump with specifying the snaplen but with the header length changing, I don't think that would work.
If there isn't a tool that could accomplish this, a point in the direction of what library for coding would be best(easiest) would work as well. I'd rather not take that route since I have virtually no experience in network programming.
Any help is much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要任何网络编程经验即可对数据包进行匿名化。输出文件的格式在 pcap-savefile(5) 联机帮助页。您需要查找要处理的各种协议的布局,以确定哪些字段需要匿名。您还应该查看链接层标头类型文档,网址为tcpdump.org 来帮助您入门。
编辑:还要看看 libpcap 本身...根据 pcap-savefile 联机帮助页:
You don't need any network programming experience to anonymize the packets. The format of the output file is well documented in the pcap-savefile(5) manpage. You will need to lookup the layouts of the various protocols you'll be handling in order to identify what fields need to be anonymized. You should also look at the link layer header types documentation at tcpdump.org to help you get started.
EDIT: Also look at libpcap itself... according to the pcap-savefile manpage: