Chuyển đến nội dung
Skillpedia
Agent35k · #7853

detecting-network-anomalies-with-zeek

Skill này làm gì

Công cụ này theo dõi lưu lượng mạng của máy tính để tìm hoạt động đáng ngờ hoặc bất thường. Nó tạo báo cáo chi tiết về kết nối, truy cập internet và việc truyền tệp, giúp nhận diện mối đe dọa.

Khi nào nên dùng

  • ✓Khi giám sát an ninh mạng theo thời gian thực.
  • ✓Khi điều tra các sự cố bảo mật đã xảy ra trước đó.
  • ✓Khi tạo quy tắc tùy chỉnh để phát hiện các mối đe dọa cụ thể.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-network-anomalies-with-zeek/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-network-anomalies-with-zeek/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy thiết lập Zeek để giám sát mạng và cảnh báo tôi nếu phát hiện kết nối đáng ngờ.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Zeek được cài tại một điểm chiến lược trong mạng và phân tích thụ động toàn bộ lưu lượng. Nó tạo nhật ký chi tiết để dùng nhận diện bất thường và mối đe dọa.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Detecting Network Anomalies with Zeek

When to Use

  • Deploying passive network security monitoring at key network choke points for continuous visibility
  • Generating structured connection, DNS, HTTP, SSL, and file transfer logs for SIEM ingestion and threat hunting
  • Writing custom Zeek scripts to detect organization-specific threats, policy violations, or beaconing behavior
  • Performing retrospective analysis on network metadata to investigate security incidents
  • Complementing IDS solutions with protocol-level metadata analysis that signature-based tools may miss

Do not use as a replacement for inline IDS/IPS that can actively block traffic, for monitoring encrypted payloads without TLS inspection, or on endpoints where host-based agents are more appropriate.

Prerequisites

  • Zeek 6.0+ installed from source or package manager (zeek --version)
  • Network interface configured on a span port, network tap, or virtual switch mirror for passive capture
  • Sufficient disk storage for log files (estimate 1-5 GB/day per 100 Mbps of monitored traffic)
  • Familiarity with Zeek's scripting language for writing custom detections
  • Log aggregation system (Splunk, Elastic, Graylog) for centralized analysis

Workflow

Step 1: Install and Configure Zeek

# Install Zeek on Ubuntu/Debian
sudo apt install -y zeek

# Or install from source for latest version
git clone --recursive https://github.com/zeek/zeek
cd zeek && ./configure --prefix=/opt/zeek && make -j$(nproc) && sudo make install
export PATH=/opt/zeek/bin:$PATH

# Configure the monitoring interface
sudo vi /opt/zeek/etc/node.cfg
# /opt/zeek/etc/node.cfg
[zeek]
type=standalone
host=localhost
interface=eth1
# Configure local network definitions
sudo vi /opt/zeek/etc/networks.cfg
# /opt/zeek/etc/networks.cfg
10.0.0.0/8       Internal
172.16.0.0/12    Internal
192.168.0.0/16   Internal
# Disable NIC offloading for accurate packet capture
sudo ethtool -K eth1 rx off tx off gro off lro off tso off gso off

# Deploy Zeek
sudo zeekctl deploy

# Verify Zeek is running
sudo zeekctl status

Step 2: Understand and Navigate Zeek Logs

# Zeek generates structured log files in /opt/zeek/logs/current/
ls /opt/zeek/logs/current/

# Key log files:
# conn.log       - All network connections (TCP, UDP, ICMP)
# dns.log        - DNS queries and responses
# http.log       - HTTP requests and responses
# ssl.log        - SSL/TLS handshake details
# files.log      - File transfers observed on the network
# notice.log     - Alerts from Zeek detection scripts
# weird.log      - Protocol anomalies and errors
# x509.log       - X.509 certificate details
# smtp.log       - SMTP email transactions
# ssh.log        - SSH connection details

# View connection log with zeek-cut for column selection
cat /opt/zeek/logs/current/conn.log | zeek-cut ts id.orig_h id.orig_p id.resp_h id.resp_p proto service duration orig_bytes resp_bytes

# View DNS log
cat /opt/zeek/logs/current/dns.log | zeek-cut ts id.orig_h query qtype_name answers

# View HTTP log
cat /opt/zeek/logs/current/http.log | zeek-cut ts id.orig_h host uri method status_code user_agent

Step 3: Write Custom Detection Scripts

# Create a custom detection script directory
sudo mkdir -p /opt/zeek/share/zeek/site/custom-detections

Create a script for detecting DNS tunneling:

# /opt/zeek/share/zeek/site/custom-detections/dns-tunneling.zeek
@load base/frameworks/notice

module DNSTunneling;

export {
    redef enum Notice::Type += {
        DNS_Tunneling_Detected,
        DNS_Long_Query
    };

    # Threshold: number of unique queries per source in time window
    const query_threshold: count = 200 &redef;
    const time_window: interval = 5min &redef;
    const max_query_length: count = 50 &redef;
}

# Track query counts per source IP
global dns_query_counts: table[addr] of count &create_expire=5min &default=0;

event dns_request(c: connection, msg: dns_msg, query: string, qtype: count, qclass: count)
{
    local src = c$id$orig_h;

    # Check for unusually long domain queries (base64-encoded data)
    if ( |query| > max_query_length )
    {
        NOTICE([
            $note=DNS_Long_Query,
            $msg=fmt("Unusually long DNS query from %s: %s (%d chars)", src, query, |query|),
            $src=src,
            $identifier=cat(src, query)
        ]);
    }

    # Track query volume per source
    dns_query_counts[src] += 1;


…
Câu hỏi thường gặp

“Bất thường mạng” là gì?

Đó là các mẫu lưu lượng lệch khỏi mức bình thường và có thể cho thấy hoạt động độc hại, chẳng hạn cố xâm nhập hoặc giao tiếp với máy chủ nguy hiểm.

Zeek có chặn được lưu lượng nguy hiểm không?

Không, Zeek chỉ quan sát và báo cáo. Nó không chủ động ngăn lưu lượng đi qua, mà bổ sung cho các công cụ bảo mật khác.

Tôi có cần là chuyên gia để dùng Zeek không?

Với việc thiết lập cơ bản và phân tích báo cáo thì không cần. Tuy nhiên, tạo quy tắc phát hiện tùy chỉnh đòi hỏi kiến thức về ngôn ngữ script của Zeek.

Chi tiết

Mô tả gốc của tác giả

Deploy and configure Zeek (formerly Bro) to passively analyze network traffic, generate structured connection/DNS/HTTP/SSL/file logs, detect anomalous behavior, and write custom scripts for organization-specific threats. Use for passive monitoring at network choke points, feeding SIEM/threat hunting with protocol metadata, or retrospective log analysis during incident response; not a substitute fo

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#7853
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự