dns-tunneling-detection
Detect and execute DNS tunneling for C2 and data exfiltration — tiered detection methodology, attacker evasion techniques, offensive tool configuration, and…
от VigilOSS★ 35 звёзд на GitHub
Установить dns-tunneling-detection в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
DNS Tunneling Detection
vigil assess kaliaudit flags: use--technique RECON; this skill's offensive side operates against in-scope DNS infrastructure, soRECONfits better thanOSINT(which is passive external-zone lookups).
Adversarial Context
Attackers use DNS tunneling when HTTPS C2 is blocked or monitored. DNS is chosen because it is almost never blocked outbound, resolvers are usually allowed through firewalls, and most security teams only monitor HTTP/S. Detection must account for evasion: sophisticated tools use low-frequency queries, short labels, and legitimate-looking domain patterns to blend in. A detection strategy built on static thresholds (entropy > 3.5, query length > 50) will catch only the noisiest tunnels and miss everything purpose-built to evade.
When to Activate
- Investigating potential data exfiltration channels where HTTP/S egress is monitored or blocked
- Anomalous DNS traffic patterns flagged by network monitoring
- Zeek/Suricata/Arkime DNS logs available for deep analysis
- Hunting for C2 communication over DNS (iodine, dnscat2, DNSExfiltrator, Cobalt Strike DNS)
- Red team engagement requiring DNS-based C2 or exfiltration setup and evasion tuning
Tools
- Zeek (DNS log analysis —
dns.logfields:query,qtype_name,answers,rcode_name,ts) - tshark (packet-level DNS inspection — response sizes, EDNS, TCP fallback)
- Splunk/ELK for log correlation and alerting
- Python (entropy calculation, timing analysis, statistical modeling)
- iodine / dnscat2 / DNSExfiltrator (offensive tooling — see Offensive section)
Attacker Evasion Techniques
Understanding what makes basic detection fail is prerequisite to building detection that works.
Slow-Drip Exfiltration
Defeats: Volume-based detection, burst alerts. One query per minute carrying 30 bytes of encoded data. At that rate, exfiltrating 1 MB takes ~23 days — but credentials, API keys, and session tokens fit in a few queries. Most SIEM alerting windows are 5-15 minutes; a query every 60 seconds never triggers volume thresholds.
Short Label Encoding
Defeats: Length-based detection (subdomain > 50 chars).
Hex-encode data in 8-character chunks: a1b2c3d4.tunnel.evil.example. Subdomain length is 8 characters — well within normal DNS patterns. Base32 with padding stripped keeps labels under 15 characters while encoding 10 bytes per label.
Legitimate Cloud DNS Resolvers
Defeats: Destination-based detection (blocklists, geo-anomaly).
Route tunnel traffic through 8.8.8.8, 1.1.1.1, or corporate DNS resolvers that recursively resolve to the attacker's authoritative nameserver. The client never directly contacts the C2 domain's nameserver — all traffic goes to the same resolver the network already trusts.
CNAME/A Record Tunneling with Short Responses
Defeats: Record-type detection (TXT-heavy = suspicious). iodine uses CNAME records by default. Cobalt Strike DNS beacon uses A records where the 4-byte IP address IS the encoded response. Neither triggers TXT-record alerting. Response sizes stay under 512 bytes, avoiding TCP fallback that some detectors key on.
Domain Generation Algorithms (DGA) vs Fixed C2 Domain
Requires different detection strategies. DGA-based tunneling rotates the parent domain daily — domain reputation and blocklists cannot keep up. Fixed C2 domains accumulate reputation signals over time but are vulnerable to domain-based blocking. Detection must handle both: behavioral analysis for DGA, reputation + volume for fixed domains.
Encoding Variation
Defeats: Pattern-matching on base64/hex character sets.
Custom alphabets, compression before encoding, or using dictionary words as encoding (each word maps to a byte value) produce subdomains that look like legitimate hostnames: update-service-check.cdn.evil.example.
Tiered Detection Methodology
Tier 1: Known Tunnel Tool Signatures (Easy Wins)
Catch the tools people actually use before tuning them. These signatures detect default configurations — sophisticated operators will modify them, which is why Tier 1 alone is insufficient.
| Tool | Default Signature | Detection Query |
|---|---|---|
| iodine | CNAME/NULL queries to single domain, predictable 100-200 byte response size, query prefix pattern [a-z0-9]{5,}\. to fixed parent |
qtype_name IN ("CNAME","NULL") AND unique_subdomains_per_parent > 20 in 5min |
| dnscat2 | TXT queries with hex-encoded subdomains ([0-9a-f]+\.), regular 1-5 second interval, NXDOMAIN responses mixed with valid |
qtype_name == "TXT" AND subdomain MATCHES "^[0-9a-f]{16,}\." |
| DNSExfiltrator | Long TXT queries (>40 char subdomains), base64url character set ([A-Za-z0-9_-]+), sequential numbering in subdomain prefix |
qtype_name == "TXT" AND subdomain_length > 40 AND base64url_charset_ratio > 0.95 |
| Cobalt Strike DNS | A record queries at configurable beacon interval (default 60s), very short |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл dns-tunneling-detection?
Detect and execute DNS tunneling for C2 and data exfiltration — tiered detection methodology, attacker evasion techniques, offensive tool configuration, and false positive elimination
Как установить скилл dns-tunneling-detection?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dns-tunneling-detection запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…