[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ADMZNMS4ME6T17Y60G8ACK":3,"skill-same:01M6ADMZNMS4ME6T17Y60G8ACK":105},{"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":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":64,"commitSha":65,"skillDirectory":66,"forksCount":67,"repositoryHtmlUrl":68,"repositoryHomepageUrl":69,"ownerHtmlUrl":70,"ownerBlogUrl":71,"ownerDescription":72,"updatedAt":73,"install":74,"resources":87},"01M6ADMZNMS4ME6T17Y60G8ACK","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.","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",36078,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-dns-logs-for-exfiltration\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"analyzing dns logs for exfiltration","logs","c2-detection","threat-detection","splunk","dga","dns-tunneling","exfiltration","dns","soc","security","c2","communication","teams","siem","cybersecurity","network security","2026-11-10 10:12:30",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":46,"author":47,"domain":39,"license":15,"version":48,"nist_csf":49,"subdomain":54,"description":55,"mitre_attack":56,"atlas_techniques":60},[33,32,31,30,29,26,28,27],"mahipal","1.0",[50,51,52,53],"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",[57,58,59],"T1048.003","T1071.004","T1567",[61,62,63],"AML.T0024","AML.T0056","AML.T0086","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fanalyzing-dns-logs-for-exfiltration",4414,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":8,"skillName":5,"commands":75,"prompt":85,"zipAvailable":86},[76,79,82],{"tool":77,"command":78},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-dns-logs-for-exfiltration",{"tool":80,"command":81},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-dns-logs-for-exfiltration",{"tool":83,"command":84},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-dns-logs-for-exfiltration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-dns-logs-for-exfiltration\u002FSKILL.md",true,[88,93,99],{"path":89,"resourceType":89,"resourceTypeDesc":90,"sizeBytes":91,"sourceHtmlUrl":92},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-dns-logs-for-exfiltration\u002FLICENSE",{"path":94,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fapi-reference.md","REFERENCE","参考文档",2708,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-dns-logs-for-exfiltration\u002Freferences\u002Fapi-reference.md",{"path":100,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":103,"sourceHtmlUrl":104},"scripts\u002Fagent.py","SCRIPT","脚本",8704,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-dns-logs-for-exfiltration\u002Fscripts\u002Fagent.py",[106,132,156,184,209,236],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":113,"publishedAt":41},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[112],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[114,115,116,117,34,39,118,119,120,121,122,123,124,125,126,127,128,129,130,131],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","incident response","identity","pr","code","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":139,"publishedAt":41},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[138],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[140,128,141,142,34,143,39,120,144,145,146,147,148,149,150,151,152,153,154,155],"boot","TPM","validating tpm measured boot attestation","policy","verification","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":166,"publishedAt":41},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[162,165],{"categoryNo":163,"categoryName":164,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[150,167,168,169,170,39,171,172,144,173,174,175,176,177,178,179,180,181,182,183],"backup","recovery","validating backup integrity for recovery","testing","infrastructure","validation","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":185,"name":186,"nameZh":6,"description":187,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":188,"categories":189,"keywords":191,"publishedAt":41},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[190],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[192,193,194,39,195,196,25,197,198,199,200,201,202,203,204,205,147,206,207,208],"windows","kape","triaging windows with kape","registry","browser","windows-forensics","dfir","mft","mftecmd","data","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":210,"name":211,"nameZh":6,"description":212,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":213,"categories":214,"keywords":216,"publishedAt":41},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[215],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[217,218,219,39,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235],"vulnerabilities","framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","api","prioritization","ssvc","decision-tree",{"skillNo":237,"name":238,"nameZh":6,"description":239,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":240,"categories":241,"keywords":243,"publishedAt":41},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[242],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[34,244,39,38,245,246,33,247,248,249,250,179,251,180,252,253,254,255,256,257],"triaging security incident","file","ioc","NIST-800-61","NIST","severity","edr","execution","analysis","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]