performing-dns-tunneling-detection

Solid

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.

AI & Automation 12,642 stars 1468 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 97/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
90
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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. ```python 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 ```python from scapy.a...

Details

Author
mukul975
Repository
mukul975/Anthropic-Cybersecurity-Skills
Created
3 months ago
Last Updated
today
Language
Python
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

detecting-dns-exfiltration-with-dns-query-analysis

Detect data exfiltration through DNS tunneling by analyzing query entropy, subdomain length, query volume, TXT record abuse, and response payload sizes using passive DNS monitoring.

12,642 Updated today
mukul975
AI & Automation Featured

hunting-for-dns-tunneling-with-zeek

Detect DNS tunneling and data exfiltration by analyzing Zeek dns.log for high-entropy subdomain queries, excessive query volume, long query lengths, and unusual DNS record types indicating covert channel communication.

12,642 Updated today
mukul975
AI & Automation Featured

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling, DGA domain communication, and covert C2 channels using entropy analysis, query volume anomalies, and subdomain length detection in SIEM platforms. Use when SOC teams need to identify DNS-based threats that bypass traditional network security controls.

12,642 Updated today
mukul975
AI & Automation Featured

detecting-command-and-control-over-dns

Detects command-and-control (C2) communications tunneled through DNS protocol including DNS tunneling tools (Iodine, dnscat2, dns2tcp, Cobalt Strike DNS beacon), domain generation algorithms (DGA), encoded payload delivery via TXT/CNAME records, and DNS beaconing patterns. Covers Shannon entropy analysis of query subdomains, statistical anomaly detection, ML-based DGA classification, passive DNS correlation, and Zeek/Suricata signature development. Activates for requests involving DNS-based C2 detection, DNS tunnel identification, suspicious DNS traffic investigation, or DGA domain classification.

12,642 Updated today
mukul975
AI & Automation Featured

analyzing-network-covert-channels-in-malware

Detect and analyze covert communication channels used by malware including DNS tunneling, ICMP exfiltration, steganographic HTTP, and protocol abuse for C2 and data exfiltration.

12,642 Updated today
mukul975