Executive Verdict: When to Choose Each
Choose Wireshark / tshark if…
Best for deep protocol dissection (3,000+ dissectors), TCP stream reconstruction, and forensic PCAP inspection on an analyst workstation.
Choose tcpdump if…
Best for lightweight, zero-GUI packet capture over SSH on production Linux servers and edge firewalls.
Feature-by-Feature Technical Matrix
| Dimension | Wireshark / tshark | tcpdump |
|---|---|---|
| Runtime Environment | Desktop GUI (Wireshark) and terminal analyzer (tshark) | Minimal CLI utility pre-installed on almost every Linux/BSD server |
| Filter Languages | BPF capture filters + rich Wireshark display filters (http.request, tls.handshake) | Berkeley Packet Filter (BPF) expressions only |
| Protocol Dissectors | 3,000+ deep application protocol dissectors + stream reassembly | Fast header/hex/ASCII summary output |
| Security Footprint | Never capture as root; inspect untrusted PCAPs as non-privileged user | Drops privileges automatically after opening capture socket |
| TLS Decryption | Supports SSLKEYLOGFILE session key decryption in GUI | Captures raw ciphertext; pass PCAP to Wireshark to decrypt |
| Best Practice Workflow | Stage 2: Open captured .pcap file locally to follow streams & extract files | Stage 1: Capture ring-buffered .pcap on remote server over SSH |
Side-by-Side CLI & Operational Workflow
Wireshark / tshark Example
# Extract HTTP host and URI fields from a PCAP using tshark
tshark -r incident.pcap -Y "http.request" -T fields -e ip.src -e http.host -e http.request.uri
tcpdump Example
# Capture traffic on a remote server excluding your own SSH session
sudo tcpdump -i eth0 -nn -s0 -w incident.pcap 'not port 22'
Frequently Asked Questions
Why do incident responders capture with tcpdump and analyze with Wireshark?
Production servers rarely have a GUI installed, and running complex protocol dissectors directly on a live server increases attack surface. Capturing raw packets with tcpdump (-w incident.pcap) and analyzing them offline in Wireshark gives the best of both worlds.
What is the difference between a capture filter and a display filter?
A BPF capture filter (such as tcp port 443) discards non-matching packets at the kernel level before they are written to disk. A Wireshark display filter (such as tls.handshake.type == 1) hides/shows packets dynamically without deleting anything from the PCAP.