← Quick references

Zeek: turn a saved capture into a connection timeline

Build a small, explainable investigation from conn.log and related protocol logs using a capture you already own.

Define the investigation window

Zeek turns observed network activity into logs that are easier to search than individual packets. For a first exercise, ask which systems communicated during one known application action. Use capture.pcap as a placeholder for your own authorized capture, saved in the working directory. Zeek and jq should already be installed.

Record the capture's time zone, collection point, and start and end times. A capture from one host may not show both sides of every conversation, and a short recording may begin after a connection was established.

Produce an isolated set of logs

Run Zeek from a new directory so the generated logs belong to one analysis. The subshell below changes directory only for this command. The -r option reads the saved file, and LogAscii::use_json=T requests one JSON record per line.

Do not reuse an old results directory without preserving its contents: Zeek can overwrite existing log files. The set of logs depends on the traffic and loaded scripts, so an absent http.log is not automatically a processing error.

zeek --version
mkdir zeek-run-01
(cd zeek-run-01 && zeek -r ../capture.pcap LogAscii::use_json=T)

Make conn.log your starting point

Begin with endpoints, protocol, duration, and connection state. Zeek's originator and responder fields describe its view of the conversation; avoid automatically relabeling them as trusted client and untrusted server. conn.log also covers UDP and ICMP activity, not just TCP sessions.

This projection keeps the first review manageable. Missing fields may be normal for a particular record. Keep the full original logs so a compact table does not become your only evidence.

jq -r '[.ts, .uid, .["id.orig_h"], .["id.resp_h"], .["id.resp_p"], .proto, .duration, .conn_state] | @tsv' zeek-run-01/conn.log
Questions for one connection
EvidenceQuestion
Endpoints and portDoes this match the application action?
Duration and byte countsWas the exchange brief, prolonged, or one-sided?
State and missed_bytesHow complete is the observed conversation?

Follow the connection into protocol logs

Choose a uid from conn.log and search for that same uid in the relevant protocol log, such as dns.log or http.log when present. These records can explain what happened within the connection. A DNS answer and a later connection may have different uids; correlate those using time and addresses rather than assuming one identifier joins every activity.

Write a short timeline: an observed lookup, the returned address, and a later connection. Mark the connection between those events as an inference unless other evidence confirms it.

Investigate missing evidence before concluding

If the logs look unexpectedly empty or one-sided, check capture quality and Zeek's diagnostics. Checksum offloading can leave locally captured packets with checksums that Zeek rejects. When that explains your own capture, compare a separate offline run using -C and document why checksum validation was relaxed.

Finish with a claim the logs actually support. Keep the capture, command, version, chosen uid, and remaining questions together. The useful result is an auditable account of one conversation, not a large collection of unexplained log files.