Ask Your Question
0

-Q -P Tshark flags works fine for text but doesn't work for pcap

asked 2018-03-07 10:00:47 +0000

avi gravatar image

updated 2018-03-07 10:31:45 +0000

grahamb gravatar image

Dear reader,

I used the following line for getting the results in text file and it works fine. i.e. No notification messages in the error channel.

"C:\Program Files (x86)\Wireshark\tshark.exe" -Q -P -i 4 -Y "ip.dst==172.17.231.50&&icmp" -V -S 5%%%5 > C:\temp\output.txt

When trying to get the results in a pcap file, I received notification messages in the error channel.

"C:\\Program Files (x86)\\Wireshark\\dumpcap.exe" -i 4 -w - | "C:\\Program Files (x86)\\Wireshark\\tshark.exe" -Q -P -r - -Y "ip.dst==172.17.231.50&&icmp" -w "C:\\temp\\output.pcap"

Trying to add –P –Q to the first part yielded an error message saying: “C:\Program Files (x86)\Wireshark\dumpcap.exe: invalid option -- 'Q'”

"C:\Program Files (x86)\Wireshark\dumpcap.exe" -Q -P -i 4 -w - | "C:\Program Files (x86)\Wireshark\tshark.exe" -Q -P -r - -Y "ip.dst==172.17.231.50&&icmp" -w "C:\temp\output.pcap" C:\Program Files (x86)\Wireshark\dumpcap.exe: invalid option -- 'Q'

Is there a proper way of getting the captured packets into a pcap file without any notification messages in the error channel?

(The double backslash is because I’m activating the command with python)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-03-07 10:37:15 +0000

grahamb gravatar image

Dumpcap doesn't support a -Q flag, hence the error. Adding support to dumpcap for that would require an Enhancement request on the Wireshark Bugzilla.

Out of interest why are you piping through tshark to apply a display filter that could be handled as a capture filter in dumpcap, or is there more to it?

edit flag offensive delete link more

Comments

Thank you Grahm B, i've opened Bug 14491 at Bugzila. Regarding your question, it's an ancient line in a code written by someone. I'm trying to find him and pass him your question in order to answer you. Meanwhile, do I understand correctly that there is no way of exporting the data to pcap file without getting the notification messages in the error channel? (Till the bug will be fixed...)

avi gravatar imageavi ( 2018-03-07 13:10:15 +0000 )edit

I'm not aware of any, but others might know a way.

grahamb gravatar imagegrahamb ( 2018-03-07 13:38:08 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-03-07 10:00:47 +0000

Seen: 38 times

Last updated: Mar 07