Ultimate Wireshark Commands Cheat Sheet: Network Analysis and Packet Capture Reference

Ultimate Wireshark Commands Cheat Sheet

Wireshark is one of those tools I use constantly, but for years I only ever remembered about 20% of the filters and commands I actually needed in the moment. This cheat sheet is the reference I built for myself over time — the capture filters, display filters, command-line options, and troubleshooting workflows I reach for again and again. If you work in networking, security, or systems administration, I think you’ll find this useful too.

Wireshark vs Tshark: Know What You’re Using

ToolInterfaceBest For
WiresharkGUIDeep analysis, visual inspection, following streams
TsharkCommand-lineScripting, automation, headless servers, remote captures
DumpcapCommand-lineLightweight capture-only tool, used internally by Wireshark

Installing Wireshark

PlatformCommand
Ubuntu/Debiansudo apt install wireshark
Fedora/RHELsudo dnf install wireshark
macOS (Homebrew)brew install --cask wireshark
WindowsDownload installer from official site

After installing on Linux, add your user to the wireshark group so you can capture without root:

sudo usermod -aG wireshark $USER

Then log out and back in for the group change to apply.

Capture Filters vs Display Filters (The Big Distinction)

This trips up a lot of beginners, so I want to be clear about it upfront:

Filter TypeWhen It AppliesSyntax StylePurpose
Capture FilterBefore packets are capturedBPF (Berkeley Packet Filter) syntaxReduces what gets recorded, saves disk/memory
Display FilterAfter packets are capturedWireshark’s own filter syntaxNarrows down what you view, doesn’t delete data

You can’t use display filter syntax in the capture filter box, and vice versa — they’re genuinely different languages.

Capture Filters Reference (BPF Syntax)

FilterPurpose
host 192.168.1.10Capture traffic to/from a specific host
net 192.168.1.0/24Capture traffic within a subnet
port 443Capture traffic on a specific port
portrange 1000-2000Capture traffic within a port range
tcpCapture only TCP traffic
udpCapture only UDP traffic
icmpCapture only ICMP traffic
src host 10.0.0.1Capture traffic from a specific source
dst host 10.0.0.1Capture traffic to a specific destination
not port 22Exclude SSH traffic
host 10.0.0.1 and port 80Combine conditions
broadcastCapture broadcast traffic only
ether host aa:bb:cc:dd:ee:ffCapture traffic for a specific MAC address

Display Filters Reference (Wireshark Syntax)

Basic Filters

FilterPurpose
ip.addr == 192.168.1.10Show traffic to/from an IP
ip.src == 192.168.1.10Show traffic sourced from an IP
ip.dst == 192.168.1.10Show traffic destined to an IP
tcp.port == 443Show traffic on a TCP port
udp.port == 53Show traffic on a UDP port
tcp.flags.syn == 1Show SYN packets (connection attempts)
tcp.flags.reset == 1Show RST packets (connection resets)
httpShow only HTTP traffic
dnsShow only DNS traffic
tls or sslShow TLS/SSL traffic
arpShow ARP traffic
icmpShow ICMP traffic

Combining Filters

FilterPurpose
ip.addr == 10.0.0.1 && tcp.port == 443Both conditions must match (AND)
tcp.port == 80 || tcp.port == 443Either condition matches (OR)
!(tcp.port == 22)Exclude a condition (NOT)
ip.addr == 10.0.0.1 and not icmpCombine AND with NOT

Protocol-Specific Filters

FilterPurpose
http.request.method == "POST"Show only HTTP POST requests
http.response.code == 404Show HTTP 404 responses
dns.qry.name == "example.com"Show DNS queries for a specific domain
dns.flags.rcode != 0Show DNS responses with errors
tls.handshake.type == 1Show TLS Client Hello packets
tcp.analysis.retransmissionShow TCP retransmissions
tcp.analysis.duplicate_ackShow duplicate ACKs
tcp.analysis.zero_windowShow zero window conditions (receiver buffer full)
ftpShow FTP traffic
smtpShow SMTP (email) traffic
icmp.type == 8Show ICMP echo requests (ping)
icmp.type == 0Show ICMP echo replies

Filtering by Frame/Time

FilterPurpose
frame.len > 1000Show packets larger than 1000 bytes
frame.time >= "2026-01-01 00:00:00"Show packets after a specific time
frame.number == 500Jump to a specific packet number
frame contains "password"Search raw frame content for a string

Command-Line Capture with Tshark

Tshark is invaluable when you’re on a headless server or want to script captures.

# Basic capture to a file
tshark -i eth0 -w capture.pcap

# Capture with a capture filter (BPF syntax)
tshark -i eth0 -f "port 443" -w https_traffic.pcap

# Read and apply a display filter to an existing capture
tshark -r capture.pcap -Y "http.request"

# Limit capture to a specific number of packets
tshark -i eth0 -c 100 -w sample.pcap

# Capture for a set duration (in seconds)
tshark -i eth0 -a duration:60 -w timed_capture.pcap

# Output specific fields only, useful for scripting
tshark -r capture.pcap -T fields -e ip.src -e ip.dst -e tcp.port

# List available interfaces
tshark -D

Expected output for tshark -D:

1. eth0
2. wlan0
3. lo (Loopback)
4. any

Command-Line Capture with Dumpcap

# Capture packets on an interface with a size limit and ring buffer
dumpcap -i eth0 -b filesize:10240 -b files:5 -w rotating_capture.pcap

This is useful for long-running captures where you don’t want a single file to grow unbounded.

Following Streams

One of the most useful features for actually reading a conversation between two hosts:

ActionHow To Do It (GUI)Tshark Equivalent
Follow TCP StreamRight-click packet > Follow > TCP Streamtshark -r capture.pcap -q -z follow,tcp,ascii,0
Follow UDP StreamRight-click packet > Follow > UDP Streamtshark -r capture.pcap -q -z follow,udp,ascii,0
Follow HTTP StreamRight-click packet > Follow > HTTP Streamtshark -r capture.pcap -q -z follow,http,ascii,0

Statistics Menu Shortcuts

FeatureGUI PathPurpose
Protocol HierarchyStatistics > Protocol HierarchySee a breakdown of protocols by volume
ConversationsStatistics > ConversationsSee traffic grouped by endpoint pairs
EndpointsStatistics > EndpointsSee traffic grouped by individual hosts
I/O GraphStatistics > I/O GraphVisualize traffic volume over time
Expert InfoAnalyze > Expert InformationSurface warnings, errors, and notable events

Tshark equivalents:

# Protocol hierarchy statistics
tshark -r capture.pcap -q -z io,phs

# Conversation statistics
tshark -r capture.pcap -q -z conv,tcp

# Expert info summary
tshark -r capture.pcap -q -z expert

Coloring Rules (Reading Packets Faster)

Wireshark’s default coloring helps you scan a capture visually without reading every line:

ColorMeaning (Default Rules)
Black background, red textChecksum errors
Light purpleTCP traffic
Light blueUDP traffic
BlackTCP packets with problems (retransmissions, resets)
GreenHTTP traffic
YellowRouting protocols and warnings

You can customize these under View > Coloring Rules, and I’d recommend adding a rule to highlight retransmissions in a color you’ll spot instantly, since they’re often the first sign of network trouble.

Common Keyboard Shortcuts

ShortcutAction
Ctrl+EStart/stop capture
Ctrl+FFind packet
Ctrl+GGo to specific packet number
Ctrl+RReload capture file
Ctrl+Shift+TTime display format toggle
Ctrl+MMark/unmark a packet
Ctrl+Alt+Shift+TFollow TCP stream
TabJump to display filter bar

Security and Threat-Hunting Filters

These are the ones I lean on most during incident response or general security review:

FilterPurpose
tcp.flags == 0x002Isolate SYN packets, useful for spotting port scans
tcp.flags == 0x029Detect unusual FIN+PSH+URG combinations (potential scan technique)
dns.qry.name matches "\.xyz$"Spot DNS queries to suspicious TLDs
http.request.uri contains "cmd="Look for possible command injection attempts
frame contains "eval("Search raw payload for suspicious script content
ip.ttl < 10Spot unusually low TTL values, sometimes indicating spoofing or misconfigured tunneling
arp.duplicate-address-detectedDetect potential ARP spoofing / MITM attempts
tcp.analysis.retransmission and ip.addr == 10.0.0.5Investigate connection quality issues from a specific host

Configuration Profiles and Customization

Wireshark’s configuration profiles let you save entirely separate setups (coloring rules, column layouts, filter buttons) for different jobs. I keep a dedicated profile for security investigations and a different one for general performance troubleshooting.

TaskGUI Path
Create a new profileEdit > Configuration Profiles > “+”
Switch profilesRight-click the profile name in the status bar
Customize columnsEdit > Preferences > Appearance > Columns
Add a custom filter buttonRight-click the filter bar > “Apply as Filter” > save as button
Sanitize/anonymize a captureTools like tracewrangler (Windows) or bittwiste (cross-platform) work alongside Wireshark for this

Custom columns I add almost every time: TCP stream index, TCP window size, and delta time from previous displayed packet. They make scanning a busy capture much faster once they’re visible without opening every packet.

Exporting and Extracting Data

TaskHow To Do It
Export specific packetsFile > Export Specified Packets, choose displayed or marked packets
Export objects (files transferred over HTTP/SMB/etc.)File > Export Objects > choose protocol
Export packet dissection as text/CSVFile > Export Packet Dissections
Extract fields via command linetshark -r capture.pcap -T fields -e frame.number -e ip.src -E header=y -E separator=,
Convert pcap to pcapng or vice versaeditcap -F pcapng input.pcap output.pcapng
Merge multiple capture filesmergecap -w merged.pcap file1.pcap file2.pcap
Split a large capture into chunkseditcap -c 10000 large.pcap split.pcap

Exporting HTTP objects is genuinely one of my favorite features — if a capture includes a file download over plain HTTP, Wireshark can reconstruct and save that file directly from the packet data, which is incredibly useful for malware analysis or verifying what was actually transferred.

Building a Repeatable Capture Workflow

For anything beyond a quick ad hoc look, I try to follow a consistent process so captures stay usable later and don’t turn into an unlabeled pile of pcap files:

  1. Name captures with context: hostname_issue-description_YYYYMMDD.pcap beats capture1.pcap every time.
  2. Capture with a reasonable filter from the start if you already know the affected host or port, rather than capturing everything and filtering later.
  3. Set a snap length if you only need headers, not full payload, to keep file sizes manageable: tshark -i eth0 -s 128 -w headers_only.pcap.
  4. Rotate large captures automatically using dumpcap‘s ring buffer options rather than letting one file grow unbounded.
  5. Document your filters alongside the capture — a short text file noting what you were investigating and which display filters you used saves everyone time if someone else picks up the analysis later.
  6. Archive resolved investigations rather than deleting them; packet captures from a past incident are often useful reference material for the next similar one.

Troubleshooting Workflow

When I sit down with a packet capture to troubleshoot a real problem, this is roughly the order I work in:

  1. Check Protocol Hierarchy first. This immediately tells me what kind of traffic dominates the capture and whether anything unexpected shows up.
  2. Filter down to the affected host or conversation. Use ip.addr == to narrow the noise.
  3. Look for retransmissions and resets. tcp.analysis.retransmission and tcp.flags.reset == 1 often point straight to the problem.
  4. Check for DNS failures. dns.flags.rcode != 0 surfaces failed lookups quickly.
  5. Follow the TCP stream for the specific connection in question to read the actual application-layer conversation.
  6. Check Expert Info for anything Wireshark itself flagged as unusual.
  7. Correlate timestamps with the reported issue window using the time filter to avoid wading through irrelevant traffic.

Common Symptom Table

SymptomFilter to InvestigateLikely Cause
Slow application performancetcp.analysis.zero_windowReceiver buffer exhausted
Intermittent connection dropstcp.flags.reset == 1Application or firewall resetting connections
DNS resolution failuresdns.flags.rcode != 0Misconfigured DNS server or blocked queries
Packet loss suspiciontcp.analysis.retransmissionNetwork congestion or faulty hardware
Suspected spoofing/MITMarp.duplicate-address-detectedARP cache poisoning
TLS handshake failurestls.alert_messageCertificate mismatch or unsupported cipher suite

Best Practices

  • Capture on the interface closest to the problem, not just whichever is convenient — a capture from the wrong segment can hide the real issue.
  • Use capture filters to reduce noise when you already know what you’re looking for; save display filters for exploratory analysis.
  • Save captures with descriptive filenames and timestamps, especially in incident response contexts where chain of custody matters.
  • Avoid capturing more than you need in production environments — full packet capture on a busy link can fill disk space fast.
  • When sharing captures with colleagues or vendors, sanitize sensitive payload data first (Wireshark has built-in tools for this under Edit > Configuration Profiles).
  • Learn tshark even if you prefer the GUI; it’s the only option on headless systems and it scripts beautifully into automated monitoring.

Real-World Use Cases

  • Diagnosing slow file transfers by checking for zero window conditions and retransmissions between client and server.
  • Investigating a suspected man-in-the-middle attack by filtering for duplicate ARP replies on a LAN segment.
  • Auditing DNS traffic to catch exfiltration attempts disguised as DNS queries to unusual domains.
  • Validating a TLS/SSL certificate rollout by confirming the correct certificate chain appears in the handshake.
  • Capturing evidence during a security incident using tshark on a server without a GUI, then analyzing the resulting pcap on a workstation.
  • Baselining normal traffic patterns with Statistics > Conversations before an infrastructure change, so you have something to compare against afterward.

Common Mistakes to Avoid

  • Mixing up capture filter syntax and display filter syntax — they are not interchangeable, and using one in the other’s field will either fail or silently do nothing useful.
  • Capturing on the wrong interface, especially in virtualized or multi-homed environments.
  • Leaving a full packet capture running unattended on a high-traffic link and running out of disk space.
  • Forgetting that tcp.port filters both source and destination — if you need directionality, use tcp.srcport or tcp.dstport specifically.
  • Not checking Expert Info before manually hunting through thousands of packets — it often surfaces the issue directly.
  • Assuming a single retransmission means a serious problem; occasional retransmissions are normal on any network. Look for patterns, not one-offs.

FAQs

What’s the difference between a capture filter and a display filter? Capture filters use BPF syntax and determine what gets recorded during the capture itself. Display filters use Wireshark’s own syntax and only change what’s shown from already-captured data — nothing is deleted.

Can I run Wireshark without root/administrator privileges? On Linux, yes, if your user is added to the wireshark group so dumpcap can access raw sockets without full root. On Windows, the Npcap driver handles this after installation, and you may still need admin rights for the initial setup.

How do I capture traffic on a remote server without a GUI? Use tshark or dumpcap on the remote machine to write a .pcap file, then transfer it to a workstation with the Wireshark GUI for deeper analysis.

Why can’t I see HTTPS traffic content even though I captured it? TLS encrypts the payload, so you’ll see the handshake and metadata but not the application data unless you have the session keys (via SSLKEYLOGFILE) or a private key for decryption configured in Wireshark.

What does “tcp.analysis.retransmission” actually indicate? It flags packets Wireshark believes were retransmitted, usually because the original packet was lost or the ACK wasn’t received in time. Occasional retransmissions are normal; frequent ones suggest congestion or a flaky link.

Interview Questions on Wireshark

  1. What’s the difference between a capture filter and a display filter, and can you give an example of each?
  2. How would you identify TCP retransmissions in a packet capture, and what do they typically indicate?
  3. Walk through how you’d investigate a suspected ARP spoofing attack using Wireshark.
  4. What’s the purpose of the “Follow TCP Stream” feature, and when would you use it?
  5. How do you capture traffic on a headless Linux server without a GUI?
  6. Explain how you’d decrypt TLS traffic in Wireshark, assuming you have access to the session keys.
  7. What’s the difference between tcp.port and tcp.srcport/tcp.dstport?
  8. How would you use Wireshark’s Statistics menu to baseline normal network behavior?
  9. What are some signs in a packet capture that indicate a DNS-based exfiltration attempt?
  10. Describe a real troubleshooting scenario where packet capture analysis solved a problem other tools couldn’t.

Printable Quick-Reference Summary

CategoryKey Command/Filter
Capture on interfacetshark -i eth0 -w capture.pcap
Capture with filtertshark -i eth0 -f "port 443"
Read existing capturetshark -r capture.pcap
Display filter (IP)ip.addr == 192.168.1.10
Display filter (port)tcp.port == 443
Show retransmissionstcp.analysis.retransmission
Show SYN packetstcp.flags.syn == 1
Follow TCP stream (CLI)tshark -r capture.pcap -q -z follow,tcp,ascii,0
Protocol hierarchy (CLI)tshark -r capture.pcap -q -z io,phs
List interfacestshark -D
DNS query filterdns.qry.name == "example.com"
ARP spoof detectionarp.duplicate-address-detected

Official Documentation and Further Reading

I go back to this cheat sheet constantly, whether I’m doing routine network health checks or digging into an actual incident. Bookmark it, print the summary table if that’s your style, and hopefully it saves you the same rabbit holes it’s saved me.

Total
3
Shares

Leave a Reply

Previous Post
Ultimate MySQL Commands Cheat Sheet

Ultimate MySQL Commands Cheat Sheet: Database Management and Query Reference

Next Post
difference between www and ww1 domain

Difference Between WWW and WW1 Domain

Related Posts