[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A3Q8QGP2BYB24YWPDGPCCA":3,"skill-same:01M7A3Q8QGP2BYB24YWPDGPCCA":89},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":14,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":6,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M7A3Q8QGP2BYB24YWPDGPCCA","analyzing-dns-logs-for-exfiltration",null,"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.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fanalyzing-dns-logs-for-exfiltration\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fanalyzing-dns-logs-for-exfiltration\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: analyzing-dns-logs-for-exfiltration\ndescription: 'Analyzes DNS query logs to detect data exfiltration via DNS tunneling,\n  DGA domain communication, and covert C2 channels using entropy analysis, query volume\n  anomalies, and subdomain length detection in SIEM platforms. Use when SOC teams\n  need to identify DNS-based threats that bypass traditional network security controls.\n\n  '\ndomain: cybersecurity\nsubdomain: soc-operations\ntags:\n- soc\n- dns\n- exfiltration\n- dns-tunneling\n- dga\n- c2-detection\n- splunk\n- threat-detection\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\natlas_techniques:\n- AML.T0024\n- AML.T0056\n- AML.T0086\nnist_csf:\n- DE.CM-01\n- DE.AE-02\n- RS.MA-01\n- DE.AE-06\nmitre_attack:\n- T1048.003\n- T1071.004\n- T1567\n---\n# Analyzing DNS Logs for Exfiltration\n\n## When to Use\n\nUse this skill when:\n- SOC teams suspect data exfiltration through DNS tunneling to bypass firewall\u002Fproxy controls\n- Threat intelligence indicates adversaries using DNS-based C2 channels (e.g., Cobalt Strike DNS beacon)\n- UEBA detects anomalous DNS query volumes from specific hosts\n- Malware analysis reveals DNS-over-HTTPS (DoH) or DNS tunneling capabilities\n\n**Do not use** for standard DNS troubleshooting or availability monitoring — this skill focuses on security-relevant DNS abuse detection.\n\n## Prerequisites\n\n- DNS query logging enabled (Windows DNS Server, Bind, Infoblox, or Cisco Umbrella)\n- DNS logs ingested into SIEM (Splunk with `Stream:DNS`, `dns` sourcetype, or Zeek DNS logs)\n- Passive DNS data for historical domain resolution analysis\n- Baseline of normal DNS behavior (query volume, domain distribution, TXT record frequency)\n- Python with `math` and `collections` libraries for entropy calculation\n\n## Workflow\n\n### Step 1: Detect DNS Tunneling via Subdomain Length Analysis\n\nDNS tunneling encodes data in subdomain labels, creating unusually long queries:\n\n```spl\nindex=dns sourcetype=\"stream:dns\" query_type IN (\"A\", \"AAAA\", \"TXT\", \"CNAME\", \"MX\")\n| eval domain_parts = split(query, \".\")\n| eval subdomain = mvindex(domain_parts, 0, mvcount(domain_parts)-3)\n| eval subdomain_str = mvjoin(subdomain, \".\")\n| eval subdomain_len = len(subdomain_str)\n| eval tld = mvindex(domain_parts, -1)\n| eval registered_domain = mvindex(domain_parts, -2).\".\".tld\n| where subdomain_len > 50\n| stats count AS queries, dc(query) AS unique_queries,\n        avg(subdomain_len) AS avg_subdomain_len,\n        max(subdomain_len) AS max_subdomain_len,\n        values(src_ip) AS sources\n  by registered_domain\n| where queries > 20\n| sort - avg_subdomain_len\n| table registered_domain, queries, unique_queries, avg_subdomain_len, max_subdomain_len, sources\n```\n\n### Step 2: Detect High-Entropy Domain Queries (DGA Detection)\n\nDomain Generation Algorithms produce random-looking domains:\n\n```spl\nindex=dns sourcetype=\"stream:dns\"\n| eval domain_parts = split(query, \".\")\n| eval sld = mvindex(domain_parts, -2)\n| eval sld_len = len(sld)\n| eval char_count = sld_len\n| eval vowels = len(replace(sld, \"[^aeiou]\", \"\"))\n| eval consonants = len(replace(sld, \"[^bcdfghjklmnpqrstvwxyz]\", \"\"))\n| eval digits = len(replace(sld, \"[^0-9]\", \"\"))\n| eval vowel_ratio = if(char_count > 0, vowels \u002F char_count, 0)\n| eval digit_ratio = if(char_count > 0, digits \u002F char_count, 0)\n| where sld_len > 12 AND (vowel_ratio \u003C 0.2 OR digit_ratio > 0.3)\n| stats count AS queries, dc(query) AS unique_domains, values(src_ip) AS sources\n  by query\n| where unique_domains > 10\n| sort - queries\n```\n\n**Python-based Shannon Entropy Calculation for DNS queries:**\n\n```python\nimport math\nfrom collections import Counter\n\ndef shannon_entropy(text):\n    \"\"\"Calculate Shannon entropy of a string\"\"\"\n    if not text:\n        return 0\n    counter = Counter(text.lower())\n    length = len(text)\n    entropy = -sum(\n        (count \u002F length) * math.log2(count \u002F length)\n        for count in counter.values()\n    )\n    return round(entropy, 4)\n\n# Test with examples\nnormal_domain = \"google\"           # Low entropy\ndga_domain = \"x8kj2m9p4qw7n\"      # High entropy\ntunnel_subdomain = \"aGVsbG8gd29ybGQ.evil.com\"  # Base64 encoded data\n\nprint(f\"Normal: {shannon_entropy(normal_domain)}\")     # ~2.25\nprint(f\"DGA:    {shannon_entropy(dga_domain)}\")         # ~3.70\nprint(f\"Tunnel: {shannon_entropy(tunnel_subdomain)}\")   # ~3.50\n\n# Threshold: entropy > 3.5 for subdomain = likely tunneling\u002FDGA\n```\n\n**Splunk implementation of entropy scoring:**\n\n```spl\nindex=dns sourcetype=\"stream:dns\"\n| eval domain_parts = split(query, \".\")\n| eval check_string = mvindex(domain_parts, 0)\n| eval check_len = len(check_string)\n| where check_len > 8\n| eval chars = split(check_string, \"\")\n| stats count AS total_chars, dc(chars) AS unique_chars by query, src_ip, check_string, check_len\n| eval entropy_estimate = log(unique_chars, 2) * (unique_chars \u002F check_len)\n| where entropy_estimate > 3.5\n| stats count AS high_entropy_queries, dc(query) AS unique_queries by src_ip\n| where high_entropy_queries > 50\n| sort - high_entropy_queries\n```\n\n### Step 3: Detect Anomalous DNS Query Volume\n\nIdentify hosts generating abnormal DNS traffic:\n\n```spl\nindex=dns sourcetype=\"stream:dns\" earliest=-24h\n| bin _time span=1h\n| stats count AS queries, dc(query) AS unique_domains by src_ip, _time\n| eventstats avg(queries) AS avg_queries, stdev(queries) AS stdev_queries by src_ip\n| eval z_score = (queries - avg_queries) \u002F stdev_queries\n| where z_score > 3 OR queries > 5000\n| sort - z_score\n| table _time, src_ip, queries, unique_domains, avg_queries, z_score\n```\n\n**Detect TXT record abuse (common tunneling method):**\n\n```spl\nindex=dns sourcetype=\"stream:dns\" query_type=\"TXT\"\n| stats count AS txt_queries, dc(query) AS unique_txt_domains,\n        values(query) AS domains by src_ip\n| where txt_queries > 100\n| eval suspicion = case(\n    txt_queries > 1000, \"CRITICAL — Likely DNS tunneling\",\n    txt_queries > 500, \"HIGH — Possible DNS tunneling\",\n    txt_queries > 100, \"MEDIUM — Unusual TXT volume\"\n  )\n| sort - txt_queries\n| table src_ip, txt_queries, unique_txt_domains, suspicion\n```\n\n### Step 4: Detect Known DNS Tunneling Tools\n\nSearch for signatures of common DNS tunneling tools:\n\n```spl\nindex=dns sourcetype=\"stream:dns\"\n| eval query_lower = lower(query)\n| where (\n    match(query_lower, \"\\.dnscat\\.\") OR\n    match(query_lower, \"\\.dns2tcp\\.\") OR\n    match(query_lower, \"\\.iodine\\.\") OR\n    match(query_lower, \"\\.dnscapy\\.\") OR\n    match(query_lower, \"\\.cobalt.*\\.beacon\") OR\n    query_type=\"NULL\" OR\n    (query_type=\"TXT\" AND len(query) > 100)\n  )\n| stats count by src_ip, query, query_type\n| sort - count\n```\n\n**Detect DNS over HTTPS (DoH) bypassing local DNS:**\n\n```spl\nindex=proxy OR index=firewall\ndest IN (\"1.1.1.1\", \"1.0.0.1\", \"8.8.8.8\", \"8.8.4.4\",\n         \"9.9.9.9\", \"149.112.112.112\", \"208.67.222.222\")\ndest_port=443\n| stats sum(bytes_out) AS total_bytes, count AS connections by src_ip, dest\n| where connections > 100 OR total_bytes > 10485760\n| eval alert = \"Possible DoH bypass — DNS queries sent over HTTPS to public resolver\"\n| sort - total_bytes\n```\n\n### Step 5: Correlate DNS Findings with Endpoint Data\n\nCross-reference suspicious DNS with process data:\n\n```spl\nindex=dns src_ip=\"192.168.1.105\" query=\"*.evil-tunnel.com\" earliest=-24h\n| stats count AS dns_queries, earliest(_time) AS first_query, latest(_time) AS last_query\n  by src_ip, query\n| join src_ip [\n    search index=sysmon EventCode=3 DestinationPort=53 Computer=\"WORKSTATION-042\"\n    | stats count AS connections, values(Image) AS processes by SourceIp\n    | rename SourceIp AS src_ip\n  ]\n| table src_ip, query, dns_queries, first_query, last_query, processes\n```\n\n### Step 6: Calculate Data Exfiltration Volume Estimate\n\nEstimate data volume encoded in DNS queries:\n\n```spl\nindex=dns src_ip=\"192.168.1.105\" query=\"*.evil-tunnel.com\" earliest=-24h\n| eval domain_parts = split(query, \".\")\n| eval encoded_data = mvindex(domain_parts, 0)\n| eval encoded_bytes = len(encoded_data)\n| eval decoded_bytes = encoded_bytes * 0.75  -- Base64 decoding factor\n| stats sum(decoded_bytes) AS total_bytes_estimated, count AS total_queries,\n        earliest(_time) AS first_seen, latest(_time) AS last_seen\n| eval estimated_kb = round(total_bytes_estimated \u002F 1024, 1)\n| eval estimated_mb = round(total_bytes_estimated \u002F 1048576, 2)\n| eval duration_hours = round((last_seen - first_seen) \u002F 3600, 1)\n| eval rate_kbps = round(estimated_kb \u002F (duration_hours * 3600) * 8, 2)\n| table total_queries, estimated_mb, duration_hours, rate_kbps, first_seen, last_seen\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|-----------|\n| **DNS Tunneling** | Technique encoding data within DNS queries\u002Fresponses to exfiltrate data or establish C2 channels through DNS |\n| **DGA** | Domain Generation Algorithm — malware technique generating pseudo-random domain names for C2 resilience |\n| **Shannon Entropy** | Mathematical measure of randomness in a string — high entropy (>3.5) in domain names indicates DGA or tunneling |\n| **TXT Record Abuse** | Using DNS TXT records (designed for text data) as a high-bandwidth channel for data tunneling |\n| **DNS over HTTPS (DoH)** | DNS queries encrypted over HTTPS (port 443), bypassing traditional DNS monitoring |\n| **Passive DNS** | Historical record of DNS resolutions showing which IPs a domain resolved to over time |\n\n## Tools & Systems\n\n- **Splunk Stream**: Network traffic capture add-on providing parsed DNS query data for SIEM analysis\n- **Zeek (Bro)**: Network security monitor generating detailed DNS transaction logs for analysis\n- **Cisco Umbrella (OpenDNS)**: Cloud DNS security platform blocking malicious domains and logging query data\n- **Infoblox DNS Firewall**: DNS-layer security providing RPZ-based blocking and detailed query logging\n- **Farsight DNSDB**: Passive DNS database for historical domain resolution lookups and infrastructure mapping\n\n## Common Scenarios\n\n- **Cobalt Strike DNS Beacon**: Detect periodic TXT queries with encoded payloads to C2 domain\n- **Data Exfiltration**: Large volumes of unique subdomain queries encoding stolen data in Base64\u002Fhex\n- **DGA Malware**: Detect DNS queries to algorithmically generated domains (high entropy, no web content)\n- **DNS-over-HTTPS Bypass**: Employee using DoH to bypass corporate DNS filtering and monitoring\n- **Slow Drip Exfiltration**: Low-volume DNS tunneling staying below threshold alerts (requires baseline comparison)\n\n## Output Format\n\n```\nDNS EXFILTRATION ANALYSIS — WORKSTATION-042\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nPeriod:       2024-03-14 to 2024-03-15\nSource:       192.168.1.105 (WORKSTATION-042, Finance Dept)\n\nFindings:\n  [CRITICAL] DNS tunneling detected to evil-tunnel[.]com\n    Query Volume:       12,847 queries in 18 hours\n    Avg Subdomain Len:  63 characters (normal: \u003C20)\n    Avg Entropy:        3.82 (threshold: 3.5)\n    Query Types:        TXT (89%), A (11%)\n    Estimated Data:     ~4.7 MB exfiltrated via DNS\n    Rate:               0.58 kbps (slow drip pattern)\n\n  [HIGH] DGA-like domains resolved\n    Unique DGA Domains: 247 domains resolved\n    Pattern:            15-char random alphanumeric.xyz TLD\n    Entropy Range:      3.6 - 4.1\n\nProcess Attribution:\n  Process:   svchost_update.exe (masquerading — not legitimate svchost)\n  PID:       4892\n  Parent:    explorer.exe\n  Hash:      SHA256: a1b2c3d4... (VT: 34\u002F72 malicious — Cobalt Strike beacon)\n\nContainment:\n  [DONE] Host isolated via EDR\n  [DONE] Domain evil-tunnel[.]com added to DNS sinkhole\n  [DONE] Incident IR-2024-0448 created\n```\n","# Analyzing DNS Logs for Exfiltration\n\n## When to Use\n\nUse this skill when:\n- SOC teams suspect data exfiltration through DNS tunneling to bypass firewall\u002Fproxy controls\n- Threat intelligence indicates adversaries using DNS-based C2 channels (e.g., Cobalt Strike DNS beacon)\n- UEBA detects anomalous DNS query volumes from specific hosts\n- Malware analysis reveals DNS-over-HTTPS (DoH) or DNS tunneling capabilities\n\n**Do not use** for standard DNS troubleshooting or availability monitoring — this skill focuses on security-relevant DNS abuse detection.\n\n## Prerequisites\n\n- DNS query logging enabled (Windows DNS Server, Bind, Infoblox, or Cisco Umbrella)\n- DNS logs ingested into SIEM (Splunk with `Stream:DNS`, `dns` sourcetype, or Zeek DNS logs)\n- Passive DNS data for historical domain resolution analysis\n- Baseline of normal DNS behavior (query volume, domain distribution, TXT record frequency)\n- Python with `math` and `collections` libraries for entropy calculation\n\n## Workflow\n\n### Step 1: Detect DNS Tunneling via Subdomain Length Analysis\n\nDNS tunneling encodes data in subdomain labels, creating unusually long queries:\n\n```spl\nindex=dns sourcetype=\"stream:dns\" query_type IN (\"A\", \"AAAA\", \"TXT\", \"CNAME\", \"MX\")\n| eval domain_parts = split(query, \".\")\n| eval subdomain = mvindex(domain_parts, 0, mvcount(domain_parts)-3)\n| eval subdomain_str = mvjoin(subdomain, \".\")\n| eval subdomain_len = len(subdomain_str)\n| eval tld = mvindex(domain_parts, -1)\n| eval registered_domain = mvindex(domain_parts, -2).\".\".tld\n| where subdomain_len > 50\n| stats count AS queries, dc(query) AS unique_queries,\n        avg(subdomain_len) AS avg_subdomain_len,\n        max(subdomain_len) AS max_subdomain_len,\n        values(src_ip) AS sources\n  by registered_domain\n| where queries > 20\n| sort - avg_subdomain_len\n| table registered_domain, queries, unique_queries, avg_subdomain_len, max_subdomain_len, sources\n```\n\n### Step 2: Detect High-Entropy Domain Queries (DGA Detection)\n\nDomain Generation Algorithms produce random-looking domains:\n\n```spl\nindex=dns sourcetype=\"stream:dns\"\n| eval domain_parts = split(query, \".\")\n| eval sld = mvindex(domain_parts, -2)\n| eval sld_len = len(sld)\n| eval char_count = sld_len\n| eval vowels = len(replace(sld, \"[^aeiou]\", \"\"))\n| eval consonants = len(replace(sld, \"[^bcdfghjklmnpqrstvwxyz]\", \"\"))\n| eval digits = len(replace(sld, \"[^0-9]\", \"\"))\n| eval vowel_ratio = if(char_count > 0, vowels \u002F char_count, 0)\n| eval digit_ratio = if(char_count > 0, digits \u002F char_count, 0)\n| where sld_len > 12 AND (vowel_ratio \u003C 0.2 OR digit_ratio > 0.3)\n| stats count AS queries, dc(query) AS unique_domains, values(src_ip) AS sources\n  by query\n| where unique_domains > 10\n| sort - queries\n```\n\n**Python-based Shannon Entropy Calculation for DNS queries:**\n\n```python\nimport math\nfrom collections import Counter\n\ndef shannon_entropy(text):\n    \"\"\"Calculate Shannon entropy of a string\"\"\"\n    if not text:\n        return 0\n    counter = Counter(text.lower())\n    length = len(text)\n    entropy = -sum(\n        (count \u002F length) * math.log2(count \u002F length)\n        for count in counter.values()\n    )\n    return round(entropy, 4)\n\n# Test with examples\nnormal_domain = \"google\"           # Low entropy\ndga_domain = \"x8kj2m9p4qw7n\"      # High entropy\ntunnel_subdomain = \"aGVsbG8gd29ybGQ.evil.com\"  # Base64 encoded data\n\nprint(f\"Normal: {shannon_entropy(normal_domain)}\")     # ~2.25\nprint(f\"DGA:    {shannon_entropy(dga_domain)}\")         # ~3.70\nprint(f\"Tunnel: {shannon_entropy(tunnel_subdomain)}\")   # ~3.50\n\n# Threshold: entropy > 3.5 for subdomain = likely tunneling\u002FDGA\n```\n\n**Splunk implementation of entropy scoring:**\n\n```spl\nindex=dns sourcetype=\"stream:dns\"\n| eval domain_parts = split(query, \".\")\n| eval check_string = mvindex(domain_parts, 0)\n| eval check_len = len(check_string)\n| where check_len > 8\n| eval chars = split(check_string, \"\")\n| stats count AS total_chars, dc(chars) AS unique_chars by query, src_ip, check_string, check_len\n| eval entropy_estimate = log(unique_chars, 2) * (unique_chars \u002F check_len)\n| where entropy_estimate > 3.5\n| stats count AS high_entropy_queries, dc(query) AS unique_queries by src_ip\n| where high_entropy_queries > 50\n| sort - high_entropy_queries\n```\n\n### Step 3: Detect Anomalous DNS Query Volume\n\nIdentify hosts generating abnormal DNS traffic:\n\n```spl\nindex=dns sourcetype=\"stream:dns\" earliest=-24h\n| bin _time span=1h\n| stats count AS queries, dc(query) AS unique_domains by src_ip, _time\n| eventstats avg(queries) AS avg_queries, stdev(queries) AS stdev_queries by src_ip\n| eval z_score = (queries - avg_queries) \u002F stdev_queries\n| where z_score > 3 OR queries > 5000\n| sort - z_score\n| table _time, src_ip, queries, unique_domains, avg_queries, z_score\n```\n\n**Detect TXT record abuse (common tunneling method):**\n\n```spl\nindex=dns sourcetype=\"stream:dns\" query_type=\"TXT\"\n| stats count AS txt_queries, dc(query) AS unique_txt_domains,\n        values(query) AS domains by src_ip\n| where txt_queries > 100\n| eval suspicion = case(\n    txt_queries > 1000, \"CRITICAL — Likely DNS tunneling\",\n    txt_queries > 500, \"HIGH — Possible DNS tunneling\",\n    txt_queries > 100, \"MEDIUM — Unusual TXT volume\"\n  )\n| sort - txt_queries\n| table src_ip, txt_queries, unique_txt_domains, suspicion\n```\n\n### Step 4: Detect Known DNS Tunneling Tools\n\nSearch for signatures of common DNS tunneling tools:\n\n```spl\nindex=dns sourcetype=\"stream:dns\"\n| eval query_lower = lower(query)\n| where (\n    match(query_lower, \"\\.dnscat\\.\") OR\n    match(query_lower, \"\\.dns2tcp\\.\") OR\n    match(query_lower, \"\\.iodine\\.\") OR\n    match(query_lower, \"\\.dnscapy\\.\") OR\n    match(query_lower, \"\\.cobalt.*\\.beacon\") OR\n    query_type=\"NULL\" OR\n    (query_type=\"TXT\" AND len(query) > 100)\n  )\n| stats count by src_ip, query, query_type\n| sort - count\n```\n\n**Detect DNS over HTTPS (DoH) bypassing local DNS:**\n\n```spl\nindex=proxy OR index=firewall\ndest IN (\"1.1.1.1\", \"1.0.0.1\", \"8.8.8.8\", \"8.8.4.4\",\n         \"9.9.9.9\", \"149.112.112.112\", \"208.67.222.222\")\ndest_port=443\n| stats sum(bytes_out) AS total_bytes, count AS connections by src_ip, dest\n| where connections > 100 OR total_bytes > 10485760\n| eval alert = \"Possible DoH bypass — DNS queries sent over HTTPS to public resolver\"\n| sort - total_bytes\n```\n\n### Step 5: Correlate DNS Findings with Endpoint Data\n\nCross-reference suspicious DNS with process data:\n\n```spl\nindex=dns src_ip=\"192.168.1.105\" query=\"*.evil-tunnel.com\" earliest=-24h\n| stats count AS dns_queries, earliest(_time) AS first_query, latest(_time) AS last_query\n  by src_ip, query\n| join src_ip [\n    search index=sysmon EventCode=3 DestinationPort=53 Computer=\"WORKSTATION-042\"\n    | stats count AS connections, values(Image) AS processes by SourceIp\n    | rename SourceIp AS src_ip\n  ]\n| table src_ip, query, dns_queries, first_query, last_query, processes\n```\n\n### Step 6: Calculate Data Exfiltration Volume Estimate\n\nEstimate data volume encoded in DNS queries:\n\n```spl\nindex=dns src_ip=\"192.168.1.105\" query=\"*.evil-tunnel.com\" earliest=-24h\n| eval domain_parts = split(query, \".\")\n| eval encoded_data = mvindex(domain_parts, 0)\n| eval encoded_bytes = len(encoded_data)\n| eval decoded_bytes = encoded_bytes * 0.75  -- Base64 decoding factor\n| stats sum(decoded_bytes) AS total_bytes_estimated, count AS total_queries,\n        earliest(_time) AS first_seen, latest(_time) AS last_seen\n| eval estimated_kb = round(total_bytes_estimated \u002F 1024, 1)\n| eval estimated_mb = round(total_bytes_estimated \u002F 1048576, 2)\n| eval duration_hours = round((last_seen - first_seen) \u002F 3600, 1)\n| eval rate_kbps = round(estimated_kb \u002F (duration_hours * 3600) * 8, 2)\n| table total_queries, estimated_mb, duration_hours, rate_kbps, first_seen, last_seen\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|-----------|\n| **DNS Tunneling** | Technique encoding data within DNS queries\u002Fresponses to exfiltrate data or establish C2 channels through DNS |\n| **DGA** | Domain Generation Algorithm — malware technique generating pseudo-random domain names for C2 resilience |\n| **Shannon Entropy** | Mathematical measure of randomness in a string — high entropy (>3.5) in domain names indicates DGA or tunneling |\n| **TXT Record Abuse** | Using DNS TXT records (designed for text data) as a high-bandwidth channel for data tunneling |\n| **DNS over HTTPS (DoH)** | DNS queries encrypted over HTTPS (port 443), bypassing traditional DNS monitoring |\n| **Passive DNS** | Historical record of DNS resolutions showing which IPs a domain resolved to over time |\n\n## Tools & Systems\n\n- **Splunk Stream**: Network traffic capture add-on providing parsed DNS query data for SIEM analysis\n- **Zeek (Bro)**: Network security monitor generating detailed DNS transaction logs for analysis\n- **Cisco Umbrella (OpenDNS)**: Cloud DNS security platform blocking malicious domains and logging query data\n- **Infoblox DNS Firewall**: DNS-layer security providing RPZ-based blocking and detailed query logging\n- **Farsight DNSDB**: Passive DNS database for historical domain resolution lookups and infrastructure mapping\n\n## Common Scenarios\n\n- **Cobalt Strike DNS Beacon**: Detect periodic TXT queries with encoded payloads to C2 domain\n- **Data Exfiltration**: Large volumes of unique subdomain queries encoding stolen data in Base64\u002Fhex\n- **DGA Malware**: Detect DNS queries to algorithmically generated domains (high entropy, no web content)\n- **DNS-over-HTTPS Bypass**: Employee using DoH to bypass corporate DNS filtering and monitoring\n- **Slow Drip Exfiltration**: Low-volume DNS tunneling staying below threshold alerts (requires baseline comparison)\n\n## Output Format\n\n```\nDNS EXFILTRATION ANALYSIS — WORKSTATION-042\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nPeriod:       2024-03-14 to 2024-03-15\nSource:       192.168.1.105 (WORKSTATION-042, Finance Dept)\n\nFindings:\n  [CRITICAL] DNS tunneling detected to evil-tunnel[.]com\n    Query Volume:       12,847 queries in 18 hours\n    Avg Subdomain Len:  63 characters (normal: \u003C20)\n    Avg Entropy:        3.82 (threshold: 3.5)\n    Query Types:        TXT (89%), A (11%)\n    Estimated Data:     ~4.7 MB exfiltrated via DNS\n    Rate:               0.58 kbps (slow drip pattern)\n\n  [HIGH] DGA-like domains resolved\n    Unique DGA Domains: 247 domains resolved\n    Pattern:            15-char random alphanumeric.xyz TLD\n    Entropy Range:      3.6 - 4.1\n\nProcess Attribution:\n  Process:   svchost_update.exe (masquerading — not legitimate svchost)\n  PID:       4892\n  Parent:    explorer.exe\n  Hash:      SHA256: a1b2c3d4... (VT: 34\u002F72 malicious — Cobalt Strike beacon)\n\nContainment:\n  [DONE] Host isolated via EDR\n  [DONE] Domain evil-tunnel[.]com added to DNS sinkhole\n  [DONE] Incident IR-2024-0448 created\n```\n",{"name":5,"tags":25,"author":34,"domain":35,"license":15,"version":36,"nist_csf":37,"subdomain":42,"description":43,"mitre_attack":44,"atlas_techniques":48},[26,27,28,29,30,31,32,33],"soc","dns","exfiltration","dns-tunneling","dga","c2-detection","splunk","threat-detection","mahipal","cybersecurity","1.0",[38,39,40,41],"DE.CM-01","DE.AE-02","RS.MA-01","DE.AE-06","soc-operations","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.\n",[45,46,47],"T1048.003","T1071.004","T1567",[49,50,51],"AML.T0024","AML.T0056","AML.T0086","main","7540bbccf0c1ded6156a467b02c95b61ad62413f",".agents\u002Fskills\u002Fanalyzing-dns-logs-for-exfiltration","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add NeelakshSaxena\u002FVayu --skill analyzing-dns-logs-for-exfiltration",{"tool":65,"command":66},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill analyzing-dns-logs-for-exfiltration",{"tool":68,"command":69},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill analyzing-dns-logs-for-exfiltration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fanalyzing-dns-logs-for-exfiltration\u002FSKILL.md",true,[73,77,83],{"path":74,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fapi-reference.md","REFERENCE","参考文档",2708,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fanalyzing-dns-logs-for-exfiltration\u002Freferences\u002Fapi-reference.md",{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"scripts\u002Fagent.py","SCRIPT","脚本",8704,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fanalyzing-dns-logs-for-exfiltration\u002Fscripts\u002Fagent.py",[90,97,104,111,118,125],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":20},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":20},"01M7ACC63SRHEA5KMCHSMZK2TC","runpod","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":20},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":20},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":20},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":20},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]