Tshark
Why Use tshark
Over Wireshark?
Tshark
is a powerful command-line alternative to Wireshark, especially useful in scenarios where efficiency, automation, and resource constraints are factors. Unlike Wireshark’s GUI, tshark
excels in processing large data sets, automating repetitive tasks, and operating in headless environments, making it ideal for large-scale or automated network analysis tasks.
Basic Capture Commands
Capture Traffic
On a Specific Interface.
tshark -i eth0
With a Filter.
tshark -i eth0 -f "port 80"
Write Capture to a File
tshark -i eth0 -w capture.pcap
Setting Up Captures on VMs
There are some considerations to be aware of when capturing from VMs; more on this can be found over here.