Wireshark

πŸ”§ Tool Note β€” Category: Network Analysis | Open Source


πŸ“Œ Quick Overview

What is it? Open-source network protocol analyser for capturing and inspecting network traffic in real-time.

Official Website: https://www.wireshark.org/ License: GNU GPLv2 (Free) Used in: CSF & NS, EHPT, DFIR

🎯 What Problem Does It Solve?

  • See exactly what’s happening on a network at the packet level
  • Identify cleartext credentials, malicious traffic, data exfiltration
  • Reconstruct attack timelines from network captures
  • Verify encryption and security controls

βš™οΈ How It Works

Wireshark is a GUI on top of a packet-capture library β€” it doesn’t generate traffic, it copies packets the network card sees:

NIC β†’ capture driver (libpcap/npcap) β†’ promiscuous mode β†’ capture buffer β†’
      dissectors decode each layer β†’ display (with filters) β†’ pcap file
  1. Capture library: libpcap (Linux/macOS) or Npcap (Windows) taps the interface below the OS network stack and copies raw frames.
  2. Promiscuous mode: normally a NIC ignores frames not addressed to it; promiscuous mode tells it to keep all frames it sees. (On Wi-Fi, monitor mode goes further and captures raw 802.11 management/other-device frames.)
  3. Dissectors: Wireshark peels each packet layer by layer (Ethernet β†’ IP β†’ TCP β†’ HTTP…), one dissector per protocol, turning bytes into the readable tree you click through.
  4. TCP stream reassembly: a single HTTP response is split across many packets; Wireshark can stitch them back β€” Follow β†’ TCP Stream shows the full conversation (this is how you read HTTP credentials/POST data).

Two filter types β€” don’t confuse them:

Capture filterDisplay filter
Whenbefore capture (BPF syntax)after capture
Purposelimit what’s recordedlimit what’s shown
Exampletcp port 80http.request.method == "POST"
Reversible?No β€” dropped foreverYes β€” just re-type

Why it sees cleartext: if traffic isn’t encrypted (HTTP, FTP, Telnet, DNS), the payload is right there in the packets β€” that’s why the labs recover HTTP form credentials, and why HTTPS/TLS matters (see OSI Model & TCP-IP Security).

πŸš€ Key Features

  1. Live packet capture on any interface
  2. Deep inspection of hundreds of protocols
  3. Powerful display filter engine
  4. TCP/UDP stream reconstruction
  5. Protocol hierarchy statistics
  6. Export objects (files transferred over HTTP/SMB)
  7. Read/write pcap and pcapng files

πŸ”¬ Common Display Filters

ip.addr == 192.168.1.10        # any traffic to/from this host
tcp.port == 80                 # by port
http                           # only HTTP
dns                            # only DNS queries/responses
http.request.method == "POST"  # form submissions (creds!)
tcp.flags.syn == 1 && tcp.flags.ack == 0   # SYN packets (scan/handshake starts)
tcp.analysis.retransmission    # network trouble / oddities

Analyse workflow: apply filter β†’ right-click a packet β†’ Follow β†’ TCP Stream β†’ read the conversation. Statistics β†’ Protocol Hierarchy and Conversations summarise what’s on the wire.

⚠️ Gotchas / Limitations

  • Encrypted traffic (HTTPS/TLS) shows only metadata (IPs, SNI, cert) β€” not payload, unless you supply session keys (SSLKEYLOGFILE).
  • Capturing needs privileges; on Linux add yourself to the wireshark group (see install) rather than running as root.
  • On a switched network you only see your own traffic + broadcast unless you use a SPAN/mirror port or tap β€” a switch isn’t a hub.
  • Huge captures are memory-heavy; use capture filters to keep files manageable.
  • Capturing traffic you’re not authorised to monitor can be illegal β€” only capture on networks you own/are permitted to.

πŸ’» Installation

# Linux
sudo apt install wireshark
# Allow non-root capture:
sudo usermod -aG wireshark $USER
 
# Kali Linux β€” pre-installed

⚑ Quick Reference

β†’ Wireshark Commands Cheatsheet