Network traffic analysis: from packet capture to findings with Zeek and Wireshark

How to capture and analyze traffic for an investigation: where to capture, how to keep evidence intact, how Zeek turns pcaps into connection, DNS, and TLS logs, and a worked example that finds a beaconing host.

Lesson 10 of 17 · 14 min read · practice only with authorization

Diagram

A pcap turned into answers

Follow the path. One example at a time.

Step 1 of 4

Capture

Record at a span port or tap with a rotating buffer.

Illustration: Capture
$ sudo tcpdump -i span0 -nn -s 0 -G 3600 -W 24 -w /cap/edge-%Y%m%d%H.pcap

The example on the open step is one illustration, or the fix you can paste into an application you own.

What this page is made of

3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.

  1. Where to capture

    What fails
    Capture location decides what you can see.
    Who is affected
    Investigations missing internal or encrypted traffic.
    What you would notice
    Only edge captures when the question is about east-west movement.
    What you change
    Plan capture points for internet, server, and admin segments.
  2. Evidence handling

    What fails
    Captures can be challenged if their integrity is unknown.
    Who is affected
    Cases that go to legal or HR.
    What you would notice
    Files without hashes or handling notes.
    What you change
    Hash on collection, store read-only, and log access.
  3. Encrypted traffic

    What fails
    TLS hides content, but metadata remains.
    Who is affected
    Analysts who need answers anyway.
    What you would notice
    Unknown SNI, odd JA3/JA4 fingerprints, regular timing.
    What you change
    Use Zeek ssl.log, fingerprints, and endpoint data together.

When to open Wireshark

Zeek and similar tools summarize; Wireshark shows individual packets and streams. Use Zeek to find the five connections that matter, then open those in Wireshark with a display filter such as ip.addr==198.51.100.77 && tcp.port==443 and follow the stream.

Flow data at scale

NetFlow and IPFIX records from routers, and VPC flow logs in cloud, show who talked to whom without payloads. They are cheaper to keep for months, which matters when an investigation starts late.

Related lessons

The tcpdump, Wireshark, Zeek, and Suricata lessons in the tool library cover filters, scripts, and rules on lab captures.

Check yourself

Recognition and the fix. Nothing here is a procedure.

1 / 3

A host connects to one external IP 351 times at a 10-second interval. What is likely?

Sibling techniques

Pages at the same depth, plus a lab and a glossary card for this one.

  1. MapWireshark: reading a captureA packet capture is a recording of conversations.
  1. 01Session hijacking and cookie theft: how sessions are stolen and how to make them worthlessThe ways a session token leaves the user — network sniffing, script access, infostealers, logs, and fixation — how cookie flags and server-side session design limit each one, and how to read a session in a capture or proxy.
  2. 02Man-in-the-middle attacks: where interception happens and what stops itInterception can happen on the local link, in DNS, at a rogue Wi-Fi access point, or through a trusted proxy.

Practice

  1. LabTerminal labRead the files on a scoped host and name the failure in a finding.

Glossary

  1. CardSession hijackingA bearer token or cookie is copied and replayed, so the server treats the attacker as the signed-in user.