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

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

  • retag add tags

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)

avi's avatar
5
avi
asked 2018-03-07 10:00:47 +0000
grahamb's avatar
23.8k
grahamb
updated 2018-03-07 10:31:45 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

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?

grahamb's avatar
23.8k
grahamb
answered 2018-03-07 10:37:15 +0000
edit flag offensive 0 remove flag delete link

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's avatar avi (2018-03-07 13:10:15 +0000) edit

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

grahamb's avatar grahamb (2018-03-07 13:38:08 +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