使用TCPREPLAY将时间戳添加到数据包有效载荷

使用TCPREPLAY将时间戳添加到数据包有效载荷

本文介绍了使用TCPREPLAY将时间戳添加到数据包有效载荷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个pcap文件要重播.我想重写数据包有效载荷以包含时间戳.如何使用 tcpreplay tcprewrite ?是否有默认选项,还是我应该自己实现(修改tcpreplay)?我已经阅读这些页面一段时间了,谷歌也没有帮助我.预先感谢

I have a pcap file to replay. I want to rewrite packet payload to include a timestamp. How can I do that with tcpreplay or tcprewrite? Is there a default option or should I implement it myself (modifying tcpreplay)? I have been reading these pages for a while and google did not help me either. Thanks in advance

PS:我不想修改数据包的原始大小,因为数据并不重要,覆盖就可以了.如果唯一的选择是修改数据包大小,那我也可以.

PS: I don't want to modify the original size of the packet, since the data is not important overwriting is fine. If only option is to modify packet size, I am fine with that too.

推荐答案

tcpreplay/tcprewrite不支持这种编辑,因此您必须自己编写代码.如果您不介意破坏数据包数据(听起来还可以),那么通过编辑tcpedit.c应该很容易.

That kind of editing isn't supported by tcpreplay/tcprewrite, so you'd have to write the code yourself. If you don't mind corrupting your packet data (which sounds like you're ok with) then it should be pretty easy by editing tcpedit.c.

这篇关于使用TCPREPLAY将时间戳添加到数据包有效载荷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 00:06