Chapter 1: Your First Capture: Installing Wireshark and Building Your Workspace
Seeing your own traffic on the wire is the first reward of Wireshark, and it is closer than most people think: a download, a driver, and a double-click. Installs rarely fail on the installer itself. They fail on the capture driver, the interface choice, and the window layout. This chapter gets you from a clean machine to your own traffic in minutes, then builds the workspace (columns, filters, profiles) that turns browsing into analysis.
Installing Wireshark on Windows, macOS, and Linux
Installing the application follows the same pattern on all three platforms: download, run, accept defaults. But the capture driver differs per platform, and that is where installs fail. Windows needs Npcap, macOS needs ChmodBPF, and Linux needs a group membership. Get the driver right and the GUI part takes minutes.
On Windows, download the 64-bit installer from the Wireshark download page and run it [1]. The installer bundles Npcap, the driver that actually reads raw frames off your network card, and the bundle is selected by default, so accept it [1]. Accept the remaining defaults as well. The installer also offers USBPcap, which you do not need for anything in this book [2].
On macOS, Wireshark ships as a disk image signed by the Wireshark Foundation [3]. Open the .dmg, drag the Wireshark bundle into /Applications, and you are done, except for capturing [3]. Run Install ChmodBPF.pkg from inside the disk image. It installs a launch daemon that lets your account read raw packets without running as root [3, 4]. Skip it, and capturing requires root privileges [4]. If you prefer a package manager, brew install wireshark works [5].
On Linux, install from your distribution’s packages. On Debian or Ubuntu:
1 sudo apt update
2 sudo apt install wireshark
3 sudo usermod -a -G wireshark $(whoami)
The installer asks whether non-superusers may capture packets. Answer yes, and it creates a wireshark group you must join with the usermod command above [6]. Some install guides also add your account to the dialout group with sudo usermod -a -G dialout $(whoami) [6]. Group membership applies at your next login, so log out and back in before testing. Distro packages are often older than the current official release, so if you need the latest build, take the installer from wireshark.org instead [7]. Binary packages are available for most Linux distributions and other Unices [8].
System requirements are modest. Wireshark needs a 64-bit processor, about 500 MB of disk, and a gigabyte of RAM to start [4]. Then the numbers scale with your workload. A busy network produces hundreds of megabytes of capture in minutes, and packet analysis is single-threaded, so a fast processor and lots of memory beat many cores [8]. Windows support tracks Microsoft’s extended-support window (11, 10, Server 2022, 2019, 2016 at the time of writing). macOS needs version 11 or later [8].
Choosing a capture interface
The first window you see is the Welcome screen. It lists every interface on the machine: Wi-Fi, Ethernet, and any virtual adapters, each with a small sparkline showing live traffic [9]. Pick the interface whose sparkline shows live traffic. Skip VPN and container adapters unless they are the subject of your capture. Double-click the interface, and the capture starts [10, 11].
Stopping is just as direct: click the red square, or choose Capture > Stop [10, 9]. You will start and stop a lot, so learn the equivalents: the shark-fin toolbar button, Capture > Start, and Ctrl+E all begin a capture, and Ctrl+E also ends one [10, 5].
If you are unsure which interface carries your traffic, open Capture > Options. The dialog’s interface table shows a traffic sparkline for each adapter plus the link-layer header type, snapshot length, kernel buffer size, promiscuous and monitor-mode toggles, and any capture filter attached to that interface [11]. Hover over an interface and Wireshark shows the IPv4 and IPv6 addresses bound to it, which settles most doubts [11]. One checkbox, promiscuous mode, matters for your first capture. With it enabled, the NIC keeps every frame it receives instead of discarding the ones not addressed to your machine [11, 12]. On a hub or a mirrored port, that stream includes frames between other hosts [13]. On a switched port the NIC never receives those frames, so the setting changes nothing [14].
The command line offers the same choices. wireshark -D prints the interface list, -i <interface> selects one for capture, and with no interface given, Wireshark picks the first non-loopback adapter [15].
![]() |
Monitor mode is a different animal from promiscuous mode. It captures raw Wi-Fi frames, including management and control frames, and requires an adapter that supports it plus, on Windows, an Npcap option you must enable at install time [16, 17]. You cannot fix missing hardware support with a checkbox [18]. |
The three panes
One packet, three views. The main window divides into a top packet list, a middle packet details tree, and a bottom packet bytes hexdump [19]. Select a packet in the list, and the other two panes fill with that packet’s decoded structure and raw bytes [19, 5]. Select a field in the details, and the bytes pane highlights the exact bytes that field occupies [13]. That three-way linkage (summary, structure, bytes) is the interface’s whole design [19].
The packet list is a table with one row per packet [20]. Each column holds what the highest-level protocol dissector wrote. In a frame carrying HTTP over TCP over IP over Ethernet, the Ethernet dissector writes first, the IP dissector overwrites its columns, the TCP dissector overwrites IP’s, and the HTTP dissector overwrites TCP’s, so the row shows HTTP information [21, 20]. To the left of the row, small symbols mark conversations (arrowheads for requests and responses, brackets for grouping), so related packets stand out at a glance [20, 22].
The packet details pane shows the selected packet as an expandable tree [19]. Each layer of encapsulation is a node, such as Frame, Ethernet II, IPv4, or TCP, and each leaf is one decoded field with its value [13]. Press Shift+Right to open a node and all its subtrees, and Ctrl+Right to expand every node in the tree [23].
The packet bytes pane shows the frame as a canonical hex dump, exactly as it crossed the wire. Each line of the dump carries a data offset, sixteen hexadecimal bytes, and the same sixteen bytes as printable ASCII, with non-printable characters shown as a period [24]. Sometimes the pane shows more than one page, reassembled data or decrypted content, and tabs at its bottom switch between them [24]. Clicking a field in the details pane scrolls the dump to the matching offset, which is how you trace a decoded value back to the raw frame [13].
Columns that show what matters
The default columns (No., Time, Source, Destination, Protocol, Length, Info) answer the question “what happened?” [5]. Analysis usually needs a sharper question than that, one about ports, response times, or slow conversations. Columns are how you ask it.
Right-click any column header and choose Column Preferences [2, 25]. The dialog lists the current columns. Pick one and edit its title, or change its type from the dropdown [12]. One useful pass renames Source to Source IP and changes its type to “Src addr (unresolved)”, then adds Src Port and Dest Port columns of the unresolved port types [2]. The “(unresolved)” variants stop Wireshark from reverse-resolving addresses, which speeds up big captures [19] and shows you what the packet actually contains rather than what DNS says about it [2]. Remove Protocol and Length if you rarely read them, and drag the remaining headers into your preferred order, in the preference dialog or directly on the column bar [2, 25]. Freeze a column so it stays visible while you scroll horizontally, and hide one by unchecking it in the header popup [26].
For a field with no matching column type, build a custom column by right-clicking the field in the Packet Details pane and choosing Apply as Column [27]. The new column’s type is custom, and you can fine-tune it in preferences by giving it a display-filter field name and a width [12].
![]() |
With network name resolution enabled, a Source column shows the hostname Wireshark looked up for each address, so two packets to different IPs can display the same name [19, 12]. The unresolved types show the address the frame actually carries [2]. |
Filtering your first capture
Start a capture on the interface you chose, generate traffic (ping a host, load a web page, let background chatter accumulate), then stop. The capture now holds a jumble: your traffic, other hosts’ traffic, broadcasts, and background noise. Your job is to isolate your own traffic, and the tool for that is a display filter.
A display filter hides packets after capture, while a capture filter drops them before capture [28]. The distinction matters because hidden packets are recoverable and dropped packets are gone forever [28]. Reach for a capture filter when volume or exposure is a real problem, such as a long capture window or a high-rate link [28]. You enter it in BPF syntax on the Welcome screen or in Capture > Options, where host 192.168.1.42 records only that host’s traffic [28, 29]. For a first capture, though, capture broadly and filter later.
Type into the filter toolbar, and the toolbar turns green once your expression parses or red when it does not, so you can fix a mistake before pressing Enter [30]. Press Enter, and the list narrows instantly [12]. The workhorse filter is your own address:
1 ip.addr == 192.168.1.42
ip.addr matches the address as either source or destination, so you see traffic in both directions without writing both clauses [31, 32]. When direction matters, split the field: ip.src == 192.168.1.42 for outgoing, ip.dst == 192.168.1.42 for incoming [31, 5]. Combine conditions with the filter language’s operators (and, or, not, and comparisons like ==), so ip.addr == 192.168.1.42 && tcp.port == 443 shows only your HTTPS traffic [19, 32]. The filter toolbar autocompletes field names as you type, which is the fastest way to learn what fields exist [12].
One useful drill filters to your own IP, then looks at the Protocol column. A quiet minute of web browsing should show DNS, TLS, and occasionally QUIC or ARP. Each is a question you can ask with one more filter, such as dns for the name resolutions or tcp.flags.reset == 1 for connections being torn down [32]. Run one now, then keep the filtered view on screen. The next section saves exactly what a filter shows.
Saving and reopening captures
Save before you close anything. File > Save As opens a dialog that lets you save the whole capture, only the packets currently displayed by a filter, or a numbered packet range [19]. Saving the displayed subset is a clean way to hand someone a focused trace instead of the full firehose [19].
The default format is pcapng, and it is the right default. Wireshark has saved files as pcapng by default since version 1.8. The older pcap format is what libpcap-based tools like tcpdump use [33]. Dumpcap, the capture engine under Wireshark, also writes pcapng by default [34].
The format matters because pcapng keeps more than pcap can. A pcapng capture is a chain of blocks. An Interface Description Block records, per interface, the link-layer type, the operating system, and the hardware description. Each packet lives in an Enhanced Packet Block with its own timestamp [35]. Per-interface statistics (packets received, packets dropped by the interface, packets dropped by the OS) can ride along [35]. Packet comments survive, where pcap has no place to put them [26]. If you capture from more than one interface at once, Wireshark must write pcapng, because pcap stores a single link-layer type for the whole file [34, 11]. On the practical side, process info, which application sent each packet, is recorded in the pcapng file when you enable it [11].
Reopen a saved capture any of three ways: File > Open, double-clicking the file, or on the command line wireshark -r capture.pcapng [36, 9]. The raw frames and per-interface metadata reopen unchanged. Dissection settings and window layout come from your active profile, not from the file.
Configuration profiles
So far you have customized columns and learned to read the three panes. A configuration profile is how you keep all of that organized by job, so a DNS troubleshooting session and a security review can have different windows without you rebuilding either one. Each profile stores its own preferences, capture and display filters, filter macros, coloring rules, disabled protocols, decode-as assignments, and recent settings such as pane sizes and column widths [37]. Switch profiles and the whole layout changes with you.
Create one from Edit > Configuration Profiles, or press Shift+Ctrl+A (Shift+Cmd+A on macOS) [37]. Click the + button, type a name, and you have an empty profile [27, 2]. The active profile’s name sits in the status bar at the bottom of the window. Click it to switch profiles on the fly [27, 37]. Changes you make while a profile is active (the columns from the previous section, coloring rules, saved filters) are saved into it [37, 38]. You are always working inside some profile, so customize once and the next session starts where you left off [38].
Delete a profile the same way you made one, by selecting it in the dialog and clicking the minus button [37]. Wireshark will not delete the Default profile or the global profiles that ship with the application. Asking to delete Default merely resets it [37]. Share a crafted layout by exporting the profile to a zip archive and importing it on the other machine. A team with one profile set starts each investigation from the same window [27, 37, 38].
Profiles are folders of plain-text configuration files, stored under a profiles directory in your personal configuration folder, such as ~/.config/wireshark/profiles on Linux [39]. tshark -G folders prints the exact paths on any platform when you need to back them up [39]. You can also tell Wireshark to switch profiles automatically. Give a profile an auto-switch filter, and opening a capture whose packets match it loads that profile for you [37].
A DNS troubleshooting profile shows the idea. Create the profile, add a “Response In” column by right-clicking the field in the details pane, remove the columns you never read, then add two filter buttons: one showing DNS responses, one flagging response times over half a second [27]. Later DNS investigations start with that window and those buttons.
So far you have captured on your own machine, which records only your own traffic. Chapter 2 asks where to capture when the problem lives between other machines: on a switch port, a mirror port, a TAP, or a remote host.
Exercises
Open
lab/http.cap. The machine that recorded it is 145.254.160.237. Use the filter toolbar to count how many frames that host sent, how many it received, and how many either way. Then addtcp.port == 80to the either-way filter with&&. How many frames disappear, and what were they?In
lab/http.cap, frames 4, 6, and 38 all belong to the same web page download, but the Protocol column shows HTTP for frame 4, TCP for frame 6, and HTTP/XML for frame 38. Select each one, expand the packet details tree, and explain why the column differs even though all three frames carry HTTP data.Build the DNS troubleshooting view the chapter describes, using
lab/dns.cap. Right-click the response time field (dns.time) in a response and choose Apply as Column, then apply the filterdns.time > 0.5. Which query was slow, what record type did it ask for, and which frame holds the query it answers?A colleague wants only the ad-server part of
lab/http.cap: the DNS lookup and the traffic to 216.239.59.99. Filter for it, then use File > Export Specified Packets (or Save As with “displayed” selected) to save just those packets as pcapng. Open the new file. Its frame numbers and times don’t match the original, and the HTTP connection in it has no SYN. Work out which of these differences come from saving a filtered subset and which were already true of the original capture.
