Chuyển đến nội dung
Skillpedia
Phân tích và bảng tính35k · #7958

hunting-for-dns-tunneling-with-zeek

Skill này làm gì

Công cụ này giúp tìm lưu lượng mạng đáng ngờ dùng Hệ thống tên miền (DNS) để giấu dữ liệu hoặc liên lạc bí mật. Nó tìm các mẫu bất thường trong cách máy tính hỏi máy chủ DNS.

Khi nào nên dùng

  • ✓Khi bạn nghi ngờ dữ liệu nhạy cảm đang bị đánh cắp qua mạng.
  • ✓Khi có dấu hiệu chương trình độc hại đang liên lạc bí mật qua internet.
  • ✓Khi số lượng truy vấn DNS tới một website cụ thể có vẻ quá cao hoặc bất thường.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/hunting-for-dns-tunneling-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/hunting-for-dns-tunneling-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

“Tìm lưu lượng DNS đáng ngờ có thể đang giấu dữ liệu.”

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

Cách hoạt động

Công cụ phân tích các yêu cầu gửi tới máy chủ DNS, kiểm tra xem chúng có quá dài, dùng nhiều tên miền phụ khác nhau hoặc dùng loại bản ghi bất thường không. Điều này giúp xác định DNS có đang bị lạm dụng cho mục đích xấu hay không.

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.

Hunting for DNS Tunneling with Zeek

When to Use

  • When hunting for data exfiltration over DNS covert channels
  • After threat intelligence indicates DNS-based C2 frameworks targeting your industry
  • When dns.log shows unusually high query volumes to specific domains
  • During investigation of suspected data theft where no HTTP/S exfiltration is found
  • When monitoring for tools like iodine, dnscat2, DNSExfiltrator, or DNS-over-HTTPS tunneling

Prerequisites

  • Zeek deployed on network tap or SPAN port capturing DNS traffic
  • Zeek dns.log with full query and response fields
  • SIEM platform for dns.log analysis (Splunk, Elastic)
  • RITA (Real Intelligence Threat Analytics) for automated DNS analysis
  • Passive DNS data for historical domain resolution context

Workflow

  1. Analyze Query Length Distribution: DNS tunneling encodes data in subdomain labels, producing queries significantly longer than normal. Normal DNS queries average 20-30 characters; tunneling queries often exceed 50+ characters. Calculate mean and standard deviation of query lengths per domain.
  2. Calculate Subdomain Entropy: Tunneling encodes data using Base32/Base64, producing high-entropy subdomain strings. Calculate Shannon entropy of subdomain labels -- values above 3.5 bits/character strongly suggest encoded data.
  3. Count Unique Subdomains Per Domain: Legitimate domains have relatively few unique subdomains. DNS tunneling generates hundreds or thousands of unique subdomains under a single parent domain.
  4. Monitor DNS Record Type Distribution: TXT, NULL, CNAME, and MX records can carry more data than A records. Excessive TXT queries to a single domain indicate data transfer via DNS.
  5. Detect High Query Volume: Flag domains receiving more than 100 queries per hour from a single source, especially when combined with high subdomain uniqueness.
  6. Analyze Query Timing: DNS tunneling tools produce regular query patterns (beaconing) or burst patterns (data transfer). Apply frequency analysis to DNS query timestamps.
  7. Cross-Reference with conn.log: Correlate DNS queries with connection metadata to identify the process or endpoint generating suspicious queries.
  8. Validate with Domain Intelligence: Check suspicious domains against WHOIS data, certificate transparency, and threat intelligence feeds.

Key Concepts

Concept Description
T1071.004 Application Layer Protocol: DNS
T1048.003 Exfiltration Over Alternative Protocol: DNS
T1572 Protocol Tunneling
Shannon Entropy Measure of randomness in subdomain strings
Zeek dns.log DNS query/response metadata
RITA Automated DNS tunneling detection from Zeek logs
iodine IPv4-over-DNS tunneling tool
dnscat2 DNS-based command-and-control tool
DNSExfiltrator Data exfiltration tool using DNS requests

Detection Queries

Zeek Script -- DNS Tunnel Detection

@load base/protocols/dns
module DNSTunnel;

export {
    redef enum Notice::Type += { DNSTunnel::Long_DNS_Query };
    const query_length_threshold = 50 &redef;
    const query_count_threshold = 100 &redef;
}

event dns_request(c: connection, msg: dns_msg, query: string, qtype: count, qclass: count) {
    if ( |query| > query_length_threshold ) {
        NOTICE([$note=DNSTunnel::Long_DNS_Query,
                $msg=fmt("Long DNS query detected: %s (%d chars)", query, |query|),
                $conn=c]);
    }
}

Splunk -- DNS Tunneling Indicators from Zeek

index=zeek sourcetype=bro_dns
| rex field=query "(?<subdomain>[^.]+)\.(?<basedomain>[^.]+\.[^.]+)$"
| stats count dc(subdomain) as unique_subs avg(len(query)) as avg_len max(len(query)) as max_len by src basedomain
| where count > 100 AND (unique_subs > 50 OR avg_len > 40)
| sort -unique_subs

Splunk -- High Entropy Subdomain Detection

index=zeek sourcetype=bro_dns
| rex field=query "^(?<subdomain>[^.]+)"
| where len(subdomain) > 20
| eval char_count=len(subdomain)
| stats count dc(query) as unique_queries avg(char_count) as avg_sub_len by src query_type_name basedomain
| where unique_queries > 30 AND avg_sub_len > 25
| sort -unique_queries

RITA Analysis

rita import /path/to/zeek/logs dataset_name
rita show-dns-fqdn-ips-long dataset_name
rita show-exploded-dns dataset_name
rita show-dns-tunneling dataset_name --csv > dns_tunnel_results.csv

Common Scenarios

…

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

“DNS tunneling” là gì?

Đây là kỹ thuật kẻ tấn công dùng DNS để gửi hoặc nhận dữ liệu, hoặc điều khiển máy bị nhiễm, bằng cách ngụy trang thành các truy vấn DNS bình thường.

Công cụ này có thể phát hiện những công cụ độc hại nào?

Nó có thể giúp nhận diện các công cụ như “iodine”, “dnscat2”, “DNSExfiltrator” và những công cụ khác dùng DNS để tạo kênh ngầm hoặc đánh cắp dữ liệu.

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

Không cần. Công cụ được thiết kế để tự động tìm các mẫu đáng ngờ, nhưng hiểu biết cơ bản về DNS sẽ giúp bạn diễn giải kết quả tốt hơn.

Chi tiết

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

Detects DNS tunneling and covert-channel data exfiltration by analyzing Zeek dns.log for high-entropy subdomain queries, excessive query volume, abnormally long query lengths, and unusual DNS record types (TXT/NULL/CNAME). Use when hunting for DNS-based data exfiltration or C2 covert channels in network traffic, or when triaging suspicious DNS query volume/patterns surfaced by Zeek logs.

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#7958
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ự