丢弃数据包有效负载的工具?

发布于 2024-10-22 06:28:12 字数 229 浏览 1 评论 0原文

我正在尝试对我拥有的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撑一把青伞 2024-10-29 06:28:13

您不需要任何网络编程经验即可对数据包进行匿名化。输出文件的格式在 pcap-savefile(5) 联机帮助页。您需要查找要处理的各种协议的布局,以确定哪些字段需要匿名。您还应该查看链接层标头类型文档,网址为tcpdump.org 来帮助您入门。

编辑:还要看看 libpcap 本身...根据 pcap-savefile 联机帮助页:

注意:应用程序和库
如果可能的话,应该使用 libpcap
读取保存文件,而不是读取自己的代码
保存文件。
如果将来 libpcap 支持新的文件格式,
应用-
使用 libpcap 读取保存文件的系统和库将是
能够
读取新格式的保存文件,但应用程序和
图书馆使用
他们自己的读取保存文件的代码必须更改为
支持
新的文件格式。

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:

NOTE: applications and libraries
should, if possible, use libpcap to
read savefiles, rather than having their own code to read
savefiles.
If, in the future, a new file format is supported by libpcap,
applica-
tions and libraries using libpcap to read savefiles will be
able to
read the new format of savefiles, but applications and
libraries using
their own code to read savefiles will have to be changed to
support the
new file format.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文