Packet Analysis with Wireshark

Capture and dissect network traffic with Wireshark and tcpdump to troubleshoot, investigate incidents and see protocols for real.

Intermediate · about 8 hours · difficulty 3/5

Learn first: DNS and How It Gets Abused, TLS and Encryption in Transit

Packets do not lie. Wireshark lets you see exactly what crossed the wire, which makes it essential for SOC analysts, incident responders and network engineers alike.

Capturing

  • Wireshark captures on an interface you choose; on servers use tcpdump -i eth0 -w capture.pcap and open the file later.
  • Capture filters (BPF syntax, like port 53) limit what is recorded. Display filters (like http.request or ip.addr == 10.0.0.5) narrow what you view.
  • Only capture on networks you own or are authorized to monitor; packet data can contain passwords and personal information.

Analyzing

  • Follow TCP stream reconstructs a conversation.
  • Statistics > Conversations and Protocol Hierarchy quickly show who talked to whom and how much.
  • File > Export Objects > HTTP recovers files transferred in cleartext.
  • Useful filters: dns, tcp.flags.syn == 1 && tcp.flags.ack == 0 (connection attempts, great for spotting scans), http.request.method == "POST", tls.handshake.type == 1 (Client Hello, shows SNI).

What to look for in an investigation

Many SYNs to many ports (scanning), beaconing at regular intervals (possible C2), cleartext credentials (FTP, Telnet, HTTP basic auth), unusual DNS, or large outbound transfers.

Pitfalls

  • Opening a giant capture with no plan. Start with Statistics, then filter.
  • Expecting to read HTTPS payloads; without keys you mostly see metadata.

Move on when you can take a sample malware-traffic pcap and identify the infected host, the suspicious domains and the timeline of events.

Key concepts

  • Capture vs display filters
  • tcpdump on servers
  • Follow TCP stream
  • Statistics: conversations and hierarchy
  • Exporting objects from pcaps
  • Spotting scans and beaconing
  • Decrypting TLS with key logs

Mini project

Capture your own browsing for five minutes, then write a short report listing the domains contacted, protocols used and any cleartext traffic you found.

Check yourself

Which display filter would you use to list only new TCP connection attempts, and why does that help find a port scan?

Free resources