
Defending Against Kerberoasting And AS-REP Roasting In Active Directory
October 21, 2026A threat actor exfiltrated 700 gigabytes of sensitive financial records from a Fortune 500 firm over eleven months — and the entire operation hid inside DNS queries. No encrypted tunnel, no suspicious outbound connections, no alerts fired. Just a slow, methodical stream of Base64-encoded data fragments buried inside legitimate-looking hostname lookups. When the breach was finally discovered, the damage had already been sold on three separate darknet forums. This is not a theoretical attack vector. DNS tunneling and covert channel exfiltration are active, production-grade tools in the adversary playbook — and most enterprise environments remain structurally unprepared to stop them.
Understanding DNS Tunneling: The Anatomy of a Covert Channel
DNS was designed for one purpose: resolving human-readable domain names into machine-readable IP addresses. It was never designed with confidentiality or behavioral inspection in mind. That design gap is exactly what threat actors exploit. DNS tunneling encodes arbitrary data — credentials, documents, database dumps — into DNS query and response packets, using a controlled domain as the relay point. The attacker controls an authoritative nameserver for a domain they own. The compromised host inside your network sends encoded data as subdomains (e.g., aGVsbG8gd29ybGQ.malicious-domain.com), and the nameserver decodes and reassembles the payload on the other side.
How Encoding and Fragmentation Work
Common encoding schemes include Base32, Base64, and hexadecimal. Because DNS labels are limited to 63 characters and full domain names to 253 characters, data must be fragmented across multiple queries. A sophisticated tunneling tool like Iodine, DNScat2, or dns2tcp handles fragmentation, sequencing, and reassembly automatically. The receiving nameserver logs each lookup and reconstructs the original payload. Throughput is deliberately low — typically 1–3 Mbps — which is precisely why tunneling evades volumetric anomaly detection. Attackers are patient. They don’t need speed; they need invisibility.
Why Conventional Firewalls Miss It
Most perimeter firewalls allow UDP port 53 traffic outbound without deep inspection. Blocking all DNS would cripple business operations, so security teams default to permissive policies. Even next-generation firewalls that perform SSL/TLS decryption often pass DNS traffic without behavioral analysis. According to Palo Alto Networks’ Unit 42 Threat Intelligence Report (2025), DNS-based attacks accounted for 46% of all observed command-and-control communication channels across tracked threat actor infrastructure — up from 31% in 2023. The trend line is unambiguous.
Identifying Covert Channel Indicators Across Your Infrastructure
Detecting DNS tunneling requires shifting from signature-based thinking to behavioral analysis. No single packet is malicious on its own; the malice emerges from patterns over time. Security analysts need a layered set of detection signals, each contributing evidence to a probabilistic verdict.
Statistical Anomalies in DNS Traffic
Several measurable characteristics distinguish tunnel traffic from legitimate DNS resolution. First, query length: legitimate hostname lookups average 20–30 characters in the subdomain portion. Tunneled queries routinely exceed 50–100 characters with high entropy strings. Second, query volume: a single endpoint making hundreds of queries per minute to the same authoritative domain is a strong behavioral indicator. Third, record type distribution: tunneling tools frequently use TXT, NULL, CNAME, and MX record types, which appear rarely in normal enterprise DNS traffic. A baseline of your environment’s record type distribution makes deviations immediately visible. Tools like Zeek (formerly Bro) and PassiveDNS enable continuous logging and retrospective analysis of these patterns.
Entropy Analysis and Payload Inspection
High Shannon entropy in DNS subdomain strings is a reliable marker of encoded data. Legitimate subdomains use dictionary words, short codes, or recognizable naming conventions. Base64 or hex-encoded payloads produce near-random character sequences with entropy values consistently above 3.5 bits per character. Implementing entropy scoring in your SIEM — either through custom Sigma rules or commercial solutions like Darktrace or ExtraHop — provides automated flagging without requiring signature updates for each new tunneling variant. Cisco Umbrella’s Investigate platform, for instance, uses machine learning models trained on DNS entropy patterns to score domain suspiciousness in real time.
DNS Security Architecture: Building Structural Defenses
Detection without prevention is incomplete security. A robust DNS security architecture reduces the attack surface so fundamentally that tunneling becomes operationally difficult even before behavioral detection kicks in.
DNS Sinkholing, RPZ, and Recursive Resolver Control
Response Policy Zones (RPZ) allow your recursive resolvers to intercept and redirect queries to known-malicious or newly registered domains. Feeding your RPZ with threat intelligence from providers like Infoblox, Quad9, or CISA’s Protective DNS program gives you a constantly updated blocklist enforced at the protocol level. DNS sinkholing complements RPZ by redirecting suspicious queries to a controlled server that logs the attempt and returns a benign response — preserving forensic evidence while neutralizing the channel. Critically, enterprises should enforce internal DNS recursion: all endpoints must use only designated internal resolvers, with outbound UDP/TCP 53 blocked to all external IP addresses at the firewall. This single control eliminates the use of attacker-controlled authoritative servers as exfiltration endpoints.
Implementing DNS over HTTPS and HTTPS Inspection Trade-offs
A complicating factor: DNS over HTTPS (DoH) encrypts DNS queries inside HTTPS traffic, which can actually help attackers evade traditional DNS monitoring. Many modern browsers default to DoH via providers like Cloudflare or Google, bypassing your internal resolvers entirely. Enterprises must configure Group Policy or MDM profiles to disable browser-level DoH and enforce resolver discipline. Simultaneously, if your organization routes DNS through a monitored DoH gateway (such as Cloudflare Gateway for Teams or Cisco Umbrella), you recover visibility while still protecting query privacy from passive interception. The architecture decision matters enormously: ad hoc DoH adoption without centralized control creates detection blind spots that adversaries are actively exploiting.
Beyond DNS: Other Covert Exfiltration Channels Security Teams Overlook
DNS tunneling is the most prevalent covert channel, but sophisticated threat actors diversify their methods. An organization that hardens DNS while ignoring adjacent channels has addressed one symptom without treating the disease.
ICMP, HTTP, and Steganographic Covert Channels
ICMP tunneling embeds data in the payload field of Echo Request packets — a technique demonstrated as early as 1996 but still observed in contemporary intrusions. More relevant to modern enterprises: HTTP covert channels encode data in legitimate-looking web requests, using URL parameters, HTTP headers, or cookie values to carry exfiltrated content to attacker-controlled web servers. Because HTTP/HTTPS traffic is expected, volumetric detection fails. The detection approach here requires deep packet inspection combined with behavioral user entity analysis (UEBA): is this endpoint making HTTP requests to newly registered domains at unusual hours with consistent 4KB payload sizes? That pattern is meaningful.
Steganographic exfiltration — embedding data within image, audio, or document files uploaded to legitimate cloud services — is increasingly observed in advanced persistent threat (APT) campaigns. The APT32 (OceanLotus) group was documented using steganographic techniques to exfiltrate intelligence from Southeast Asian government networks, hiding data inside PNG files uploaded to cloud storage. Standard DLP tools that inspect filenames and MIME types without analyzing pixel-level entropy will not catch this.
Encrypted Tunnel Abuse: HTTPS, SSH, and RDP
Legitimate protocols tunneled over their own encrypted channels represent a detection challenge that cannot be solved at the packet level alone. SSH port forwarding, RDP over non-standard ports, and HTTPS to cloud file-sharing services can all carry exfiltration payloads that are cryptographically indistinguishable from legitimate traffic. The only reliable detection mechanism is behavioral baselining: understanding what normal data egress looks like for each user, role, and system, then alerting on deviations. A database server that suddenly establishes an outbound SSH connection to a cloud VPS in a foreign jurisdiction at 3 a.m. is anomalous regardless of what the packet payload contains.
Deploying a Defense-in-Depth Strategy for Exfiltration Prevention
No single control prevents data exfiltration. The threat surface spans network, endpoint, identity, and application layers simultaneously. A defense-in-depth strategy layers controls that make exfiltration progressively more difficult, more detectable, and more expensive for the attacker to execute reliably.
Zero Trust Network Architecture and Microsegmentation
Zero Trust principles directly constrain exfiltration pathways. By enforcing least-privilege network access — where workloads communicate only with explicitly authorized destinations — you eliminate the free lateral movement that makes data aggregation possible before exfiltration. Microsegmentation using software-defined perimeter solutions (Illumio, Guardicore, Zscaler Private Access) means a compromised endpoint cannot reach database servers, file shares, or backup systems unless that communication is explicitly required and approved. According to Forrester’s Zero Trust Adoption Report (2025), organizations with mature Zero Trust implementations reduced the blast radius of confirmed breaches by 64% compared to those with flat network architectures.
Data Loss Prevention, CASB, and Endpoint Controls
Cloud Access Security Brokers (CASBs) inspect data moving to cloud services in real time, applying DLP policies that flag or block transfers of sensitive data patterns — PII, financial records, source code, credentials. Combining CASB with endpoint DLP agents that monitor clipboard, USB, and application behavior creates overlapping detection coverage. Critically, DLP policies must be tuned to your data classification scheme; generic policies generate alert fatigue that causes analysts to disable them. The National Institute of Standards and Technology’s SP 800-188 provides a framework for data categorization that maps effectively to DLP rule construction. Pair endpoint controls with application allowlisting (via solutions like Carbon Black App Control or CrowdStrike Falcon) to prevent unauthorized tools — including DNS tunneling clients — from executing in the first place.
Incident Response When Exfiltration Is Suspected
Suspecting exfiltration is not confirming it. The difference matters enormously for both technical response and legal defensibility. A structured incident response process prevents premature action that could destroy forensic evidence or alert the attacker to their detection.
Forensic Preservation and Attacker Dwell Time Analysis
When DNS anomalies or behavioral signals trigger an investigation, the first priority is silent observation and logging enhancement — not immediate blocking. Cutting off the channel prematurely reveals detection capability and prompts the attacker to pivot or destroy evidence. Capture full DNS query logs from the suspicious resolver, collect endpoint memory images if the device is active, and preserve network flow data covering at least the past 90 days (which requires proactive log retention policy alignment). Analyze attacker dwell time: the Mandiant M-Trends 2025 Report indicated a global median dwell time of 10 days, but DNS tunnel-based exfiltrations showed median dwell times exceeding 140 days, reflecting the stealth advantage these channels provide. Quantifying what data was accessible during the dwell period is legally and operationally critical for breach notification obligations under GDPR, CCPA, and sector-specific regulations.
Containment, Eradication, and Post-Incident Hardening
Containment of a confirmed DNS exfiltration should occur in a coordinated window that simultaneously blocks the exfiltration channel, isolates affected endpoints, rotates potentially compromised credentials, and notifies legal and compliance stakeholders. Eradication requires identifying and removing the tunneling agent or malware component — not just the network indicator. Post-incident hardening should include a DNS architecture review, RPZ policy expansion, and a tabletop exercise that stress-tests your detection controls against the specific techniques used in the confirmed incident. Lessons-learned documentation should feed directly into threat model updates and red team exercise parameters for the following quarter.
Key Takeaways
- DNS tunneling is operationally mature, not theoretical: Tooling like Iodine, DNScat2, and dns2tcp makes covert channel exfiltration accessible to mid-tier threat actors, not just nation-states. Assume it is in your threat model.
- Enforce recursive resolver control as a foundational control: Block all outbound DNS except through designated, monitored internal resolvers. This single architectural decision eliminates the largest class of DNS tunneling attacks without requiring behavioral detection.
- Behavioral analysis beats signatures for covert channel detection: DNS entropy scoring, query length histograms, and record type distribution analysis detect tunneling variants that no signature database will ever fully enumerate.
- DoH is a double-edged protocol: Without centralized management, browser-level DoH adoption bypasses DNS monitoring entirely. Enforce resolver policy via Group Policy or MDM before threat actors exploit the gap.
- Exfiltration prevention requires layered coverage across DNS, HTTP, ICMP, and cloud channels: Hardening DNS alone leaves adjacent covert channels open. Integrate CASB, endpoint DLP, UEBA, and microsegmentation into a unified exfiltration prevention architecture.
Conclusion: Operationalizing Defense Before the Next Exfiltration Window Opens
The adversary advantage in DNS tunneling is time — the long dwell periods, the slow data rates, the patient accumulation of data that never triggers a volumetric alert. Your defensive advantage is architecture: controls that make the channel structurally difficult to establish, layers of detection that identify behavioral signatures across weeks of traffic, and response procedures that preserve forensic integrity while cutting off exfiltration pathways definitively.
The organizations that contain DNS-based exfiltration fastest are not those with the most expensive tools — they are those with the clearest DNS visibility, the most disciplined resolver control, and the most practiced incident response workflows.
This week, take three concrete steps: audit your firewall rules to confirm outbound UDP/TCP 53 is restricted to designated resolvers only; pull 30 days of DNS query logs and run a Shannon entropy analysis against subdomain strings; and verify that your SIEM has active alerting rules for TXT and NULL record type spikes from internal hosts. These three actions cost nothing but analyst time and will materially improve your detection posture against one of the most persistent and underdetected exfiltration techniques in the current threat landscape. If your team lacks the capacity to execute this assessment internally, engage a specialized threat hunting firm to conduct a DNS traffic behavioral audit — before the next eleven-month exfiltration window opens silently inside your network.
💡 Enjoyed this article?
Subscribe for more expert insights delivered to your inbox.
Follow us or subscribe below xe2x80x94 free, no spam.





