Stream tcpdump output to Wireshark GUI
Output of tcpdump can be fed directly to Wireshark via:
$ tcpdump -s 0 -Un -w - | /Applications/Wireshark/Wireshark.app/Contents/MacOS/Wireshark -k -i -
And if tcpdump and Wireshark run on different machines one can do
$ tcpdump -s 0 -Un -w - | nc 192.0.2.1 8080
$ nc -k -l 8080 | /Applications/Wireshark/Wireshark.app/Contents/MacOS/Wireshark -k -i -
But I wonder if it's possible to initiate listening for a tcpdump stream from within Wireshark GUI (for convenience). I know that there is "UDP Listener Remote capture" that makes Wireshark to listen on a particular port for data of a patricular format. However, what format do I need to specify so Wireshark can interpret the tcpdump
stream? I tried data
, pcap
and pcapng
but it didn't work.
I think there is an alignment issue.
tcpdump
is writing a stream. Testing on a mac,nc
breaks the stream into 1024 byte chunks. The "UDP Listener" is expecting discrete packets.If
tcpdump
could be told to only write packet data (with no file header) andnc
told when to send each packet, then there might be a chance at dissecting the Exported PDUs.