[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EQ2FTCP4F2EQ7PPDZRV2VK":3,"skill-same:01M7EQ2FTCP4F2EQ7PPDZRV2VK":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":6,"ownerHtmlUrl":54,"ownerBlogUrl":6,"ownerDescription":55,"updatedAt":56,"install":57,"resources":70},"01M7EQ2FTCP4F2EQ7PPDZRV2VK","performing-network-traffic-analysis-with-zeek",null,"Deploy Zeek (formerly Bro) as a passive network security monitor to generate structured logs of protocol metadata (HTTP, DNS, TLS, SSH, SMTP, FTP, and more), write custom detection scripts, and integrate outputs with SIEM platforms. Use when standing up continuous, high-fidelity network traffic monitoring for threat detection, anomaly identification, or forensic investigation beyond what raw PCAP analysis provides.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fperforming-network-traffic-analysis-with-zeek\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-network-traffic-analysis-with-zeek\ndescription: Deploy Zeek (formerly Bro) as a passive network security monitor to generate structured logs of protocol metadata (HTTP, DNS, TLS, SSH, SMTP, FTP, and more), write custom detection scripts, and integrate outputs with SIEM platforms. Use when standing up continuous, high-fidelity network traffic monitoring for threat detection, anomaly identification, or forensic investigation beyond what raw PCAP analysis provides.\ndomain: cybersecurity\nsubdomain: network-security\ntags:\n- zeek\n- network-monitoring\n- traffic-analysis\n- ids\n- nids\n- pcap\n- threat-detection\n- forensics\n- siem-integration\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.IR-01\n- DE.CM-01\n- ID.AM-03\n- PR.DS-02\nmitre_attack:\n- T1046\n- T1040\n- T1557\n- T1071\n- T1685.002\n---\n\n# Performing Network Traffic Analysis with Zeek\n\n## Overview\n\nZeek (formerly Bro) is an open-source network analysis framework that operates as a passive network security monitor. Unlike traditional signature-based IDS tools, Zeek generates high-fidelity structured logs from observed network traffic, capturing detailed metadata for protocols including HTTP, DNS, TLS, SSH, SMTP, FTP, and dozens more. Zeek's extensible scripting language enables custom detection logic, behavioral analysis, and automated response. This skill covers deploying Zeek, understanding its log architecture, writing custom detection scripts, and integrating outputs with SIEM platforms.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing network traffic analysis with zeek\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- Linux server (Ubuntu 22.04+ or CentOS 8+) with 4+ CPU cores and 8GB+ RAM\n- Network TAP or SPAN port mirroring configured for traffic capture\n- Zeek 6.0+ installed (via package manager or source compilation)\n- Root or capture group privileges for packet capture\n- SIEM platform (Splunk, ELK Stack, or QRadar) for log ingestion\n\n## Core Concepts\n\n### Zeek Architecture\n\nZeek operates in two main modes:\n\n1. **Live Capture** - Monitors traffic in real-time on one or more network interfaces\n2. **Offline Analysis** - Processes saved PCAP files for retrospective analysis\n\nThe processing pipeline consists of:\n\n- **Packet Capture Layer** - Reads raw packets from interfaces or PCAP files\n- **Event Engine** - Reassembles TCP streams and generates protocol events\n- **Script Interpreter** - Executes Zeek scripts that process events and generate logs\n- **Log Framework** - Writes structured logs in TSV, JSON, or custom formats\n\n### Log Architecture\n\nZeek generates protocol-specific log files:\n\n| Log File | Description |\n|----------|-------------|\n| `conn.log` | TCP\u002FUDP\u002FICMP connection summaries with duration, bytes, state |\n| `dns.log` | DNS queries and responses with query type, answers, TTL |\n| `http.log` | HTTP requests\u002Fresponses with URIs, user agents, MIME types |\n| `ssl.log` | TLS handshake details including certificate chain, JA3\u002FJA3S |\n| `files.log` | File transfers with MIME types, hashes (MD5, SHA1, SHA256) |\n| `notice.log` | Alerts generated by Zeek detection scripts |\n| `weird.log` | Protocol anomalies and unexpected behaviors |\n| `x509.log` | Certificate details from TLS connections |\n| `smtp.log` | Email metadata including sender, recipient, subject |\n| `ssh.log` | SSH connection details and authentication results |\n| `pe.log` | Portable Executable file metadata |\n| `dpd.log` | Dynamic Protocol Detection failures |\n\n## Workflow\n\n### Step 1: Install and Configure Zeek\n\n```bash\n# Install Zeek on Ubuntu\nsudo apt-get install -y zeek\n\n# Or install from Zeek repository\necho 'deb http:\u002F\u002Fdownload.opensuse.org\u002Frepositories\u002Fsecurity:\u002Fzeek\u002FxUbuntu_22.04\u002F \u002F' | \\\n    sudo tee \u002Fetc\u002Fapt\u002Fsources.list.d\u002Fzeek.list\nsudo apt-get update && sudo apt-get install -y zeek-lts\n\n# Verify installation\nzeek --version\n```\n\nConfigure the node layout in `\u002Fopt\u002Fzeek\u002Fetc\u002Fnode.cfg`:\n\n```ini\n[manager]\ntype=manager\nhost=localhost\n\n[proxy-1]\ntype=proxy\nhost=localhost\n\n[worker-1]\ntype=worker\nhost=localhost\ninterface=eth0\nlb_method=pf_ring\nlb_procs=4\n\n[worker-2]\ntype=worker\nhost=localhost\ninterface=eth1\nlb_method=pf_ring\nlb_procs=4\n```\n\nConfigure network definitions in `\u002Fopt\u002Fzeek\u002Fetc\u002Fnetworks.cfg`:\n\n```\n# Internal network ranges\n10.0.0.0\u002F8         Private RFC1918\n172.16.0.0\u002F12      Private RFC1918\n192.168.0.0\u002F16     Private RFC1918\n```\n\n### Step 2: Configure Logging and Output\n\nEdit `\u002Fopt\u002Fzeek\u002Fshare\u002Fzeek\u002Fsite\u002Flocal.zeek`:\n\n```zeek\n# Load standard detection scripts\n@load base\u002Fprotocols\u002Fconn\n@load base\u002Fprotocols\u002Fdns\n@load base\u002Fprotocols\u002Fhttp\n@load base\u002Fprotocols\u002Fssl\n@load base\u002Fprotocols\u002Fssh\n@load base\u002Fprotocols\u002Fsmtp\n@load base\u002Fprotocols\u002Fftp\n\n# Load file analysis\n@load base\u002Ffiles\u002Fhash-all-files\n@load base\u002Ffiles\u002Fextract-all-files\n\n# Load detection frameworks\n@load base\u002Fframeworks\u002Fnotice\n@load base\u002Fframeworks\u002Fintel\n@load base\u002Fframeworks\u002Ffiles\n@load base\u002Fframeworks\u002Fsoftware\n\n# Load additional protocol analyzers\n@load policy\u002Fprotocols\u002Fssl\u002Fvalidate-certs\n@load policy\u002Fprotocols\u002Fssl\u002Flog-hostcerts-only\n@load policy\u002Fprotocols\u002Fssh\u002Fdetect-bruteforcing\n@load policy\u002Fprotocols\u002Fdns\u002Fdetect-external-names\n@load policy\u002Fprotocols\u002Fhttp\u002Fdetect-sqli\n\n# Enable JA3 fingerprinting\n@load policy\u002Fprotocols\u002Fssl\u002Fja3\n\n# Enable JSON output for SIEM ingestion\n@load policy\u002Ftuning\u002Fjson-logs\n\nredef LogAscii::use_json = T;\n\n# Configure file extraction directory\nredef FileExtract::prefix = \"\u002Fopt\u002Fzeek\u002Fextracted\u002F\";\n\n# Set notice email\nredef Notice::mail_dest = \"soc@example.com\";\n```\n\n### Step 3: Write Custom Detection Scripts\n\nCreate detection scripts for common threats:\n\n**Detect DNS Tunneling** (`\u002Fopt\u002Fzeek\u002Fshare\u002Fzeek\u002Fsite\u002Fdetect-dns-tunnel.zeek`):\n\n```zeek\n@load base\u002Fprotocols\u002Fdns\n\nmodule DNSTunnel;\n\nexport {\n    redef enum Notice::Type += {\n        DNS_Tunnel_Suspected\n    };\n\n    # Threshold for suspicious DNS query length\n    const query_len_threshold = 50 &redef;\n\n    # Track query counts per host per domain\n    global dns_query_counts: table[addr, string] of count &default=0 &create_expire=5min;\n\n    # High query volume threshold\n    const query_volume_threshold = 100 &redef;\n}\n\nevent dns_request(c: connection, msg: dns_msg, query: string, qtype: count, qclass: count)\n{\n    if ( |query| > query_len_threshold )\n    {\n        local parts = split_string(query, \u002F\\.\u002F);\n        if ( |parts| > 3 )\n        {\n            local base_domain = cat(parts[|parts|-2], \".\", parts[|parts|-1]);\n            dns_query_counts[c$id$orig_h, base_domain] += 1;\n\n            if ( dns_query_counts[c$id$orig_h, base_domain] > query_volume_threshold )\n            {\n                NOTICE([$note=DNS_Tunnel_Suspected,\n                        $msg=fmt(\"Possible DNS tunneling: %s queries to %s with long query names\",\n                                 c$id$orig_h, base_domain),\n                        $conn=c,\n                        $identifier=cat(c$id$orig_h, base_domain),\n                        $suppress_for=30min]);\n            }\n        }\n    }\n}\n```\n\n**Detect Beaconing Behavior** (`\u002Fopt\u002Fzeek\u002Fshare\u002Fzeek\u002Fsite\u002Fdetect-beaconing.zeek`):\n\n```zeek\n@load base\u002Fprotocols\u002Fconn\n\nmodule Beaconing;\n\nexport {\n    redef enum Notice::Type += {\n        C2_Beacon_Detected\n    };\n\n    # Track connection intervals\n    global conn_intervals: table[addr, addr, port] of vector of time &create_expire=1hr;\n\n    const min_connections = 20 &redef;\n    const jitter_threshold = 0.15 &redef;\n}\n\nevent connection_state_remove(c: connection)\n{\n    if ( c$id$resp_p == 80\u002Ftcp || c$id$resp_p == 443\u002Ftcp )\n    {\n        local key = [c$id$orig_h, c$id$resp_h, c$id$resp_p];\n\n        if ( key !in conn_intervals )\n            conn_intervals[key] = vector();\n\n        conn_intervals[key] += network_time();\n\n        if ( |conn_intervals[key]| >= min_connections )\n        {\n            local intervals: vector of interval = vector();\n            local i = 1;\n            while ( i \u003C |conn_intervals[key]| )\n            {\n                intervals += conn_intervals[key][i] - conn_intervals[key][i-1];\n                i += 1;\n            }\n\n            # Calculate mean and standard deviation\n            local sum_val = 0.0;\n            for ( idx in intervals )\n                sum_val += interval_to_double(intervals[idx]);\n\n            local mean_val = sum_val \u002F |intervals|;\n\n            local variance = 0.0;\n            for ( idx in intervals )\n            {\n                local diff = interval_to_double(intervals[idx]) - mean_val;\n                variance += diff * diff;\n            }\n            variance = variance \u002F |intervals|;\n            local stddev = sqrt(variance);\n\n            if ( mean_val > 0 && (stddev \u002F mean_val) \u003C jitter_threshold )\n            {\n                NOTICE([$note=C2_Beacon_Detected,\n                        $msg=fmt(\"Possible C2 beaconing: %s -> %s:%s (interval=%.1fs, jitter=%.2f)\",\n                                 c$id$orig_h, c$id$resp_h, c$id$resp_p,\n                                 mean_val, stddev\u002Fmean_val),\n                        $conn=c,\n                        $identifier=cat(c$id$orig_h, c$id$resp_h),\n                        $suppress_for=1hr]);\n            }\n        }\n    }\n}\n```\n\n### Step 4: Configure Intel Framework\n\nLoad threat intelligence feeds into Zeek:\n\n```zeek\n# In local.zeek\n@load frameworks\u002Fintel\u002Fseen\n@load frameworks\u002Fintel\u002Fdo_notice\n\nredef Intel::read_files += {\n    \"\u002Fopt\u002Fzeek\u002Fintel\u002Fmalicious-ips.intel\",\n    \"\u002Fopt\u002Fzeek\u002Fintel\u002Fmalicious-domains.intel\",\n    \"\u002Fopt\u002Fzeek\u002Fintel\u002Fmalicious-hashes.intel\",\n};\n```\n\nIntel file format (`\u002Fopt\u002Fzeek\u002Fintel\u002Fmalicious-ips.intel`):\n\n```\n#fields\tindicator\tindicator_type\tmeta.source\tmeta.desc\tmeta.do_notice\n198.51.100.50\tIntel::ADDR\tabuse.ch\tKnown C2 server\tT\n203.0.113.100\tIntel::ADDR\tthreatfeed\tRansomware infrastructure\tT\n```\n\n### Step 5: Deploy and Operate\n\n```bash\n# Deploy Zeek cluster\nsudo \u002Fopt\u002Fzeek\u002Fbin\u002Fzeekctl deploy\n\n# Check cluster status\nsudo \u002Fopt\u002Fzeek\u002Fbin\u002Fzeekctl status\n\n# Process offline PCAP\nzeek -r capture.pcap local.zeek\n\n# View logs\ncat \u002Fopt\u002Fzeek\u002Flogs\u002Fcurrent\u002Fconn.log | zeek-cut id.orig_h id.resp_h id.resp_p proto service duration orig_bytes resp_bytes\n\n# Search for specific connections\ncat \u002Fopt\u002Fzeek\u002Flogs\u002Fcurrent\u002Fdns.log | zeek-cut query answers | grep -i \"suspicious\"\n\n# Rotate logs\nsudo \u002Fopt\u002Fzeek\u002Fbin\u002Fzeekctl cron\n```\n\n### Step 6: SIEM Integration\n\n**Filebeat configuration for ELK Stack:**\n\n```yaml\nfilebeat.inputs:\n  - type: log\n    enabled: true\n    paths:\n      - \u002Fopt\u002Fzeek\u002Flogs\u002Fcurrent\u002F*.log\n    json.keys_under_root: true\n    json.add_error_key: true\n    fields:\n      source: zeek\n    fields_under_root: true\n\noutput.elasticsearch:\n  hosts: [\"https:\u002F\u002Felasticsearch:9200\"]\n  index: \"zeek-%{+yyyy.MM.dd}\"\n\nsetup.template.name: \"zeek\"\nsetup.template.pattern: \"zeek-*\"\n```\n\n## Analysis Techniques\n\n### Connection Analysis\n\n```bash\n# Find top talkers by bytes\ncat conn.log | zeek-cut id.orig_h orig_bytes | sort -t$'\\t' -k2 -rn | head -20\n\n# Find long-duration connections (potential C2)\ncat conn.log | zeek-cut id.orig_h id.resp_h id.resp_p duration | awk '$4 > 3600' | sort -t$'\\t' -k4 -rn\n\n# Find connections with unusual ports\ncat conn.log | zeek-cut id.resp_p proto | sort | uniq -c | sort -rn | head -30\n```\n\n### TLS Analysis\n\n```bash\n# Find self-signed certificates\ncat ssl.log | zeek-cut server_name validation_status | grep \"self signed\"\n\n# Extract JA3 fingerprints for known malware\ncat ssl.log | zeek-cut ja3 server_name | sort | uniq -c | sort -rn\n\n# Find expired certificates\ncat ssl.log | zeek-cut server_name not_valid_after | awk -F'\\t' '$2 \u003C systime()'\n```\n\n## Best Practices\n\n- **TAP Over SPAN** - Use network TAPs instead of SPAN ports to avoid packet loss under load\n- **Worker Scaling** - Assign 1 Zeek worker per 1 Gbps of monitored traffic\n- **AF_PACKET Clusters** - Use AF_PACKET with load balancing for multi-core processing\n- **Log Rotation** - Configure automatic log rotation and archival (default: hourly)\n- **Intel Updates** - Automate threat intelligence feed updates at least daily\n- **Packet Loss Monitoring** - Monitor `capture_loss.log` for dropped packets\n- **Custom Scripts** - Develop organization-specific detections based on threat landscape\n\n## References\n\n- [Zeek Documentation](https:\u002F\u002Fdocs.zeek.org\u002Fen\u002Fmaster\u002F)\n- [Zeek Scripting Reference](https:\u002F\u002Fdocs.zeek.org\u002Fen\u002Fmaster\u002Fscript-reference\u002Findex.html)\n- [Zeek Intel Framework](https:\u002F\u002Fdocs.zeek.org\u002Fen\u002Fmaster\u002Fframeworks\u002Fintel.html)\n- [CISA Zeek Resources](https:\u002F\u002Fwww.cisa.gov\u002Fresources-tools\u002Fservices\u002Fkismet)\n- [Zeek GitHub Repository](https:\u002F\u002Fgithub.com\u002Fzeek\u002Fzeek)\n","# Performing Network Traffic Analysis with Zeek\n\n## Overview\n\nZeek (formerly Bro) is an open-source network analysis framework that operates as a passive network security monitor. Unlike traditional signature-based IDS tools, Zeek generates high-fidelity structured logs from observed network traffic, capturing detailed metadata for protocols including HTTP, DNS, TLS, SSH, SMTP, FTP, and dozens more. Zeek's extensible scripting language enables custom detection logic, behavioral analysis, and automated response. This skill covers deploying Zeek, understanding its log architecture, writing custom detection scripts, and integrating outputs with SIEM platforms.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing network traffic analysis with zeek\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- Linux server (Ubuntu 22.04+ or CentOS 8+) with 4+ CPU cores and 8GB+ RAM\n- Network TAP or SPAN port mirroring configured for traffic capture\n- Zeek 6.0+ installed (via package manager or source compilation)\n- Root or capture group privileges for packet capture\n- SIEM platform (Splunk, ELK Stack, or QRadar) for log ingestion\n\n## Core Concepts\n\n### Zeek Architecture\n\nZeek operates in two main modes:\n\n1. **Live Capture** - Monitors traffic in real-time on one or more network interfaces\n2. **Offline Analysis** - Processes saved PCAP files for retrospective analysis\n\nThe processing pipeline consists of:\n\n- **Packet Capture Layer** - Reads raw packets from interfaces or PCAP files\n- **Event Engine** - Reassembles TCP streams and generates protocol events\n- **Script Interpreter** - Executes Zeek scripts that process events and generate logs\n- **Log Framework** - Writes structured logs in TSV, JSON, or custom formats\n\n### Log Architecture\n\nZeek generates protocol-specific log files:\n\n| Log File | Description |\n|----------|-------------|\n| `conn.log` | TCP\u002FUDP\u002FICMP connection summaries with duration, bytes, state |\n| `dns.log` | DNS queries and responses with query type, answers, TTL |\n| `http.log` | HTTP requests\u002Fresponses with URIs, user agents, MIME types |\n| `ssl.log` | TLS handshake details including certificate chain, JA3\u002FJA3S |\n| `files.log` | File transfers with MIME types, hashes (MD5, SHA1, SHA256) |\n| `notice.log` | Alerts generated by Zeek detection scripts |\n| `weird.log` | Protocol anomalies and unexpected behaviors |\n| `x509.log` | Certificate details from TLS connections |\n| `smtp.log` | Email metadata including sender, recipient, subject |\n| `ssh.log` | SSH connection details and authentication results |\n| `pe.log` | Portable Executable file metadata |\n| `dpd.log` | Dynamic Protocol Detection failures |\n\n## Workflow\n\n### Step 1: Install and Configure Zeek\n\n```bash\n# Install Zeek on Ubuntu\nsudo apt-get install -y zeek\n\n# Or install from Zeek repository\necho 'deb http:\u002F\u002Fdownload.opensuse.org\u002Frepositories\u002Fsecurity:\u002Fzeek\u002FxUbuntu_22.04\u002F \u002F' | \\\n    sudo tee \u002Fetc\u002Fapt\u002Fsources.list.d\u002Fzeek.list\nsudo apt-get update && sudo apt-get install -y zeek-lts\n\n# Verify installation\nzeek --version\n```\n\nConfigure the node layout in `\u002Fopt\u002Fzeek\u002Fetc\u002Fnode.cfg`:\n\n```ini\n[manager]\ntype=manager\nhost=localhost\n\n[proxy-1]\ntype=proxy\nhost=localhost\n\n[worker-1]\ntype=worker\nhost=localhost\ninterface=eth0\nlb_method=pf_ring\nlb_procs=4\n\n[worker-2]\ntype=worker\nhost=localhost\ninterface=eth1\nlb_method=pf_ring\nlb_procs=4\n```\n\nConfigure network definitions in `\u002Fopt\u002Fzeek\u002Fetc\u002Fnetworks.cfg`:\n\n```\n# Internal network ranges\n10.0.0.0\u002F8         Private RFC1918\n172.16.0.0\u002F12      Private RFC1918\n192.168.0.0\u002F16     Private RFC1918\n```\n\n### Step 2: Configure Logging and Output\n\nEdit `\u002Fopt\u002Fzeek\u002Fshare\u002Fzeek\u002Fsite\u002Flocal.zeek`:\n\n```zeek\n# Load standard detection scripts\n@load base\u002Fprotocols\u002Fconn\n@load base\u002Fprotocols\u002Fdns\n@load base\u002Fprotocols\u002Fhttp\n@load base\u002Fprotocols\u002Fssl\n@load base\u002Fprotocols\u002Fssh\n@load base\u002Fprotocols\u002Fsmtp\n@load base\u002Fprotocols\u002Fftp\n\n# Load file analysis\n@load base\u002Ffiles\u002Fhash-all-files\n@load base\u002Ffiles\u002Fextract-all-files\n\n# Load detection frameworks\n@load base\u002Fframeworks\u002Fnotice\n@load base\u002Fframeworks\u002Fintel\n@load base\u002Fframeworks\u002Ffiles\n@load base\u002Fframeworks\u002Fsoftware\n\n# Load additional protocol analyzers\n@load policy\u002Fprotocols\u002Fssl\u002Fvalidate-certs\n@load policy\u002Fprotocols\u002Fssl\u002Flog-hostcerts-only\n@load policy\u002Fprotocols\u002Fssh\u002Fdetect-bruteforcing\n@load policy\u002Fprotocols\u002Fdns\u002Fdetect-external-names\n@load policy\u002Fprotocols\u002Fhttp\u002Fdetect-sqli\n\n# Enable JA3 fingerprinting\n@load policy\u002Fprotocols\u002Fssl\u002Fja3\n\n# Enable JSON output for SIEM ingestion\n@load policy\u002Ftuning\u002Fjson-logs\n\nredef LogAscii::use_json = T;\n\n# Configure file extraction directory\nredef FileExtract::prefix = \"\u002Fopt\u002Fzeek\u002Fextracted\u002F\";\n\n# Set notice email\nredef Notice::mail_dest = \"soc@example.com\";\n```\n\n### Step 3: Write Custom Detection Scripts\n\nCreate detection scripts for common threats:\n\n**Detect DNS Tunneling** (`\u002Fopt\u002Fzeek\u002Fshare\u002Fzeek\u002Fsite\u002Fdetect-dns-tunnel.zeek`):\n\n```zeek\n@load base\u002Fprotocols\u002Fdns\n\nmodule DNSTunnel;\n\nexport {\n    redef enum Notice::Type += {\n        DNS_Tunnel_Suspected\n    };\n\n    # Threshold for suspicious DNS query length\n    const query_len_threshold = 50 &redef;\n\n    # Track query counts per host per domain\n    global dns_query_counts: table[addr, string] of count &default=0 &create_expire=5min;\n\n    # High query volume threshold\n    const query_volume_threshold = 100 &redef;\n}\n\nevent dns_request(c: connection, msg: dns_msg, query: string, qtype: count, qclass: count)\n{\n    if ( |query| > query_len_threshold )\n    {\n        local parts = split_string(query, \u002F\\.\u002F);\n        if ( |parts| > 3 )\n        {\n            local base_domain = cat(parts[|parts|-2], \".\", parts[|parts|-1]);\n            dns_query_counts[c$id$orig_h, base_domain] += 1;\n\n            if ( dns_query_counts[c$id$orig_h, base_domain] > query_volume_threshold )\n            {\n                NOTICE([$note=DNS_Tunnel_Suspected,\n                        $msg=fmt(\"Possible DNS tunneling: %s queries to %s with long query names\",\n                                 c$id$orig_h, base_domain),\n                        $conn=c,\n                        $identifier=cat(c$id$orig_h, base_domain),\n                        $suppress_for=30min]);\n            }\n        }\n    }\n}\n```\n\n**Detect Beaconing Behavior** (`\u002Fopt\u002Fzeek\u002Fshare\u002Fzeek\u002Fsite\u002Fdetect-beaconing.zeek`):\n\n```zeek\n@load base\u002Fprotocols\u002Fconn\n\nmodule Beaconing;\n\nexport {\n    redef enum Notice::Type += {\n        C2_Beacon_Detected\n    };\n\n    # Track connection intervals\n    global conn_intervals: table[addr, addr, port] of vector of time &create_expire=1hr;\n\n    const min_connections = 20 &redef;\n    const jitter_threshold = 0.15 &redef;\n}\n\nevent connection_state_remove(c: connection)\n{\n    if ( c$id$resp_p == 80\u002Ftcp || c$id$resp_p == 443\u002Ftcp )\n    {\n        local key = [c$id$orig_h, c$id$resp_h, c$id$resp_p];\n\n        if ( key !in conn_intervals )\n            conn_intervals[key] = vector();\n\n        conn_intervals[key] += network_time();\n\n        if ( |conn_intervals[key]| >= min_connections )\n        {\n            local intervals: vector of interval = vector();\n            local i = 1;\n            while ( i \u003C |conn_intervals[key]| )\n            {\n                intervals += conn_intervals[key][i] - conn_intervals[key][i-1];\n                i += 1;\n            }\n\n            # Calculate mean and standard deviation\n            local sum_val = 0.0;\n            for ( idx in intervals )\n                sum_val += interval_to_double(intervals[idx]);\n\n            local mean_val = sum_val \u002F |intervals|;\n\n            local variance = 0.0;\n            for ( idx in intervals )\n            {\n                local diff = interval_to_double(intervals[idx]) - mean_val;\n                variance += diff * diff;\n            }\n            variance = variance \u002F |intervals|;\n            local stddev = sqrt(variance);\n\n            if ( mean_val > 0 && (stddev \u002F mean_val) \u003C jitter_threshold )\n            {\n                NOTICE([$note=C2_Beacon_Detected,\n                        $msg=fmt(\"Possible C2 beaconing: %s -> %s:%s (interval=%.1fs, jitter=%.2f)\",\n                                 c$id$orig_h, c$id$resp_h, c$id$resp_p,\n                                 mean_val, stddev\u002Fmean_val),\n                        $conn=c,\n                        $identifier=cat(c$id$orig_h, c$id$resp_h),\n                        $suppress_for=1hr]);\n            }\n        }\n    }\n}\n```\n\n### Step 4: Configure Intel Framework\n\nLoad threat intelligence feeds into Zeek:\n\n```zeek\n# In local.zeek\n@load frameworks\u002Fintel\u002Fseen\n@load frameworks\u002Fintel\u002Fdo_notice\n\nredef Intel::read_files += {\n    \"\u002Fopt\u002Fzeek\u002Fintel\u002Fmalicious-ips.intel\",\n    \"\u002Fopt\u002Fzeek\u002Fintel\u002Fmalicious-domains.intel\",\n    \"\u002Fopt\u002Fzeek\u002Fintel\u002Fmalicious-hashes.intel\",\n};\n```\n\nIntel file format (`\u002Fopt\u002Fzeek\u002Fintel\u002Fmalicious-ips.intel`):\n\n```\n#fields\tindicator\tindicator_type\tmeta.source\tmeta.desc\tmeta.do_notice\n198.51.100.50\tIntel::ADDR\tabuse.ch\tKnown C2 server\tT\n203.0.113.100\tIntel::ADDR\tthreatfeed\tRansomware infrastructure\tT\n```\n\n### Step 5: Deploy and Operate\n\n```bash\n# Deploy Zeek cluster\nsudo \u002Fopt\u002Fzeek\u002Fbin\u002Fzeekctl deploy\n\n# Check cluster status\nsudo \u002Fopt\u002Fzeek\u002Fbin\u002Fzeekctl status\n\n# Process offline PCAP\nzeek -r capture.pcap local.zeek\n\n# View logs\ncat \u002Fopt\u002Fzeek\u002Flogs\u002Fcurrent\u002Fconn.log | zeek-cut id.orig_h id.resp_h id.resp_p proto service duration orig_bytes resp_bytes\n\n# Search for specific connections\ncat \u002Fopt\u002Fzeek\u002Flogs\u002Fcurrent\u002Fdns.log | zeek-cut query answers | grep -i \"suspicious\"\n\n# Rotate logs\nsudo \u002Fopt\u002Fzeek\u002Fbin\u002Fzeekctl cron\n```\n\n### Step 6: SIEM Integration\n\n**Filebeat configuration for ELK Stack:**\n\n```yaml\nfilebeat.inputs:\n  - type: log\n    enabled: true\n    paths:\n      - \u002Fopt\u002Fzeek\u002Flogs\u002Fcurrent\u002F*.log\n    json.keys_under_root: true\n    json.add_error_key: true\n    fields:\n      source: zeek\n    fields_under_root: true\n\noutput.elasticsearch:\n  hosts: [\"https:\u002F\u002Felasticsearch:9200\"]\n  index: \"zeek-%{+yyyy.MM.dd}\"\n\nsetup.template.name: \"zeek\"\nsetup.template.pattern: \"zeek-*\"\n```\n\n## Analysis Techniques\n\n### Connection Analysis\n\n```bash\n# Find top talkers by bytes\ncat conn.log | zeek-cut id.orig_h orig_bytes | sort -t$'\\t' -k2 -rn | head -20\n\n# Find long-duration connections (potential C2)\ncat conn.log | zeek-cut id.orig_h id.resp_h id.resp_p duration | awk '$4 > 3600' | sort -t$'\\t' -k4 -rn\n\n# Find connections with unusual ports\ncat conn.log | zeek-cut id.resp_p proto | sort | uniq -c | sort -rn | head -30\n```\n\n### TLS Analysis\n\n```bash\n# Find self-signed certificates\ncat ssl.log | zeek-cut server_name validation_status | grep \"self signed\"\n\n# Extract JA3 fingerprints for known malware\ncat ssl.log | zeek-cut ja3 server_name | sort | uniq -c | sort -rn\n\n# Find expired certificates\ncat ssl.log | zeek-cut server_name not_valid_after | awk -F'\\t' '$2 \u003C systime()'\n```\n\n## Best Practices\n\n- **TAP Over SPAN** - Use network TAPs instead of SPAN ports to avoid packet loss under load\n- **Worker Scaling** - Assign 1 Zeek worker per 1 Gbps of monitored traffic\n- **AF_PACKET Clusters** - Use AF_PACKET with load balancing for multi-core processing\n- **Log Rotation** - Configure automatic log rotation and archival (default: hourly)\n- **Intel Updates** - Automate threat intelligence feed updates at least daily\n- **Packet Loss Monitoring** - Monitor `capture_loss.log` for dropped packets\n- **Custom Scripts** - Develop organization-specific detections based on threat landscape\n\n## References\n\n- [Zeek Documentation](https:\u002F\u002Fdocs.zeek.org\u002Fen\u002Fmaster\u002F)\n- [Zeek Scripting Reference](https:\u002F\u002Fdocs.zeek.org\u002Fen\u002Fmaster\u002Fscript-reference\u002Findex.html)\n- [Zeek Intel Framework](https:\u002F\u002Fdocs.zeek.org\u002Fen\u002Fmaster\u002Fframeworks\u002Fintel.html)\n- [CISA Zeek Resources](https:\u002F\u002Fwww.cisa.gov\u002Fresources-tools\u002Fservices\u002Fkismet)\n- [Zeek GitHub Repository](https:\u002F\u002Fgithub.com\u002Fzeek\u002Fzeek)\n",{"name":5,"tags":24,"author":34,"domain":35,"license":15,"version":36,"nist_csf":37,"subdomain":42,"description":7,"mitre_attack":43},[25,26,27,28,29,30,31,32,33],"zeek","network-monitoring","traffic-analysis","ids","nids","pcap","threat-detection","forensics","siem-integration","mahipal","cybersecurity","1.0",[38,39,40,41],"PR.IR-01","DE.CM-01","ID.AM-03","PR.DS-02","network-security",[44,45,46,47,48],"T1046","T1040","T1557","T1071","T1685.002","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fperforming-network-traffic-analysis-with-zeek",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill performing-network-traffic-analysis-with-zeek",{"tool":63,"command":64},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill performing-network-traffic-analysis-with-zeek",{"tool":66,"command":67},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill performing-network-traffic-analysis-with-zeek","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fperforming-network-traffic-analysis-with-zeek\u002FSKILL.md",true,[71],{"path":72,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fapi-reference.md","REFERENCE","参考文档",1752,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fperforming-network-traffic-analysis-with-zeek\u002Freferences\u002Fapi-reference.md",[78,87,92,99,106,113],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":86},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":88,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":86},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":86},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":86},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":86},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":86},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]