3

I am using TShark command line in order to start new capture. If I use this command tshark.exe -w C:\test.pcap -i (my interface number) I save the capture on my hard drive and this is what need, but the output of this command shows the number of packets received, number that is updating all the time and this output I cannot get.

With this command: tshark.exe -i (my interface number) I can see the packet details, and I can get the process output in order to show it on my form (win form), and until now I could not find any command that would show me the packet details and save the capture file on my hard drive. If I use this command: tshark.exe -i (my interface number) -w C:\test.pcap I can save the capture but the output is like in the first example without the packet details. Maybe someone can help me with this?

2 Answers 2

3

Use the -V flag.

This enables verbose mode.

I would recommend this along with -x depending on the intensity and level of logging required.

Sign up to request clarification or add additional context in comments.

10 Comments

tshark.exe -i (int_number) -V -x -w C:\test.pcap should do the trick. Just tried it out on a Windows XP machine and worked.
first of all thanks, now i can see that the output of this command is all the packet details and only the ip and the protocol, is it possibly this output: 1.343007 192.168.0.100 -> 69.169.160.101 UDP 62 Source port: 62587 Destination port: 49500 without all the details ?
-x is supposed to output the ASCII/HEX packet data. Leave off the -V and try again.
still all the details, without -V and without -x
Hmm.. strange. Are you on Win Vista+? Try tshark.exe -i int -xqPlns 1500 > C:\text.pcap
|
3

tshark seems to be "tcpdump for windows"

you've got 2 options

1: modify tshark for your purpose (you'll probably need to know how to program in C)

2: write the raw output to a pipe and TEE it to a file and to your application. (or have your application read the pipe ans write the file)

1 Comment

How would you do option 2? I've tried, but with no luck: stackoverflow.com/questions/26177333/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.