Skip to content
Skillpedia
Analysis & spreadsheets35k · #6058

performing-dns-tunneling-detection

Gives your AI agent ready-made instructions for a specific task, so it does it better and faster.

What it does

This tool analyzes DNS traffic to find suspicious activities, like 'DNS tunneling', which can be used to hide data. It checks the names of DNS requests, their lengths, and other details to identify unusual behavior.

When to use it

  • ✓When investigating a potential data leak.
  • ✓During security tests to check for hidden tunnels.
  • ✓When analyzing network traffic for malicious activities.

Example of what to ask your AI

“Analyze this DNS traffic file and tell me if there are signs of DNS tunneling.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

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

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-dns-tunneling-detection/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool calculates 'entropy' (a measure of randomness) of DNS request names. Very random or very long names might indicate data is being hidden.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill performing-dns-tunneling-detection

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/performing-dns-tunneling-detection/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from 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})")
FAQ

What is DNS tunneling?

It's a technique where data is hidden within normal DNS requests to bypass firewalls or other security barriers.

Why is entropy important here?

Normal DNS requests have a certain predictability. Hidden data tends to be more random, resulting in higher entropy.

Do I need to be a network expert to use this?

No, but having a basic understanding of network security helps in interpreting the results.

Details

Original description by the author

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

Popularity

GitHub stars
35k
Ranking position
#6058
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills