First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

the capture file appears to be damaged or corrupt

i use "tshark -n -i8 -V -x > output.pcap" to write data in the file, when i open the file by wireshare, appear the error, how can I solve the error,thanks.

My wireshark version is 3.2.4 and OS is windows 10

jasonwenst's avatar
3
jasonwenst
asked 2020-06-12 15:13:02 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

To write a pcap file use the -w option, e.g.

tshark -n -i8 -F pcap w output.pcap

Note the -V and -xoptions have been removed as they are used for text output, not pcap output and the -F pcap option has been added to change the output file type to pcap instead of the default pcapng. If you're happy with pcapng, then you can omit the -F pcap option.

Without the -w option, TShark writes a text file containing information from dissecting the packet (the command in the question will write out packet details, in a fashion similar to what Wireshark shows in the packet details pane). Wireshark can't read those files.

grahamb's avatar
23.8k
grahamb
answered 2020-06-12 15:52:22 +0000
Guy Harris's avatar
19.9k
Guy Harris
updated 2020-06-12 19:06:21 +0000
edit flag offensive 0 remove flag delete link

Comments

use 'tshark -n -i8 -V -x -w output.pcap' the file can opend by wireshark, but it looks like the filesize is limited, the output file should about 4MB , but it always stop writing data when the filesize is 800KB, so i try to use '>' to write the data.

jasonwenst's avatar jasonwenst (2020-06-13 01:46:57 +0000) edit

How are you stopping the capture or is there a message displayed that it was ended?

Chuckc's avatar Chuckc (2020-06-13 02:02:20 +0000) edit

-a duration:60 i use this

jasonwenst's avatar jasonwenst (2020-06-13 02:30:01 +0000) edit

tshark is making a call to dumpcap for capture.
Here is an example running for 10 seconds:

$ dumpcap.exe -i4 -a duration:10 -w output.pcap
Capturing on 'Ethernet'
File: output.pcap
Packets captured: 99
Packets received/dropped on interface 'Ethernet': 99/0 (pcap:0/dumpcap:0/flushed:0/ps_ifdrop:0) (100.0%)


If you run dumpcap.exe -i8 -a duration:60 -w output.pcap is the file size different?

Chuckc's avatar Chuckc (2020-06-13 02:51:20 +0000) edit

in real scenario i use the command tshark -n -i8 -V -x -a duration:3600 -w output.pcap and the filesize is 800KB my test command is tshark -n -i8 -V -x -a duration:600 -w output.pcap

and the filesize is 400KB, they are in a same server, maybe is the filesize limited, if use 60 second, the filesize is equals.

jasonwenst's avatar jasonwenst (2020-06-13 03:24:07 +0000) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer