跳到正文
Skillpedia
分析与电子表格35k · #7829

detecting-exfiltration-over-dns-with-zeek

它能做什么

这个工具会分析 DNS 日志,找出可能在隐藏被盗数据的可疑流量。它会查看域名和查询量中的异常模式,帮你识别潜在攻击。

适用场景

  • ✓当你怀疑有人通过 DNS 窃取数据时。
  • ✓当你检查可能是攻击的异常网络流量时。
  • ✓当你分析网络日志,寻找隐藏的恶意活动时。

技能链接

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-exfiltration-over-dns-with-zeek/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-exfiltration-over-dns-with-zeek/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“分析我的 DNS 日志,看看是否有人试图把数据藏在 DNS 查询里偷走。”

每周 5 个新技能,1 分钟读完。

工作原理

工具会检查 DNS 记录,留意特别长的域名或随机字符序列(即高熵)。它还会统计同一来源发出了多少种不同的查询,并检查查询量是否异常。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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

  1. Parse Zeek dns.log headers: Read the TSV file, extract the #fields header line to identify column positions for ts, id.orig_h, query, qtype_name, rcode_name, and answers.

  2. 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.

  3. 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.

  4. Detect long labels: Flag DNS labels exceeding 52 characters (approaching the 63-character maximum). Long labels are a strong indicator of data tunneling.

  5. 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.

  6. 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.

  7. 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.

  8. 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"]
    }
  ]
}
常见问题

这里的“熵(entropy)”是什么意思?

熵衡量的是域名有多随机、多难预测。正常的域名比较有规律,而隐藏的数据看起来会更加随机。

什么是“DNS 日志”?

DNS 就像互联网上的“电话簿”,负责把网站名称(比如 google.com)翻译成电脑能理解的数字地址。这个工具分析的就是这本“电话簿”的查询记录。

“数据外泄(data exfiltration)”是什么意思?

指从系统或网络中窃取信息并发送出去的行为,攻击者通常会伪装起来以躲避检测。

详情

作者的原始描述

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.

repo: mukul975/Anthropic-Cybersecurity-Skills

热度

GitHub 星标
35k
排名
#7829
许可证
Apache-2.0
更新时间
2026/8/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能