capture.pcap
packet capture
No.  Source         Destination    Proto  Info
1    192.0.2.10     198.51.100.7   DNS    Standard query A example.com
2    198.51.100.7   192.0.2.10     DNS    Standard query response
3    192.0.2.10     203.0.113.5    TCP    52144 → 443 [SYN]
4    203.0.113.5    192.0.2.10     TCP    443 → 52144 [SYN, ACK]
5    192.0.2.10     203.0.113.5    TLS    Client Hello
Illustration · Signal
tool

Zeek: turn network traffic into searchable logs

Records connections, DNS lookups, files and more as structured logs.

Curated by Signal · 10/5/2026

Original: zeek.org ↗License: BSD-3-ClauseRepository ↗

What it is

Zeek (formerly Bro) turns network traffic into detailed, structured logs instead of just raising alerts. It records connections, DNS lookups, HTTP requests, files transferred, and more, which makes it a favorite for threat hunting and incident response after the fact.

Running Zeek

# Run Zeek on a live interface
zeek -i eth0
 
# Run Zeek against a saved capture file
zeek -r capture.pcap
 
# Run with a specific script loaded
zeek -r capture.pcap local
 
# Run in the background as a managed deployment
zeekctl deploy

zeekctl basics (for persistent deployments)

# Check status of all nodes
zeekctl status
 
# Start Zeek
zeekctl start
 
# Stop Zeek
zeekctl stop
 
# Restart after a config change
zeekctl deploy

Default log files (created in the working directory)

conn.log       every network connection seen
dns.log        DNS queries and responses
http.log       HTTP requests and responses
ssl.log        TLS/SSL handshake details
files.log      files transferred over the network
notice.log     Zeek's own generated alerts
weird.log      unusual or malformed traffic

Reading logs with zeek-cut

# Show specific columns from conn.log
cat conn.log | zeek-cut id.orig_h id.resp_h id.resp_p proto
 
# Show source IP and query for DNS
cat dns.log | zeek-cut id.orig_h query
 
# Show HTTP host and URI
cat http.log | zeek-cut host uri
 
# Show TLS server name (SNI) for each connection
cat ssl.log | zeek-cut id.orig_h server_name

Common investigation queries

# Find the top talkers by connection count
cat conn.log | zeek-cut id.orig_h | sort | uniq -c | sort -rn | head
 
# Find all connections to a specific destination IP
cat conn.log | zeek-cut id.orig_h id.resp_h id.resp_p | awk '$2=="192.0.2.10"'
 
# Find all DNS queries for a specific domain
cat dns.log | zeek-cut query | grep "example.com"
 
# Find unusually long connections (possible beaconing or tunneling)
cat conn.log | zeek-cut id.orig_h id.resp_h duration | sort -k3 -n | tail
 
# List files downloaded with their hashes
cat files.log | zeek-cut fuid filename md5 sha1

Writing a simple custom script

# example.zeek: log a notice whenever a connection is made to port 4444
event connection_established(c: connection)
    {
    if ( c$id$resp_p == 4444/tcp )
        NOTICE([$note=Weird::ActivityType,
                $msg="Connection to port 4444 detected",
                $conn=c]);
    }
# Run Zeek with the custom script
zeek -r capture.pcap example.zeek

Combining with jq-style JSON logs

# Enable JSON log output in local.zeek, then:
cat conn.log | jq '.id.orig_h, .id.resp_h, .id.resp_p'
 
# Filter JSON conn.log for traffic on a specific port
jq 'select(."id.resp_p"==445)' conn.log

Typical workflow

# 1. Run Zeek against a capture or live interface
zeek -r incident.pcap
 
# 2. Check conn.log for the busiest or longest-lived connections
cat conn.log | zeek-cut id.orig_h id.resp_h duration | sort -k3 -n | tail
 
# 3. Pivot into dns.log and http.log for the hosts involved
cat dns.log | zeek-cut id.orig_h query | grep "192.0.2.10"
 
# 4. Check files.log for anything downloaded during the connection
cat files.log | zeek-cut tx_hosts rx_hosts filename md5

Curated summary. The original work belongs to its authors.

#monitoring#network#defense
Related reading