Hunting dns tunneling and exfiltration

From meltedinhex/analyst-ai-pack · View interactive version

Hunting dns tunneling and exfiltration is an AI agent skill from the GitHub repository meltedinhex/analyst-ai-pack. Detects DNS-based tunneling and data exfiltration in DNS logs: scoring high query volume to single domains, long/high-entropy subdomains, unusual record types, and encoded payload labels. Activates for requests to hunt DNS tunneling, detect DNS exfiltration, or analyze suspicious DNS query patterns.

How to use this skill

Skill file

Hunting DNS Tunneling and Exfiltration

When to Use

exfiltration over DNS.

Do not use query length alone as a verdict — CDNs, antivirus lookups, and some SaaS use long

encoded labels legitimately; combine entropy, volume, and record-type signals.

Prerequisites

Workflow

Step 1: Aggregate by registered domain

Group queries under their registered/parent domain so per-domain volume and subdomain diversity

are visible.

Step 2: Score tunneling indicators

Weight: high unique-subdomain count, long average label length, high subdomain entropy (encoded

data), heavy TXT/NULL/CNAME usage, and high query rate to one domain.

python scripts/analyst.py hunt dns.json

Step 3: Estimate exfiltration volume

Sum encoded bytes implied by query lengths per domain; sustained high volume to a single

nameserver suggests data egress.

Step 4: Whitelist and pivot

Remove known-benign high-entropy domains; for survivors, check domain age/registration, the

authoritative nameserver, and the originating host.

Step 5: Confirm and respond

Validate by decoding sampled labels where possible and correlating with host activity; escalate

confirmed tunnels and write a detection.

Validation

Pitfalls

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.