- Wireshark Revealed:Essential Skills for IT Professionals
- James H Baxter Yoram Orzach Charit Mishra
- 286字
- 2021-07-02 21:22:38
Editing trace files with Editcap
You can use Editcap to split a trace file that is too large to work with in Wireshark into multiple smaller files, extract a subset of a trace file based on a start and stop time, alter timestamps, remove duplicate packets, and a number of other useful functions.
Type editcap –h
in the command prompt for a list of options. The syntax to extract a single packet or a range of packets by packet numbers is as follows:
editcap –r <infile> <outfile> <packet#> [- <packet#>]
You must specify <infile>
and <outfile>
. The –r
specifies to keep, not delete, the specified packet or packet range, for example:
editcap –r MergedTraces.pcapng packetrange.pcapng 1-5000
You can split a source trace file into multiple sequential files, each containing the number of packets specified by the –c
option:
editcap –c 5000 MergedTraces.pcapng SplitTrace.pcapng
You can eliminate duplicate packets in a file within a five-packet proximity:
editcap –d hasdupes.pcapng nodupes.pcapng
If you have two trace files that have a significant span of time between them, and you want to merge them into one file but closer together, you can investigate all of the packets within one IO Graph or a similar analysis function; you can first use the –t
option on one of the files to adjust the timestamps in that file by a constant amount (in seconds). For example, to subtract 5 hours from a trace file's timestamps, use the following command:
editcap -t -18000 packetrange.pcapng adj_packetrange.pcapng
Comparing the two traces in Wireshark reveals the following details:
- Packet #500 before adjustment:
2014-09-04 15:27:38.696897
- Packet #500 after adjustment:
2014-09-04 10:27:38.696897
You can get more information on and examples of Editcap options at https://www.wireshark.org/docs/man-pages/editcap.html.
- 21天學(xué)通PHP
- 基于LabWindows/CVI的虛擬儀器設(shè)計(jì)與應(yīng)用
- Natural Language Processing Fundamentals
- 統(tǒng)計(jì)策略搜索強(qiáng)化學(xué)習(xí)方法及應(yīng)用
- 基于ARM 32位高速嵌入式微控制器
- Photoshop CS3圖層、通道、蒙版深度剖析寶典
- 變頻器、軟啟動(dòng)器及PLC實(shí)用技術(shù)260問(wèn)
- 工業(yè)機(jī)器人應(yīng)用案例集錦
- 筆記本電腦維修90個(gè)精選實(shí)例
- C++程序設(shè)計(jì)基礎(chǔ)(上)
- 精通LabVIEW程序設(shè)計(jì)
- 電氣控制及Micro800 PLC程序設(shè)計(jì)
- 軟測(cè)之魂
- CPLD/FPGA技術(shù)應(yīng)用
- 電機(jī)與電力拖動(dòng)