使用Mergecap合并多个抓包文件(Wireshark)

Mergecap语法:
[root@localhost exception_pcap]# mergecap -h
Mergecap 1.10.14 (Git Rev Unknown from unknown)
Merge two or more capture files into one.(//合并两个或者多个捕获文件到一个文件)
See http://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.                             //将数据包截断为<snaplen>字节的数据,-s后面必须跟一个十进制数字(默认是186字节)
  -w <outfile>|-    set the output filename to <outfile> or '-' for stdout.                       //设置(指定)输出文件名
  -F <capture type> set the output file type; default is pcapng.                                //设置输出文件类型;默认为pcapng
                    an empty "-F" option will list the file types.                                           //
  -T <encap type>   set the output file encapsulation type;                                      //设置输出文件封装类型
                    default is the same as the first input file.                                             //默认值与第一个输入文件相同。
                    an empty "-T" option will list the encapsulation types.                        //
Miscellaneous:
  -h                display this help and exit.                                                                 //显示帮助及退出
  -v                verbose output.                                                                                //输出参数

本人环境:Wireshark安装在C盘Program Files下的Wireshark文件夹中,源文件放在C盘packet文件夹下

使用方法:

1.使用管理员身份打开命令提示符

2.用cd命令打开Wireshark所在的路径

3.使用mergecap命令合并文件

注:

①如果不写具体的目标地址直接写生成后的文件名则合并后的文件在Wireshark安装目录下

②“*”符号为通配符

③命令提示符中输入的命令不可带中文,不然会报错

上述使用方法为本人亲测,若有问题欢迎交流

猜你喜欢

转载自blog.csdn.net/Alex_1117/article/details/114248617