>
CyberShellsServicesPricingBlogBook a scoping call →
◆ OSWP · Module 04

Wireshark Essentials

Read the air. How to capture raw 802.11, cut millions of frames down to the handful that matter, and decrypt WPA once you have the handshake.

Where this falls

Why Wireshark sits at the centre

Every wireless attack ends in the same place: you captured something, now you have to read it. Did the handshake complete? Is that a deauth or a disassociation? Which device is the AP? Wireshark is the microscope for all of it, and it dissects 802.11 natively.

PICTURE IT

Monitor mode fills a bucket with every drop of rain in the area — tens of thousands of frames, almost all noise. Wireshark is the filter paper. The whole skill of this module is pouring that bucket through the right filter so only the few drops you care about remain.

Two capabilities carry the module, and they map to two kinds of filter you must never confuse:

  1. Capture the right frames (and only those) off the air.
  2. Display the subset you want to stare at right now.
OSWP framing In the exam you live in Wireshark confirming your attacks worked: a captured 4-way handshake before you crack it, EAPOL frames after a deauth, the beacon that reveals a hidden SSID. Fast, confident filtering is the difference between finding the frame and scrolling past it.

01 · Setup

Getting started

Wireshark captures Ethernet by default, even on a wireless card. To collect raw 802.11 frames (with the radiotap header) the adapter must be in monitor mode before you launch it.

monitor-mode.sh
$ sudo ip link set wlan0 down
$ sudo iwconfig wlan0 mode monitor
$ sudo ip link set wlan0 up
# down → switch mode → back up. (iw also works, per module 3)
The trap that catches everyone Launch Wireshark without monitor mode and you'll see traffic, be happy, and capture zero useful 802.11. If you're not seeing beacons and management frames, you forgot monitor mode. Check first, every time.

Welcome screen, in one pass

  • Interface list with live sparklines showing traffic volume per interface. Down interfaces don't appear.
  • Use the interface-type dropdown to show only Wireless, so just wlan0mon remains.
  • Start the capture: double-click the interface, or select it and click the blue shark fin.

02 · The workspace

The three panes

Once capturing, the window splits into three stacked views of the same packet. Click a packet up top, and the two panes below drill into it.

1 · PACKET LIST every captured frame, one per row No. | Time | Source | Destination | Protocol | Info ← customizable columns, click a row to inspect ↓ 2 · PACKET DETAILS the dissection, as a tree ▼ IEEE 802.11 Data ▼ Frame Control Field Type: Data (2) Subtype: 0 Receiver / Transmitter addr 3 · PACKET BYTES the raw hex 0000 08 42 00 00 ff ff ff ff 0008 ff ff 3a 30 f9 0f e1 95 0010 3a 30 f9 0f e1 95 b0 7f select in Details → matching bytes highlight here

Figure 1 — Tip: Edit > Preferences > Layout > option 2 puts Details and Bytes side by side.

MEMORY ANCHOR

List → Details → Bytes = zoom levels. Think of a map app: the List is the country view, Details is the street view (labelled), Bytes is the raw GPS coordinates. Same place, three depths.

03 · One channel at a time

Channel hopping

Critical fact: Wireshark does not channel hop. It sees only the channel your adapter is parked on. Target on channel 11 but card on channel 3? You capture nothing from it.

Two ways to sweep the 2.4GHz band:

hop.sh · manual channel sweep
# order hits the non-overlapping channels (1,6,11) first
for channel in 1 6 11 2 7 10 3 8 4 9 5
do
  iw dev wlan0mon set channel ${channel}
  sleep 1
done
or let airodump-ng hop for you
$ sudo airodump-ng wlan0mon
# airodump hops by default; run it alongside Wireshark
MEMORY ANCHOR

1, 6, 11 are the "big three". They're the only non-overlapping 2.4GHz channels, which is why the hop script leads with them. Picture three radio stations that never bleed into each other; everything else overlaps its neighbours.

04 · The core mental model

Display vs capture filters

This is the single most tested distinction in the module. Get it wrong on an engagement and you lose data you can never get back.

Two filters, two completely different jobs
 Capture filterDisplay filter
Decideswhat is written to disk / memorywhat is shown on screen
Appliedbefore capture startsany time, live
SyntaxBPF (Berkeley Packet Filter)Wireshark's own (dot-notation)
Examplenot subtype beaconwlan.fc.type == 2
Mistake costdata gone foreverjust remove the filter
Why use itsave CPU/RAM, avoid dropped packets, legal scope limitsfind the needle in what you already have
MEMORY ANCHOR

Capture = the net. Display = the sorting tray. What the net misses, the ocean keeps. What the tray hides is still in your hand. So capture filters are dangerous (irreversible) and display filters are safe (reversible).

Syntax tell: a dot like wlan.fc.type is always a display filter. Plain words like subtype beacon are capture (BPF).

05 · Reading what you have

Display filters

Display filters use dot-notation fields, like objects in code: wlan.fc.type is the frame-control type field. Build them three ways: type by hand (with autocomplete), the Analyze > Display Filter Expression builder, or right-click a field in a packet and Apply as Filter.

The colour feedback of the filter bar

green
valid

Syntax is correct, filter will apply.

red
invalid

Broken syntax, e.g. wlan.fc.type = 1 (single =).

yellow
caution

Works, but may surprise you. Usually a != on a multi-value field.

The yellow gotcha wlan.fc.type != 1 can behave unexpectedly. Best practice: negate the whole expression instead, !(wlan.fc.type == 1). Same intent, no surprises.

Apply as Filter vs Prepare a Filter

  • Apply as Filter builds and runs the filter immediately.
  • Prepare a Filter only writes it to the bar; you hit enter when ready. Better for assembling a long multi-part filter on a big capture, so you don't re-process after every piece.

Combining clauses

display-filters.txt
# data frames only
wlan.fc.type == 2

# data frames AND subtype 0  (&& = and)
(wlan.fc.type == 2) && (wlan.fc.subtype == 0)

# data frames but NOT subtype 0
(wlan.fc.type == 2) && !(wlan.fc.subtype == 0)

# filter to one AP
wlan.bssid == 00:0c:41:82:b2:55

# find the handshake / auth frames
eapol
wlan.fc.type_subtype in {0x0 0x1 0xb}
MEMORY ANCHOR

Frame types: "Me Control Data Extra" = 0,1,2,3.

wlan.fc.type ==  0 Management · 1 Control · 2 Data · 3 Extension. The one you filter for most is 2 (Data) and 0 (Management, which holds beacons, auth, deauth, assoc). Control (1) is the plumbing: ACK, RTS, CTS.

Reuse: bookmarks & buttons

Save a filter you'll want again via the blue ribbon bookmark (left of the bar). For one-click access, the + on the right makes a filter button on the toolbar, e.g. a "Data" button holding wlan.fc.type == 2.

06 · Collecting less, better

Capture filters (BPF)

Capture filters limit what Wireshark even receives. Fewer frames means less CPU/RAM and fewer dropped packets (a dropped packet could be the one handshake you needed). For Wi-Fi they filter on MAC addresses and frame types/subtypes only.

Building one up, clause by clause

Beacons are the loudest noise: every AP sends roughly 10 per second. Drop them first, then narrow to one device across all four possible MAC-address positions in an 802.11 frame.

capture-filter.txt · built in stages
# 1 · kill the beacon noise
not subtype beacon

# 2 · just one device (addr can be in any of 4 slots)
(wlan addr1 3A:30:F9:0F:E1:95) or (wlan addr2 ...) or (wlan addr3 ...) or (wlan addr4 ...)

# 3 · the full filter: device, minus beacons, control, probes
((wlan addr1 3A:30:F9:0F:E1:95) or (wlan addr2 3A:30:F9:0F:E1:95) or
 (wlan addr3 3A:30:F9:0F:E1:95) or (wlan addr4 3A:30:F9:0F:E1:95))
 and not (subtype beacon) and not (type ctl)
 and not (subtype probe-req) and not (subtype probe-resp)
MEMORY ANCHOR

Four address slots = who's involved in the frame. 802.11 frames carry up to 4 MACs (receiver, transmitter, BSSID, and a 4th for mesh/WDS). You OR across all four because your target might be sender or receiver or the AP. Miss a slot, miss the frame.

One-way door You cannot recover what a capture filter excluded. When unsure, capture broadly and narrow with display filters afterwards. Only tighten the capture filter when CPU, disk, or legal scope forces it.

07 · No GUI needed

Wireshark at the command line

The GUI takes flags. These four are the ones to know cold:

The flags worth memorizing
FlagMeaningMemory hook
-iinterface (name or index)interface
-kstart capturing immediatelykick off
-Imonitor mode (capital i)bIg I = monitor
-fcapture filter (BPF)filter
-ssnaplen (bytes per frame)snip
-Dlist interfaces + indexesDirectory
wireshark-cli.sh
$ sudo wireshark -D                       # list interfaces by index
$ sudo wireshark -i wlan0mon -k           # open + capture now
$ sudo wireshark -i wlan0 -I -k           # put wlan0 in monitor + capture
$ sudo wireshark -i 4 -I -k               # by index (4 = wlan0mon)
$ sudo wireshark -i wlan0mon -k -f "not subtype beacon"
$ sudo wireshark -i wlan0mon -k -s 60     # snaplen 60 bytes
$ wireshark wifi.pcap                     # just open a file (no sudo)
Sibling tools tshark is the CLI Wireshark. dumpcap captures with the lowest CPU (no dissection) and is best on weak hardware like routers. sshdump wraps remote SSH capture.

08 · Capturing from elsewhere

Remote capture & pipes

The classic remote-pentest setup: the card is on a box across the network, you have SSH, and you want the frames live in your Wireshark. A pipe makes it happen.

remote host wlan0mon (monitor) tcpdump -w - -U → raw pcap to STDOUT SSH encrypted pipe your machine Wireshark GUI wireshark -k -i - STDIN → live frames STDOUT travels the pipe; STDERR stays in your terminal

Figure 2 — tcpdump captures remotely, SSH carries the bytes, your Wireshark renders them.

remote-capture.sh
# local unnamed pipe: capture → straight into Wireshark
$ sudo tcpdump -U -w - -i wlan0mon | wireshark -k -i -

# over SSH: run tcpdump on the remote box, render locally
$ ssh root@10.11.0.196 "sudo -S tcpdump -U -w - -i wlan0mon" | sudo wireshark -k -i -
# quote the remote command so its flags don't become ssh flags

Named vs unnamed pipes

unnamed pipe |
the | character

Output of one command becomes input of the next. Capture writes directly into Wireshark. One-shot, no filesystem object.

named pipe (FIFO)
mkfifo /tmp/named_pipe

A real file (perms show p). Wireshark uses it as an interface; the capture tool writes to the pipe. Reusable, permission-controlled.

named-pipe.sh
$ mkfifo /tmp/named_pipe
$ sudo wireshark -k -i /tmp/named_pipe        # waits for data
$ sudo tcpdump -U -w - -i wlan0mon > /tmp/named_pipe
MEMORY ANCHOR

Three flags make tcpdump "pipe-ready": -w - and -U. -w - means "write to STDOUT (the dash) not a file", -U means "unbuffered, send each packet as it arrives" so Wireshark updates live instead of in bursts. dumpcap needs -P too (force pcap format).

09 · Make it readable

Coloring, columns & snaplen

Coloring rules

Toggle with View > Colorize Packet List, edit under View > Coloring Rules. Rules are checked top to bottom; first match wins, then it stops (disabled rules skipped). Defaults target Ethernet; import the WLAN rules from the Wireshark wiki so auth / deauth / disassoc / EAPOL frames jump out by colour.

Why it matters for attacks With WLAN colouring on, a deauth flood is a wall of one colour, and the four EAPOL handshake frames stand out in dark green. You spot the attack working without reading a single field.

Columns

Turn any field into a column: right-click it in Packet Details > Apply as Column (e.g. add a Channel or data rate column from the 802.11 radio info). Drag to reorder, right-click header to remove.

Snaplen

Snapshot length = how many bytes per frame you keep. Set it in Capture > Options (not the welcome screen) or with -s. Can't be changed mid-capture.

MEMORY ANCHOR

Snaplen 60 = radiotap (36) + 24 header bytes. That keeps frame headers while dropping payload. Default/full is 262144. Set too low and you slice off data you needed, and unlike a filter you can't undo it after capture.

10 · Reading encrypted traffic

WEP & WPA decryption

Wireshark can decrypt WEP and WPA1/2 if you give it the key. Set it under Edit > Preferences > Protocols > IEEE 802.11 > Enable decryption > Decryption keys.

The three key formats
Key typeFormatUse when
wephex key (colons optional)WEP networks
wpa-pwdPASSPHRASE:ESSIDYou know the WPA passphrase
wpa-psk64-hex PMKEnterprise, or passphrase contains a :
The hard limit you must remember WPA/WPA2 decryption only works if the capture contains a full 4-way handshake. No complete handshake = no decryption, no matter how correct the key. This is why you deauth a client: to force the handshake you need. Also: decrypted packets can't be exported.

Generating a PMK with wpa_passphrase

When the passphrase has a colon (or you want the raw PMK), generate it and paste as a wpa-psk key with no ESSID.

pmk.sh · wpa_passphrase
$ wpa_passphrase test abcdefg:
network={
    ssid="test"
    #psk="abcdefg:"
    psk=a1c425c0f4e5ff3746920c90cc55d17f4773512b6c1ed415526a3bcea3351b5b
}
# copy the psk= value → Wireshark wpa-psk key (no ESSID)

WLAN statistics

Wireless > WLAN Traffic gives a per-BSSID overview: beacon counts, data packets, retries, protection type (TKIP/CCMP). Narrow it with a display filter like wlan.bssid == 00:0c:41:82:b2:55 to focus one network.

11 · Keep this open

Command & filter cheat sheet

wireshark-quickref.sh
# ---- MONITOR MODE ----
$ sudo ip link set wlan0 down
$ sudo iwconfig wlan0 mode monitor
$ sudo ip link set wlan0 up

# ---- LAUNCH ----
$ sudo wireshark -i wlan0mon -k            # capture now
$ sudo wireshark -i wlan0 -I -k            # monitor + capture
$ sudo wireshark -D                        # list interfaces

# ---- CHANNEL ----
$ iw dev wlan0mon set channel 6            # Wireshark does NOT hop

# ---- DISPLAY FILTERS (dot-notation) ----
wlan.fc.type == 0            # management (beacon/auth/deauth/assoc)
wlan.fc.type == 2            # data
wlan.bssid == AA:BB:CC:DD:EE:FF
eapol                        # handshake frames
wlan.fc.type_subtype in {0x0 0x1 0xb}   # assoc req/resp + auth
!(wlan.fc.type == 1)         # safe negation

# ---- CAPTURE FILTERS (BPF, plain words) ----
not subtype beacon
not type ctl
wlan addr1 AA:BB:CC:DD:EE:FF

# ---- REMOTE CAPTURE ----
$ ssh root@HOST "sudo -S tcpdump -U -w - -i wlan0mon" | sudo wireshark -k -i -

# ---- WPA DECRYPT KEY ----
$ wpa_passphrase <ssid> <passphrase>       # → wpa-psk value
The one-line map Monitor mode first → park on the target's channel → capture broad (drop beacons) → display-filter to the frames you want → confirm the 4-way handshake → add the key to decrypt. Dot = display, words = capture.

12 · Test yourself

Recall quiz

Answer out loud before tapping. If you can clear all nine without peeking, the module is in long-term memory.

Why must you enable monitor mode before launching Wireshark?
Wireshark captures Ethernet by default even on a wireless card. Only monitor mode delivers raw 802.11 frames with the radiotap header.
Capture filter vs display filter: which is reversible, and why does it matter?
Display is reversible (just remove it; the packets are still captured). Capture is not (excluded frames are never written, gone forever). Capture broad, narrow with display.
What do wlan.fc.type values 0, 1, 2, 3 mean?
0 = Management, 1 = Control, 2 = Data, 3 = Extension. ("Me Control Data Extra.")
Syntax tell: how do you spot a display filter vs a capture filter at a glance?
A dot (wlan.fc.type) = display. Plain words (subtype beacon) = capture/BPF.
Does Wireshark channel hop? What are the "big three" 2.4GHz channels?
No, it stays on the adapter's current channel. Sweep manually or with airodump-ng. Non-overlapping channels are 1, 6, 11.
What three tcpdump flags make it pipe-ready for Wireshark?
-w - (write to STDOUT), -U (unbuffered, live). dumpcap also needs -P for pcap format.
Unnamed pipe vs named pipe, in one line each?
Unnamed (|): capture writes straight into Wireshark. Named (mkfifo): a filesystem FIFO Wireshark uses as an interface; the capture tool writes to it. Reusable with permissions.
What single condition must a capture meet before Wireshark can decrypt WPA/WPA2?
It must contain a full 4-way handshake. No complete handshake = no decryption, even with the correct key.
What is snaplen 60, and why can't you fix it later?
36-byte radiotap header + 24 header bytes = keep headers, drop payload. It's set at capture start and can't change mid-capture, so too-low slices off data permanently (default is 262144).