“重播” tcpdump 文件
我正在编写一个程序来分析某些类型的数据包。我得到了包含 tcpdump 格式的测试数据包的转储文件。有什么方法可以将此转储发送到其中一个接口吗?我认为 tcpdump 能够自行完成此操作(不幸的是它不能)。我唯一能做的就是通过wireshark查看数据包(这显然不是可行的方法)。
我可以使用 libpcap 函数 pcap_open_offline()
,不幸的是我使用 pcap_loop()
,它似乎不适用于 pcap_open_offline()
并重写代码pcap_next()
会非常痛苦。有没有可以向接口发送数据包的程序?
I am writing a program for analyzing certain type of packets. I got the dump file containing test packets in tcpdump format. is there any way to send this dump into one of the interfaces? I thought tcpdump would be able to do this on its own (unfortunately it isn't). Only thing I managed to do is to look at packets via wireshark (which obviously isn't the way to go).
I could use libpcap function pcap_open_offline()
, unfortunately I use pcap_loop()
which doesn't seem to work with pcap_open_offline()
and rewriting code to pcap_next()
would be very painful. Is there any program that could send packets to the interface?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试查看 tcpreplay ,其目的是:
Did you try to take a look to tcpreplay that is done to :
新版本的 libpcap 提供了一个
pcap_inject()
函数,可用于将数据包写回。你可以在 UbuntuForums 上看到某人使用
pcap_inject()
的测试程序。Newer versions of libpcap provide a
pcap_inject()
function that can be used to write packets back out.You can see someone's testing program to use
pcap_inject()
over on UbuntuForums.