合并 pcap 包

合并 pcap 包


wireshark 界面合并

  1. 打开 1 个 pcap 包

2.菜单栏:File->Merge->选择另一个 pcap 包

查看 2 个包的时间关系

  1. File -> Save as …

mergecap 工具合并

该工具的路径一般为 /usr/bin/mergecap,如果没有,可在 wireshark 的安装目录下寻找。

使用方法:

mergecap [options] -w <outfile>|- <infile> [<infile> ...]

(base) qiancj@qiancj-HP-ZBook-G8:~/tools$ ./merge_cap-x86_64.AppImage -h
Mergecap (Wireshark) 3.2.3 (Git v3.2.3 packaged as 3.2.3-1)
Merge two or more capture files into one.
See https://www.wireshark.org for more information.

Usage: mergecap [options] -w <outfile>|- <infile> [<infile> ...]

Output:
  -a                concatenate rather than merge files.
                    default is to merge based on frame timestamps.
  -s <snaplen>      truncate packets to <snaplen> bytes of data.
  -w <outfile>|-    set the output filename to <outfile> or '-' for stdout.
  -F <capture type> set the output file type; default is pcapng.
                    an empty "-F" option will list the file types.
  -I <IDB merge mode> set the merge mode for Interface Description Blocks; default is 'all'.
                    an empty "-I" option will list the merge modes.

Miscellaneous:
  -h                display this help and exit.
  -v                verbose output.

测试:

Example

./merge_cap-x86_64.AppImage -w /home/qiancj/Documents/data/pcap/merge_test/merge_randy.pcap /home/qiancj/Documents/data/pcap/merge_test/*.pcap

(base) qiancj@qiancj-HP-ZBook-G8:~/tools$ ./merge_cap-x86_64.AppImage -w /home/qiancj/Documents/data/pcap/merge_test/merge_randy.pcap /home/qiancj/Documents/data/pcap/merge_test/*.pcap
(base) qiancj@qiancj-HP-ZBook-G8:~/tools$ ll /home/qiancj/Documents/data/pcap/merge_test
total 9552536
drwxrwxr-x 2 qiancj qiancj       4096 419 17:41 ./
drwxrwxr-x 5 qiancj qiancj       4096 419 17:10 ../
-rwxrwxr-x 1 qiancj qiancj 1984666815 412 13:51 1_00001_20230412101926.pcap*
-rwxrwxr-x 1 qiancj qiancj 2878536895 412 14:35 1_00014_20230412103200.pcap*
-rw-rw-r-- 1 qiancj qiancj 4918569132 419 17:41 merge_randy.pcap

wireshark 打开 merge_randy.pcap 文件,查看合并后的文件

与用UI界面一致!


欢迎关注公众号【三戒纪元】

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值