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.
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:
- Capture the right frames (and only those) off the air.
- Display the subset you want to stare at right now.
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.
$ 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)
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
wlan0monremains. - 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.
Figure 1 — Tip: Edit > Preferences > Layout > option 2 puts Details and Bytes side by side.
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:
# 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
$ sudo airodump-ng wlan0mon # airodump hops by default; run it alongside Wireshark
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.
| Capture filter | Display filter | |
|---|---|---|
| Decides | what is written to disk / memory | what is shown on screen |
| Applied | before capture starts | any time, live |
| Syntax | BPF (Berkeley Packet Filter) | Wireshark's own (dot-notation) |
| Example | not subtype beacon | wlan.fc.type == 2 |
| Mistake cost | data gone forever | just remove the filter |
| Why use it | save CPU/RAM, avoid dropped packets, legal scope limits | find the needle in what you already have |
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
Syntax is correct, filter will apply.
Broken syntax, e.g. wlan.fc.type = 1 (single =).
Works, but may surprise you. Usually a != on a multi-value field.
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
# 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}
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.
# 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)
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.
07 · No GUI needed
Wireshark at the command line
The GUI takes flags. These four are the ones to know cold:
| Flag | Meaning | Memory hook |
|---|---|---|
| -i | interface (name or index) | interface |
| -k | start capturing immediately | kick off |
| -I | monitor mode (capital i) | bIg I = monitor |
| -f | capture filter (BPF) | filter |
| -s | snaplen (bytes per frame) | snip |
| -D | list interfaces + indexes | Directory |
$ 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)
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.
Figure 2 — tcpdump captures remotely, SSH carries the bytes, your Wireshark renders them.
# 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
Output of one command becomes input of the next. Capture writes directly into Wireshark. One-shot, no filesystem object.
A real file (perms show p). Wireshark uses it as an interface; the capture tool writes to the pipe. Reusable, permission-controlled.
$ mkfifo /tmp/named_pipe $ sudo wireshark -k -i /tmp/named_pipe # waits for data $ sudo tcpdump -U -w - -i wlan0mon > /tmp/named_pipe
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.
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.
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.
| Key type | Format | Use when |
|---|---|---|
| wep | hex key (colons optional) | WEP networks |
| wpa-pwd | PASSPHRASE:ESSID | You know the WPA passphrase |
| wpa-psk | 64-hex PMK | Enterprise, or passphrase contains a : |
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.
$ 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
# ---- 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
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?
Capture filter vs display filter: which is reversible, and why does it matter?
What do wlan.fc.type values 0, 1, 2, 3 mean?
Syntax tell: how do you spot a display filter vs a capture filter at a glance?
wlan.fc.type) = display. Plain words (subtype beacon) = capture/BPF.Does Wireshark channel hop? What are the "big three" 2.4GHz channels?
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?
|): capture writes straight into Wireshark. Named (mkfifo): a filesystem FIFO Wireshark uses as an interface; the capture tool writes to it. Reusable with permissions.