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

performing-dns-tunneling-detection

它能做什么

这个工具会分析 DNS 流量,查找可疑行为,例如可用来隐藏数据的“DNS 隧道”。它会检查 DNS 请求的名称、长度和其他细节,以识别异常行为。

适用场景

  • ✓当你在调查可能的数据泄露时。
  • ✓在安全测试中,需要检查是否存在隐藏隧道时。
  • ✓在分析网络流量中的恶意活动时。

技能链接

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-dns-tunneling-detection/SKILL.md

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“分析这个 DNS 流量文件,告诉我是否有 DNS 隧道的迹象。”

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

工作原理

工具会计算 DNS 请求名称的“熵”(也就是随机程度)。非常随机或特别长的名称,可能意味着有数据被藏在其中。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Performing DNS Tunneling Detection

When to Use

  • When conducting security assessments that involve performing dns tunneling detection
  • When following incident response procedures for related security events
  • When performing scheduled security testing or auditing activities
  • When validating security controls through hands-on testing

Prerequisites

  • Familiarity with security operations concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Instructions

Analyze DNS traffic for indicators of DNS tunneling using entropy analysis and statistical methods on query name characteristics.

import math
from collections import Counter

def shannon_entropy(data):
    if not data:
        return 0
    counter = Counter(data)
    length = len(data)
    return -sum((c/length) * math.log2(c/length) for c in counter.values())

# Legitimate domain: low entropy (~3.0-3.5)
print(shannon_entropy("www.google.com"))
# DNS tunnel: high entropy (~4.0-5.0)
print(shannon_entropy("aGVsbG8gd29ybGQ.tunnel.example.com"))

Key detection indicators:

  1. High Shannon entropy in query names (> 3.5 for subdomain labels)
  2. Unusually long query names (> 50 characters)
  3. High volume of TXT record requests to a single domain
  4. High unique subdomain count per parent domain
  5. Non-standard character distribution in labels

Examples

from scapy.all import rdpcap, DNS, DNSQR
packets = rdpcap("dns_traffic.pcap")
for pkt in packets:
    if pkt.haslayer(DNSQR):
        query = pkt[DNSQR].qname.decode()
        entropy = shannon_entropy(query)
        if entropy > 4.0:
            print(f"Suspicious: {query} (entropy={entropy:.2f})")
常见问题

什么是 DNS 隧道?

这是一种把数据藏在正常 DNS 请求中的技术,用来绕过防火墙或其他安全屏障。

这里为什么要关注熵?

正常的 DNS 请求有一定的可预测性,而被隐藏的数据往往更加随机,因此熵值更高。

我需要是网络专家才能使用吗?

不需要,但具备基本的网络安全知识有助于你理解结果。

详情

作者的原始描述

Detects DNS tunneling by computing Shannon entropy of DNS query names, analyzing query length distributions, inspecting TXT record payloads, and identifying high subdomain cardinality. Uses scapy for packet capture analysis and statistical methods to distinguish legitimate DNS from covert channels. Use when hunting for data exfiltration. '

repo: mukul975/Anthropic-Cybersecurity-Skills

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能