PasswordGeeks
Tool Guide · Updated 2026

Wireshark Tutorial: The Complete Guide to Packet Capture & Network Analysis

Capture and inspect live network traffic in real time. Wireshark is the world's most widely used protocol analyzer, and this guide walks through everything from your first capture to reconstructing full TCP conversations, reading Statistics reports, and scripting captures with tshark.

What is Wireshark?

Wireshark is a free and open-source packet analysis tool that captures data traveling across a network interface and decodes it into human-readable form. Instead of seeing "traffic" as an abstract concept, Wireshark lets you see every individual packet — its source, destination, protocol, and payload — the way it actually crossed the wire or the airwaves.

Originally released in 1998 under the name Ethereal, the project was renamed Wireshark in 2006 after a trademark dispute and has since become the de facto standard tool for network troubleshooting, protocol development, and security analysis worldwide. It's maintained by a large open-source community and the Wireshark Foundation, and it ships dissectors for well over a thousand protocols, from ordinary HTTP and DNS to industrial control system protocols and proprietary IoT traffic.

In practice, Wireshark sits at the intersection of three disciplines: network engineering (why is this connection slow?), software development (is my protocol implementation sending what I think it's sending?), and security (what did this device actually talk to, and what did it send?). That's exactly why it shows up in networking courses, SOC analyst job postings, and CompTIA Network+/Security+ objectives alike.

How Wireshark Works

Because Wireshark only reads traffic rather than generating it, it's considered a passive tool — it won't alter packets in transit (unless you explicitly use it with an inline TAP or bridge configuration, which is an advanced setup outside the scope of this guide).

Installing Wireshark

Wireshark is free and available for Windows, macOS, and Linux from the official project site. A few notes that save beginners real time:

Windows

The Windows installer bundles Npcap, the packet capture driver. Make sure the "Install Npcap" checkbox is left enabled during setup — without it, Wireshark opens but shows zero interfaces to capture from.

macOS

Install via the official .dmg or with Homebrew: brew install --cask wireshark. macOS additionally requires the ChmodBPF helper (installed automatically) so your user account can read from /dev/bpf* without running as root every time.

Linux

Most distributions package it directly:

sudo apt install wireshark # Debian/Ubuntu/Kali sudo dnf install wireshark # Fedora sudo pacman -S wireshark # Arch

On Debian-based systems you'll be asked whether non-root users should be allowed to capture packets — say yes, then add your user to the wireshark group so you don't need sudo for every capture session:

sudo usermod -aG wireshark $USER

Log out and back in for the group change to take effect.

Capture Permissions by OS

Packet capture requires elevated access because it reads raw traffic other applications shouldn't normally see. If Wireshark opens but the interface list is empty or greyed out, it's almost always a permissions issue, not a bug:

OSWhat's required
WindowsNpcap installed; running as Administrator is not required for normal use once Npcap is set up correctly
macOSChmodBPF helper installed (comes with the official package); first launch may prompt for permission
LinuxUser added to the wireshark group, or run via sudo — group membership is preferred so you're not running the whole GUI as root

Wireshark Welcome Screen

Wireshark Welcome Screen

Wireshark Welcome Screen

The welcome screen shows every available network interface — Wi-Fi, Ethernet, loopback, and any VPN adapters — along with a small live traffic sparkline next to each one, so you can tell at a glance which interface is actually carrying traffic before you commit to capturing on it. Double-clicking an interface, or selecting it and clicking the blue shark-fin icon, starts capturing immediately.

If you're on a laptop with both Wi-Fi and Ethernet, always check the sparkline first — it's easy to start a capture on the wrong adapter and wonder why nothing shows up.

Main Interface Components

Menu Bar

Access file options, capture and analyze settings, statistics tools, and export functions. This is also where you'll find Edit → Preferences, useful for adjusting time display format, name resolution, and column layout.

Toolbar

Quick controls for starting, stopping, and restarting captures, plus the interface selector and the display filter input field.

Display Filter Bar

Allows filtering of the packets already captured, based on protocol, IP address, port, or dozens of protocol-specific fields. The bar turns green when a filter expression is syntactically valid and red when it isn't — a small but genuinely useful piece of instant feedback.

Packet List

Shows every captured packet in a single scrollable table, with columns for packet number, timestamp, source, destination, protocol, length, and a plain-English info summary.

Packet Details Pane

Click any packet in the list and this pane shows a collapsible, layer-by-layer breakdown — Frame → Ethernet → IP → TCP/UDP → application protocol — so you can drill into exactly which field you care about.

Packet Bytes Pane

Shows the raw hex and ASCII representation of the selected packet. Clicking a field in the Details pane automatically highlights the corresponding bytes here, which is one of the fastest ways to learn how a protocol is actually structured on the wire.

Starting Packet Capture

Starting Packet Capture

Wireshark Packet Capture

Select a network interface and Wireshark will begin capturing traffic instantly. You will see packets appearing in real time, updating continuously as new frames arrive on the interface.

Understanding the Interface

Wireshark Interface

Wireshark Interface
Tip: Right-click any column header to add, remove, or reorder columns. Adding a "Delta time displayed" column is one of the first things working analysts do — it makes spotting retransmission gaps and latency spikes far easier than reading raw timestamps.

Generating Traffic for Analysis

To analyze packets, you need traffic to capture. A simple way to generate some is using the ping command:

ping google.com

This generates ICMP Echo Request and Echo Reply packets that Wireshark can capture and decode.

Ping Requests

Ping command sending ICMP requests

Captured Packets

Wireshark capturing ICMP packets

For more realistic traffic, open a browser and visit a few sites while capturing — you'll see the full picture: DNS lookups resolving the hostname, a TCP handshake to the server, a TLS handshake negotiating encryption, and finally encrypted application data flowing back and forth.

Stopping Packet Capture

Stop Capture Button

Wireshark stop button

Click the red square button to stop capturing packets once enough data is collected. There's no strict rule for "enough" — for learning purposes, 30–60 seconds of normal browsing is plenty; for troubleshooting an intermittent issue, you may need to capture for much longer or set up a ring buffer (File → Capture File Properties, or via -b options in tshark) so you don't run out of disk space.

Filtering Packets

Once you have packets on screen, filtering is how you find the ones that matter. Type directly into the display filter bar. Example filter:

icmp

This shows only ICMP packets — useful right after the ping example above.

Filtered Packets

Wireshark ICMP filter

A faster way to build filters without memorizing syntax: right-click any field in the Packet Details pane and choose Apply as Filter → Selected. Wireshark writes the correct expression for you, which is also a great way to learn the field names as you go.

Capture Filters vs. Display Filters

This is the single most common point of confusion for people new to Wireshark, and it's worth being precise about it.

Capture filters

Set before you start capturing, in the interface selection screen or via Capture → Capture Filters. They use BPF (Berkeley Packet Filter) syntax and decide which packets are written to the capture buffer at all — anything that doesn't match is discarded permanently and can never be recovered from that capture session.

host 192.168.1.10 and port 443

Display filters

Applied after capture, in the display filter bar. They use Wireshark's own filter syntax (different from BPF) and only control what's shown — every packet is still sitting in the capture buffer or file underneath, and you can change or clear the display filter at any time without losing anything.

ip.addr == 192.168.1.10 && tcp.port == 443
 Capture filterDisplay filter
When appliedBefore capture startsAfter packets are captured
SyntaxBPFWireshark filter language
EffectDiscards non-matching packets permanentlyHides non-matching packets from view only
Typical useReducing capture size on a busy interfaceInvestigating specific traffic after the fact
Tip: When you're not sure what you'll need, capture broadly (or with a light capture filter like host 192.168.1.10) and do the real narrowing with display filters afterward. You can't display-filter your way back to a packet a capture filter already threw away.

Common Display Filters

FilterWhat It Shows
httpUnencrypted HTTP traffic
tlsTLS/SSL handshake and encrypted application traffic
tcp.port == 443Traffic on port 443 (typically HTTPS)
ip.addr == 192.168.1.1All traffic to or from a specific IP
dnsDNS query and response traffic
tcp.flags.syn == 1TCP connection attempts (SYN packets)
tcp.flags.reset == 1Reset (RST) packets, often indicating a refused or torn-down connection
tcp.analysis.retransmissionPackets Wireshark has flagged as retransmissions — a strong sign of packet loss or latency issues
arpARP traffic, useful for spotting spoofing attempts
http.request.method == "POST"HTTP POST requests specifically, useful when hunting for form submissions in plaintext HTTP
dns.qry.name contains "example"DNS queries where the queried name contains a substring
frame contains "password"Any packet with that literal string anywhere in the raw frame (use sparingly — it's slow on large captures)

Filter Operators & Logic

Filters can be combined using standard logical operators, and Wireshark accepts both the symbolic and the English form:

OperatorMeaningExample
&& / andBoth conditions must be trueip.addr == 192.168.1.1 && tcp.port == 443
|| / orEither condition may be truetcp.port == 80 || tcp.port == 443
! / notNegates a condition!(arp || dns)
==, !=, >, <Comparison operatorsframe.len > 1000
containsSubstring match within a fieldhttp.host contains "login"
matchesRegular-expression matchhttp.host matches "^www\\."

Two examples worth keeping handy: ip.addr == 192.168.1.1 && tcp.port == 443 narrows to HTTPS traffic for one device, while !(arp || dns) is a quick way to hide the background chatter and focus on everything else.

Understanding Packet Colors

Wireshark color-codes packets by default so patterns jump out visually without reading every row:

ColorTypical meaning
Light purpleTCP traffic
Light blueUDP traffic
Light greenHTTP traffic
Black background, red textPackets Wireshark has flagged as errors or malformed (checksum errors, malformed packets)
Black background, yellow textTCP anomalies such as retransmissions or out-of-order segments
GreyTCP connections that have been reset or closed

These are fully customizable under View → Coloring Rules, where you can add your own rule based on any display filter expression — a common one is coloring your own management or admin traffic a distinct color so it never gets lost in a busy capture.

Reading the TCP Handshake

Almost every TCP-based troubleshooting session starts with confirming the handshake completed cleanly. Filter for tcp.flags.syn == 1 or simply tcp and look for this three-packet pattern between client and server:

  1. SYN — client requests a connection, proposing an initial sequence number
  2. SYN, ACK — server accepts and proposes its own sequence number
  3. ACK — client acknowledges, and the connection is now established

If you only ever see a SYN with no reply, the destination is likely unreachable, firewalled, or not listening on that port. A SYN followed immediately by an RST means the port is reachable but nothing is listening, or a firewall is actively rejecting the connection rather than silently dropping it. Learning to recognize this three-packet shape at a glance is one of the fastest diagnostic skills to build.

Follow TCP Stream

Reading a conversation packet-by-packet is tedious once you actually need to understand what was said. Right-click any TCP packet and choose Follow → TCP Stream and Wireshark reassembles the entire conversation — every request and response, in order, with client traffic and server traffic shown in different colors — as one readable block of text.

This is invaluable for reading plaintext HTTP requests/responses, debugging application-layer protocols, or confirming exactly what data an application sent before a connection failed. It works the same way for UDP (Follow → UDP Stream) and for TLS if you've supplied the session keys, which is covered further down under real-world use cases.

The Statistics Menu

The Statistics menu turns a raw capture into aggregate views, and it's where a lot of real troubleshooting actually happens rather than in the packet list itself.

Protocol Hierarchy

Statistics → Protocol Hierarchy shows a percentage breakdown of every protocol present in the capture. It's the fastest way to answer "what is actually on this network?" in one glance — useful for spotting an unexpected protocol (like plaintext FTP or an unknown proprietary port) that shouldn't be there.

Conversations

Statistics → Conversations lists every unique pair of endpoints that talked to each other, along with bytes and duration. Sorting by bytes transferred is a quick way to find whichever host is generating the most traffic on a link.

Endpoints

Similar to Conversations, but grouped by individual host rather than by pair — useful for identifying every device that appeared on the network during the capture window.

I/O Graphs

Statistics → I/O Graph plots traffic volume over time and can be filtered per-protocol, which makes intermittent issues (a spike every 30 seconds, a slow steady drop-off) visible in a way the packet list never will be.

Exporting Objects & Saving Captures

Two things worth knowing once you're past the basics:

Export HTTP/DNS/SMB objects

File → Export Objects → HTTP (or DNS, SMB) pulls out every file transferred over that protocol in the capture — images, documents, executables — as individual files you can save to disk. This is standard practice in malware analysis for pulling a payload out of a capture for separate examination in an isolated environment.

Saving and file formats

Captures save as .pcapng by default (the modern format, supporting comments and multiple interfaces) or the older .pcap for compatibility with tools that haven't updated. File → Save As lets you export just the currently displayed (filtered) packets rather than the whole capture — handy for sharing a small, relevant slice of a much larger file with a colleague.

Command-Line Capture with tshark

Wireshark ships with a command-line sibling called tshark that uses the same capture engine and dissectors but without the GUI — ideal for remote servers, scripted captures, or automated log pipelines.

tshark -i eth0 -w capture.pcapng tshark -r capture.pcapng -Y "http.request" tshark -i eth0 -f "port 443" -c 100

The three flags worth memorizing first: -i selects the interface, -w writes to a file, -r reads an existing file back in, -Y applies a display filter, -f applies a capture filter, and -c caps the number of packets captured. Everything you learned about capture-vs-display filter syntax above applies directly here.

Real-World Use Cases

Wireshark is most useful paired with something actively generating traffic to inspect. Running an Nmap scan against your own lab network is a common way to see what a real scan looks like at the packet level — and if you're analyzing authentication attempts, comparing that traffic against a Hydra session in a lab environment helps make brute-force patterns easier to recognize in the wild.

If you're building out a broader offensive-security lab, Kali Linux ships with Wireshark preinstalled alongside tools like Metasploit and Burp Suite — worth reading together if you're new to the toolchain. On the defensive side, packet capture is one of many skills covered in our SOC analyst career path guide.

Common Beginner Mistakes

Wireshark vs. Other Traffic Tools

ToolPrimary UseBest For
WiresharkDeep packet inspection, GUIDetailed, visual traffic analysis
tcpdumpCommand-line captureLightweight capture on servers with no GUI
tsharkCommand-line WiresharkScripting and automated capture using Wireshark's own dissectors
ZeekNetwork security monitoringLarge-scale, ongoing traffic logging and alerting
NetworkMinerForensic traffic analysisReconstructing files and sessions from a capture for investigations

Glossary

For terms beyond Wireshark itself, see our full cybersecurity glossary.

Promiscuous mode
A network interface mode that allows capture of all traffic on the segment, not just traffic addressed to your device.
BPF (Berkeley Packet Filter)
The syntax used by capture filters to decide which packets get written to the capture buffer.
Dissector
The piece of Wireshark's code responsible for decoding one specific protocol into readable fields.
pcap / pcapng
File formats used to store captured packets; pcapng is the modern default.
Three-way handshake
The SYN, SYN-ACK, ACK sequence that establishes a TCP connection.
Retransmission
A packet resent because the original wasn't acknowledged in time, usually a sign of packet loss.

Frequently Asked Questions

Is Wireshark legal?

Yes, when used on networks you own or have explicit permission to analyze. Capturing traffic on networks you don't control or lack authorization for can violate wiretapping and computer misuse laws.

Can Wireshark capture passwords?

Only if the traffic is unencrypted — modern HTTPS, SSH, and similar protocols prevent reading actual content, though metadata like connection timing, packet size, and (for TLS) the destination hostname (SNI) is still visible.

Is Wireshark beginner-friendly?

Yes, with practice. Starting with simple filters like icmp or dns and using Follow TCP Stream makes it much more approachable before diving into advanced filter syntax.

Does it work on Windows, macOS, and Linux?

Yes, Wireshark is fully cross-platform and free on all three, along with the tshark command-line variant.

What's the difference between Wireshark and tcpdump?

tcpdump is lightweight and command-line-only, using BPF syntax throughout, while Wireshark provides a full graphical interface, its own richer display filter language, and hundreds of protocol dissectors for deep visual analysis.

What's the difference between a capture filter and a display filter?

A capture filter decides what gets recorded in the first place and uses BPF syntax; a display filter only controls what you currently see and can be changed freely after the fact. See the dedicated section above for a full comparison.

Can Wireshark decrypt HTTPS traffic?

Only if you have the session keys or the server's private key (for older, non-forward-secret TLS configurations). For your own applications, setting the SSLKEYLOGFILE environment variable and pointing Wireshark's TLS preferences at that log file is the standard, legitimate way to do this for debugging. If your concern is what a VPN does or doesn't hide from packet-level analysis, our best VPNs roundup covers what's actually encrypted end-to-end.

How do I find suspicious traffic in a capture?

Start with Statistics → Protocol Hierarchy for anything unexpected, then Statistics → Conversations sorted by bytes for unusually large or long-lived connections, then filter for tcp.flags.reset == 1 or tcp.analysis.retransmission to spot connection problems worth a closer look.

Conclusion

Wireshark rewards the time you put into it. The interface itself takes an afternoon to learn; reading a TCP handshake at a glance, knowing capture filters from display filters instinctively, and reaching for Statistics before scrolling through thousands of packets by hand — that's the part that takes practice, and it's the same skill set whether you're troubleshooting a flaky office network or working an incident response case. Start small: capture your own traffic, follow a stream, and build the filter vocabulary one session at a time.