Sniffing · Module 08

Wireshark

Capture and analyze network traffic packet by packet.

ModuleModule 08PhaseSniffingTypeDefensive / AnalysisPlatformKali Linux

Definition

Wireshark is an open-source network protocol analyzer (packet sniffer) with a graphical interface.

Primary purpose

Capture and inspect live network traffic in detail, down to the individual packet and protocol field.

Cybersecurity use

Traffic analysis, troubleshooting, protocol inspection, and incident investigation in authorized environments.

Key features

Live & offline analysis

Captures in real time or opens saved .pcap/.pcapng files.

Deep protocol dissection

Decodes hundreds of protocols down to individual fields.

Display & capture filters

Powerful syntax to isolate the traffic of interest.

Follow stream

Reconstructs full TCP/HTTP conversations for easy reading.

Statistics tools

Graphs and summaries: protocol hierarchy, conversations, I/O graphs.

Important commands

wireshark

Launch the Wireshark GUI.

tshark -i eth0

Capture live traffic on eth0 from the command line.

tshark -r capture.pcap

Read and display a saved capture file.

tshark -i eth0 -w output.pcap

Capture traffic and write it to a file.

tshark -r capture.pcap -Y "http"

Apply a display filter to a saved capture.

tshark -D

List available capture interfaces.

Practical examples

01Live capture to a file
command
tshark -i eth0 -w capture.pcap

Purpose Captures live traffic on eth0 and saves it for later analysis.

02Filter HTTP traffic
command
tshark -r capture.pcap -Y "http.request"

Purpose Displays only HTTP request packets from a saved capture.

03Filter by IP address
command
tshark -r capture.pcap -Y "ip.addr == 192.168.1.10"

Purpose Shows only packets to or from a specific host.

Important points

  • Display vs capture filters: Capture filters limit what is captured; display filters limit what is shown.
  • Privileges: Live capture usually needs elevated privileges or a capture group.
  • Encrypted traffic: TLS payloads can't be read without session keys, though headers stay visible.
  • Large captures: Long captures produce big files — use filters and ring buffers.
  • Authorization: Capturing on networks you don't own or control can violate privacy laws.

Common use cases

Network troubleshooting

Diagnose latency, failures or misconfigurations.

Incident investigation

Review captured traffic for signs of malicious activity.

Protocol learning

Study how protocols behave in authorized labs.

Pen-test support

Verify the traffic other tools generate during an engagement.

Learn it in context

This tool is taught in Module 08

Read the full written notes, with diagrams, defense and detection.

Open Module 08