Skip to content

meltedinhex/analyst-ai-pack / skills/building-zeek-analytics-for-hunting

building-zeek-analytics-for-hunting

Verified

Builds Zeek-based network hunting analytics by writing scripts and analyzing Zeek logs (conn, dns, http, ssl, files) to surface long connections, rare JA3s, suspicious downloads, and beaconing. Activates for requests to build Zeek analytics, write a Zeek hunting script, or analyze Zeek logs for threats.

Building Zeek Analytics for Hunting

When to Use

  • You have Zeek logs (conn.log, dns.log, http.log, ssl.log, files.log) and want to build hunting analytics: long-lived connections, rare JA3 fingerprints, suspicious file downloads, and beaconing.
  • You want repeatable detections expressed as Zeek scripts or log-analysis queries.

Do not use Zeek to actively probe hosts — it is passive analysis of captured/sensor traffic.

Prerequisites

  • Zeek logs in TSV or JSON (or a running Zeek sensor). The script analyzes exported logs.

Workflow

Step 1: Analyze a Zeek log for anomalies

python scripts/analyst.py analyze conn.log --kind conn

For conn, surfaces long-duration and high-byte connections; for ssl, counts JA3 rarity; for http, flags executable/script downloads and rare user-agents; for dns, flags long/high-entropy queries.

Step 2: Express the logic as a Zeek script (optional)

Translate a confirmed pattern into a Zeek script using the appropriate event (connection_state_remove, ssl_established, http_reply).

Step 3: Confirm

Corroborate anomalies with destination reputation and other logs (pivot by uid).

Step 4: Operationalize

Stage the Zeek script or scheduled log query as a durable detection.

Validation

  • The analyzer parses both TSV (#fields) and JSON Zeek logs.
  • Surfaced anomalies match the chosen log kind's fields.
  • JA3 rarity and long-connection logic are computed correctly.

Pitfalls

  • TSV header (#fields) parsing — column order varies by deployment.
  • Backups/updates producing benign long/large connections.
  • JA3 collisions across legitimate clients.

References

rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall