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.
Diagram
A pcap turned into answers
Step 1 of 4
Capture
Record at a span port or tap with a rotating buffer.
$ 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.
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.
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.
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.
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.
- 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.
- 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.