[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6HNBP13CABX05FQQ4HS8RHW":3,"skill-same:01M6HNBP13CABX05FQQ4HS8RHW":104},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":65,"commitSha":66,"skillDirectory":67,"forksCount":68,"repositoryHtmlUrl":69,"repositoryHomepageUrl":6,"ownerHtmlUrl":70,"ownerBlogUrl":6,"ownerDescription":71,"updatedAt":72,"install":73,"resources":86},"01M6HNBP13CABX05FQQ4HS8RHW","performing-network-traffic-analysis-with-zeek",null,"Deploy Zeek network security monitor to capture, parse, and analyze network traffic metadata for threat detection, anomaly identification, and forensic investigation.","HenriqueMC17\u002Fagente-core","HenriqueMC17","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F206460478?v=4","01M6HB63HBBF18AC4H09XTB549","Henrique Monteiro Cardoso","01M6HB63NGSQXWKWCFWW2B20W0",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fperforming-network-traffic-analysis-with-zeek\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"analysis","performing","traffic","with","traffic analysis","performing network traffic analysis with zeek","Zeek","network","ids","network-monitoring","network-traffic","network security","analyze","cm","security monitor","de","threat-detection","monitoring","siem","cybersecurity","2026-11-10 10:12:30",false,"---\nname: performing-network-traffic-analysis-with-zeek\ndescription: Deploy Zeek network security monitor to capture, parse, and analyze network traffic metadata for threat detection, anomaly identification, and forensic investigation.\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\ncategory: performing-network-traffic-analysis-with-zeek\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":44,"author":51,"domain":38,"license":15,"version":52,"category":5,"nist_csf":53,"subdomain":58,"description":7,"mitre_attack":59},[45,28,46,27,47,48,35,49,50],"zeek","traffic-analysis","nids","pcap","forensics","siem-integration","mahipal","1.0",[54,55,56,57],"PR.IR-01","DE.CM-01","ID.AM-03","PR.DS-02","network-security",[60,61,62,63,64],"T1046","T1040","T1557","T1071","T1685.002","main","5eea5b3296f4673b5f481e8bcc1ba76281149f16","modules\u002Fperforming-network-traffic-analysis-with-zeek",0,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core","https:\u002F\u002Fgithub.com\u002FHenriqueMC17","Qualquer tecnologia suficientemente avançada é indistinguível da mágica.","2026-09-28 22:40:38",{"source":8,"skillName":5,"commands":74,"prompt":84,"zipAvailable":85},[75,78,81],{"tool":76,"command":77},"npx","npx skills add HenriqueMC17\u002Fagente-core --skill performing-network-traffic-analysis-with-zeek",{"tool":79,"command":80},"bunx","bunx skills add HenriqueMC17\u002Fagente-core --skill performing-network-traffic-analysis-with-zeek",{"tool":82,"command":83},"pnpm","pnpm dlx skills add HenriqueMC17\u002Fagente-core --skill performing-network-traffic-analysis-with-zeek","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fperforming-network-traffic-analysis-with-zeek\u002FSKILL.md",true,[87,92,98],{"path":88,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":90,"sourceHtmlUrl":91},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fperforming-network-traffic-analysis-with-zeek\u002FLICENSE",{"path":93,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fapi-reference.md","REFERENCE","参考文档",1752,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fperforming-network-traffic-analysis-with-zeek\u002Freferences\u002Fapi-reference.md",{"path":99,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":102,"sourceHtmlUrl":103},"scripts\u002Fagent.py","SCRIPT","脚本",6839,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fperforming-network-traffic-analysis-with-zeek\u002Fscripts\u002Fagent.py",[105,131,156,178,194,212],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":39},"01M6HPFF0RCN0X6WT5EBSV71GY","validating-backup-integrity-for-recovery","Validate backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to ensure backups are reliable for disaster recovery and ransomware response scenarios.","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[],[112,113,114,115,116,117,38,118,119,120,121,122,123,124,125,126,127,128,129,130],"integrity","backup","recovery","validating backup integrity for recovery","for","testing","validate","verification","hash-verification","incident-response","ransomware","detection","t1078","t1490","disaster-recovery","restore","incident","disaster recovery","ransomware response",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":39},"01M6HPFAWJVFK25Q33K3T7WQ8G","triaging-vulnerabilities-with-ssvc-framework","Triage and prioritize vulnerabilities using CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree framework to produce actionable remediation priorities.","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[],[138,139,140,141,22,38,142,143,144,145,146,147,148,149,150,151,152,153,154,155],"vulnerabilities","framework","ssvc","triaging vulnerabilities with ssvc framework","triage and prioritize","CISA","vulnerability-management","risk-management","cvss","remediation","vulnerability","prioritization","decision-tree","prioritize","decision","priorities","actionable","tree",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":39},"01M6HPF6JS9X72WP59094H3ASQ","triaging-security-incident","Performs initial triage of security incidents to determine severity, scope, and required response actions using the NIST SP 800-61r3 and SANS PICERL frameworks. Classifies incidents by type, assigns priority based on business impact, and routes...","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-security-incident\u002FSKILL.md",[],[163,164,128,38,165,166,167,124,125,19,168,169,170,171,172,173,174,175,176,177],"security","triaging security incident","actions","soc","NIST","severity-classification","incident-triage","SANS-PICERL","SOC-operations","picerl","conversion","isolation","scope","impact","consistency",{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":184,"publishedAt":39},"01M6HPF2EX6ZYNYYHKBRJN7GEF","triaging-security-incident-with-ir-playbook","Classify and prioritize security incidents using structured IR playbooks to determine severity, assign response teams, and initiate appropriate response procedures.","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-security-incident-with-ir-playbook\u002FSKILL.md",[],[163,185,186,164,128,22,38,187,166,121,188,189,124,125,190,168,151,191,192,193],"playbook","triaging security incident with ir playbook","teams","IR-playbook","severity","classification","classify","incidents","initiate",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":198,"categories":199,"keywords":200,"publishedAt":39},"01M6HPEY9XPGE7X95AG4XJFQAW","triaging-security-alerts-in-splunk","Triages security alerts in Splunk Enterprise Security by classifying severity, investigating notable events, correlating related telemetry, and making escalation or closure decisions using SPL queries and the Incident Review dashboard. Use when...","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-security-alerts-in-splunk\u002FSKILL.md",[],[163,201,202,203,204,205,38,37,206,207,166,208,124,209,210,211,171,32,128,34],"security alerts","splunk","triaging security alerts in splunk","alerts","review","dashboard","search","correlation-search","t1566","notable-events","incident-review",{"skillNo":213,"name":214,"nameZh":6,"description":215,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":216,"categories":217,"keywords":218,"publishedAt":39},"01M6HPET6XGEPEJPN7V032JGZ0","tracking-threat-actor-infrastructure","Threat actor infrastructure tracking involves monitoring and mapping adversary-controlled assets including command-and-control (C2) servers, phishing domains, exploit kit hosts, bulletproof hosting, a","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftracking-threat-actor-infrastructure\u002FSKILL.md",[],[219,220,221,222,38,36,223,224,225,226,227,209,228,229,32,230,34,231,232,233],"infrastructure","tracking threat actor infrastructure","tracking","threat","mitre-attack","threat-actor","threat-intelligence","command-and-control","dns","command","exploit","intelligence","domains","kit","hosts"]