Skip to content

Zeek

60 commands

A network security monitor that turns traffic into rich, structured logs of connections, DNS, HTTP, TLS and files.

  • NSM
  • network logs
  • threat hunting

Install Zeek

brew install zeek

Basic Syntax & Help2

zeek -h

Displays the command line help summary and available options.

zeek -v

Prints the current Zeek version number to verify installation.

Interface Selection1

zeek -i <interface>

Starts Zeek in live capture mode listening on the specified network interface.

Link

Offline Analysis2

zeek -r <pcap_file>

Processes a PCAP file offline to generate logs without live capture.

Link
zeek -C -r <pcap_file>

Analyzes a PCAP file while ignoring invalid IP checksums to prevent dropped packets.

Link

Configuration1

zeek -N

Lists all loaded scripts, plugins, and protocol analyzers.

Policy Management1

zeek -i <interface> local

Runs Zeek on an interface loading the 'local' policy script set for standard monitoring.

Link

Filtering1

zeek -f <bpf_filter> -i <interface>

Applies a BPF packet filter to limit analysis to specific traffic only.

Link

Logging Formats1

zeek -r <pcap> LogAscii::use_json=T

Forces all log files to be generated in JSON format instead of TSV.

Link

File Analysis2

zeek -r <pcap> frameworks/files/extract-all-files

Automatically extracts all files seen in the traffic to the disk.

Link
zeek -r <pcap> frameworks/files/hash-all-files

Calculates MD5 and SHA1 hashes for all transferred files and adds them to files.log.

Link

Signature Matching1

zeek -s <signature_file> -r <pcap>

Loads a custom signature file to detect specific payload patterns.

Link

Script Debugging1

zeek -B <level> -r <pcap>

Enables verbose debugging output for a specific subsystem like scripts.

Link

Performance Tuning3

zeek -Q -r <pcap>

Runs in quiet mode and disables the watchdog timer for processing large files.

Link
zeek -r <pcap> PacketFilter::default_capture_filter=<bpf>

Sets the default BPF filter via script variable.

Link
zeek -r <pcap> --report-coverage

Reports script coverage statistics after execution.

Link

Event Handling1

zeek -r <pcap> misc/dump-events

Prints every event raised during processing to stdout for script development.

Link

Protocol Analysis3

zeek -r <pcap> protocols/ssl/validate-certs

Performs strict validation of SSL/TLS certificates and logs errors.

Link
zeek -r <pcap> protocols/ssh/detect-bruteforce

Enables logic to detect and log SSH brute force login attempts.

Link
zeek -r <pcap> protocols/smb

Loads detailed SMB analyzers for parsing Windows file sharing traffic.

Link

Incident Response2

zeek -r <pcap> misc/scan

Detects various types of port scans and address scans.

Link
zeek -r <pcap> misc/detect-traceroute

Identifies traceroute traffic and logs the detecting hosts.

Link

Monitoring Statistics1

zeek -r <pcap> misc/capture-loss

Estimates and logs packet loss percentage during the capture.

Link

Script Management1

zeek -r <pcap> misc/loaded-scripts

Logs the names of all scripts that were loaded during the session.

Link

Log Analysis Tool2

zeek-cut <column_names>

Extracts specific columns from Zeek TSV logs for easy reading.

Link
zeek-cut -d <timestamp_column>

Converts epoch timestamps in logs to human-readable date formats.

Link

Package Management3

zkg list

Lists all currently installed Zeek packages.

Link
zkg install <package_source>

Downloads and installs a Zeek package from a git repository.

Link
zkg load <package_name>

Configures a package to be loaded automatically by Zeek.

Link

Cluster Control4

zeekctl deploy

Refreshes policy, installs scripts, and restarts the Zeek cluster.

Link
zeekctl status

Shows the operational status of all Zeek manager, logger, and worker nodes.

Link
zeekctl stop

Gracefully stops all running Zeek processes in the cluster.

Link
zeekctl diag

Collects debugging information and crash dumps from nodes.

Link

Custom Scripting1

zeek -r <pcap> -e <event_handler>

Executes a one-line script handler directly from the command line.

Link

Log Customization3

zeek -r <pcap> Log::default_logdir=<dir>

Changes the output directory for all generated log files.

Link
zeek -r <pcap> LogAscii::log_extension=<ext>

Changes the default file extension for generated log files.

Link
zeek -r <pcap> LogAscii::separator=<char>

Changes the field separator in TSV logs (e.g., to comma).

Link

Advanced Protocol2

zeek -r <pcap> protocols/conn/known-services

Detects and logs services running on non-standard ports.

Link
zeek -r <pcap> protocols/conn/known-hosts

Tracks and logs all unique IP addresses observed on the network.

Link

SOC Workflow3

zeek -r <pcap> frameworks/software/vulnerable

Detects outdated software versions if a version database is provided.

Link
zeek -r <pcap> frameworks/intel/seen

Enables the Intelligence framework to track seen indicators.

Link
zeek -r <pcap> frameworks/intel/do_notice

Configures the Intel framework to generate notices for matches.

Link

Blue Team Validation2

zeek -r <pcap> protocols/dhcp/software

Extracts software and OS information from DHCP requests.

Link
zeek -r <pcap> protocols/dns/detect-external-names

Detects when local clients query external DNS names.

Link

Purple Team Sim2

zeek -r <pcap> protocols/ftp/detect

Detects FTP server activity and potentially brute force attempts.

Link
zeek -r <pcap> protocols/http/detect-sqli

Analyzes HTTP URI and body for SQL injection patterns.

Link

Forensics2

zeek -r <pcap> protocols/rdp

Parses RDP connection details for forensic investigation.

Link
zeek -r <pcap> protocols/smtp/software

Identifies mail server and client software from SMTP banners.

Link

Output Rotation1

zeek -r <pcap> Log::default_rotation_interval=1hr

Sets the interval for rotating log files during long runs.

Link

Automation2

zeek -r <pcap> Input::add_event

Injects input events dynamically for testing logic scripts.

Link
zeek -D <pcap>

Runs Zeek in deterministic mode for debugging consistency.

Link

Advanced Analysis2

zeek -r <pcap> frameworks/packet-filter/utils

Loads utilities for compiling and installing BPF filters dynamically.

Link
zeek -r <pcap> base/protocols/conn/polling

Enables polling of the connection analyzer for long-running connections.

Link

Advanced Logging2

zeek -r <pcap> Log::enable_local_logging=F

Disables local disk logging, often used when shipping logs remotely.

Link
zeek -r <pcap> Log::enable_remote_logging=T

Enables sending logs to a remote logger node.

Link

Cluster Config3

zeekctl config

Prints the current cluster configuration values.

Link
zeekctl check

Verifies the configuration files for errors before deploying.

Link
zeekctl cleanup

Clears state from previous runs and resets the cluster nodes.

Link

Advanced Debugging1

zeek -r <pcap> -g

Dumps the internal state of the script engine for debugging.

Link

Safe Termination1

kill -TERM <pid>

Sends a termination signal to Zeek to ensure logs are flushed properly.

Link