detecting-exfiltration-over-dns-with-zeek
Skill này làm gì
Công cụ này phân tích nhật ký DNS để tìm lưu lượng đáng ngờ có thể đang giấu dữ liệu bị đánh cắp. Nó tìm các mẫu bất thường trong tên miền và khối lượng truy vấn để nhận diện các cuộc tấn công tiềm ẩn.
Khi nào nên dùng
- ✓Khi điều tra xem dữ liệu có đang bị đánh cắp qua internet bằng DNS hay không.
- ✓Khi kiểm tra lưu lượng internet bất thường có thể là tấn công.
- ✓Khi phân tích nhật ký mạng để tìm hoạt động độc hại được giấu.
Liên kết skill
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-exfiltration-over-dns-with-zeek/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Phân tích nhật ký DNS của tôi và cho biết có nỗ lực đánh cắp dữ liệu ẩn trong các truy vấn DNS không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ kiểm tra các bản ghi DNS, tìm tên miền rất dài hoặc chuỗi ký tự ngẫu nhiên (entropy cao). Nó cũng đếm số truy vấn khác nhau từ cùng một nguồn và kiểm tra xem khối lượng truy vấn có bất thường 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.
Detecting Exfiltration over DNS with Zeek
Overview
DNS tunneling and exfiltration is a technique used by attackers to bypass firewalls and DLP controls by encoding stolen data into DNS query subdomains. Legitimate DNS queries have predictable entropy and length patterns, while exfiltration queries contain encoded data with high Shannon entropy, unusually long subdomain labels, and high volumes of unique subdomains per parent domain.
This skill analyzes Zeek dns.log files (TSV format) to detect exfiltration indicators. The agent computes Shannon entropy for each subdomain component, identifies queries exceeding the 63-character DNS label limit, counts unique subdomains per parent domain, and flags domains that exceed configurable thresholds. These techniques detect tools like dnscat2, iodine, dns2tcp, and custom DNS tunneling implementations.
When to Use
- When investigating security incidents that require detecting exfiltration over dns with zeek
- When building detection rules or threat hunting queries for this domain
- When SOC analysts need structured procedures for this analysis type
- When validating security monitoring coverage for related attack techniques
Prerequisites
- Python 3.9 or later with math and collections modules (stdlib)
- Zeek dns.log files in TSV format with standard field headers
- Network capture data processed by Zeek 5.0+ or later
- Understanding of DNS protocol structure and query types
Steps
Parse Zeek dns.log headers: Read the TSV file, extract the
#fieldsheader line to identify column positions forts,id.orig_h,query,qtype_name,rcode_name, andanswers.Extract and decompose queries: For each DNS query, split the FQDN into subdomain labels and parent domain. Skip queries to known safe domains and internal zones.
Compute Shannon entropy: Calculate the information entropy of each subdomain label. Legitimate subdomains typically have entropy below 3.5, while encoded/encrypted data produces entropy above 4.0.
Detect long labels: Flag DNS labels exceeding 52 characters (approaching the 63-character maximum). Long labels are a strong indicator of data tunneling.
Count unique subdomains per domain: Track how many distinct subdomains each parent domain receives. Domains with more than 50 unique subdomains within the log window are suspicious.
Identify query volume anomalies: Calculate queries-per-minute per source IP per domain. Exfiltration tools generate sustained high-volume query streams that differ from normal browsing.
Score and rank domains: Combine entropy, label length, uniqueness count, and query volume into a composite risk score. Rank domains by score and output the top suspicious domains.
Generate detection report: Produce a JSON report with flagged domains, their evidence indicators, originating source IPs, and recommended response actions.
Expected Output
{
"analysis_summary": {
"total_queries_analyzed": 145832,
"unique_domains": 3421,
"flagged_domains": 3,
"entropy_threshold": 3.5
},
"flagged_domains": [
{
"domain": "data.evil-c2.com",
"unique_subdomains": 892,
"avg_entropy": 4.72,
"max_label_length": 61,
"source_ips": ["10.0.1.45"],
"risk_score": 9.4,
"indicators": ["high_entropy", "long_labels", "high_subdomain_count"]
}
]
}
Câu hỏi thường gặp
“Entropy” trong ngữ cảnh này là gì?
Entropy đo mức độ ngẫu nhiên hoặc khó đoán của một tên miền. Tên bình thường thì dễ đoán, còn dữ liệu bị giấu thường trông ngẫu nhiên hơn.
“Nhật ký DNS” là gì?
Đó giống như danh bạ internet, dịch tên website (như google.com) thành địa chỉ số mà máy tính hiểu. Công cụ này phân tích các cuộc “trao đổi” trong danh bạ đó.
“Đánh cắp dữ liệu” (data exfiltration) nghĩa là gì?
Đó là việc lấy thông tin từ hệ thống hoặc mạng và gửi ra ngoài, thường được ngụy trang để tránh bị phát hiện.
Chi tiết
Mô tả gốc của tác giả
Detect DNS-based data exfiltration by analyzing Zeek dns.log for high-entropy subdomains, oversized TXT/NULL records, and anomalous query volume or patterns. Use when investigating suspected DNS tunneling, covert C2 over DNS, or data exfiltration hidden in DNS queries against network traffic captured by Zeek.
Độ phổ biến
- Sao GitHub
- 35k
- Vị trí xếp hạng
- #7829
- Giấy phép
- Apache-2.0
- Cập nhật
- 31/8/2026
Bình luận
- …
Thêm skill từ kho mã này
abusing-dpapi-for-credential-access
35kCung cấp cho agent AI của bạn hướng dẫn có sẵn cho một tác vụ cụ thể, giúp nó làm việc tốt hơn và nhanh hơn.
abusing-shadow-credentials-for-privesc
35kDạy agent AI của bạn viết văn bản rõ ràng và có cấu trúc tốt.
achieving-cmmc-level-2-compliance
35kGiúp agent của bạn chuẩn bị môi trường để tuân thủ CMMC Level 2. Triển khai các yêu cầu bảo mật và quản lý tài liệu cần thiết.
acquiring-disk-image-with-dd-and-dcfldd
35kGiúp agent của bạn tạo bản sao chính xác của ổ đĩa. Cách này đảm bảo không mất hay thay đổi thông tin trong quá trình điều tra.
Skill tương tự
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
slacrawl
394kCho phép agent của bạn tìm và đếm tin nhắn trong kho lưu trữ Slack cục bộ, kiểm tra kho đó mới đến mức nào và làm mới khi cần.
goplaces
394kGiúp agent của bạn tìm địa điểm, lấy chi tiết và đánh giá, và xác định tên địa điểm bằng Google Places, với đầu ra JSON cho script.