Home / Blogs

DNS Tunneling: Is It a Security Threat?

Chris Beauregard

DNS tunneling — the ability to encode the data of other programs or protocols in DNS queries and responses — has been a concern since the late 1990s. If you don't follow DNS closely, however, DNS tunneling likely isn't an issue you would be familiar with.

Originally, DNS tunneling was designed simply to bypass the captive portals of Wi-Fi providers, but as with many things on the Web it can be used for nefarious purposes. For many organizations, tunneling isn't even a known suspect and therefore a significant security risk. When most organizations think of DNS security, there is a tendency to overlook the security of critical data or systems being compromised by covert outbound DNS inside their networks.

To add some perspective, over the past several years there have been at least two large-scale security breaches using tunneling, affecting millions of accounts. In part one of this blog, we will provide some background on DNS tunneling in addition to discussing how DNS tunneling can be used to infiltrate your internal infrastructure. In part two, we will discuss how to detect whether your organization is affected by DNS tunneling and some proactive tips you can use to better protect your network.

What is DNS tunneling?

Through DNS tunneling, an organization's DNS can be used as a method of command and control and/or data exfiltration.

The basic method of tunneling requires that a client be compromised in some way. This follows the norm: malware via email attachment, compromised site, social engineering, etc.

While all of those methods of delivery typically require the compromised client to have external connectivity, interestingly, the compromised machine doesn't need actual external connectivity. The machine simply requires access to an internal DNS server with external access, which will enable the machine to send and receive DNS responses.

In addition to compromising the target organization, the attacker must also control a domain and a server that can act as an authoritative server for that domain in order to run the server-side tunneling and decoding programs.

Hackers use a variety of DNS tunneling utilities as well as several known malwares that use DNS as their communication channel. While each utility varies on the specifics of how they work, they all transmit the data encoded in the payload using Base32/Base64 Binary, NetBios, or Hex encoding. Hackers also use a wide variety of DNS record types, from A records to CNAME, to MX and TXT records, all of which can be combined with EDNS to increase the payload. (TXT records are the most common because they offer the largest and most diverse payload structure.)

How can DNS tunneling be used in a network breach?

Because DNS is rarely monitored and analyzed, hackers are able to use DNS tunneling to slip under the radar — until something else draws attention to the breach.

Here is the usual sequence of activities:

  1. A client sends a request for a particular host name in a domain, with the data/response to the server encoded in the hostname being requested.
  2. The server responds with its data in the RDATA field of the response. Because DNS allows hostnames of up to 255 characters, with each label (subdomain) limited to 63 characters, DNS allows the client to use lengthy individual labels as well as multiple levels of subdomains to encode their data. For example: The client sends a query for an A record where the data is encoded in the host name: MRZGS3TLEBWW64TFEBXXMYLMORUW4ZI.t.example.com. Then the server could respond with an answer as a CNAME response: WW2IDPOZQWY5DJNZSQ.t.example.com
  3. The client now has two-way transactional communications to a compromised network. The attacker can transfer files out of the network or have complete remote access to the compromised system.

Join us next week for part two in this series. Learn steps you can take to identify whether your network has been compromised and some tips for preventing a breach.

By Chris Beauregard, Senior Professional Services Engineer at Neustar

Related topics: DNS, DNS Security, Security

WEEKLY WRAP — Get CircleID's Weekly Summary Report by Email:


To post comments, please login or create an account.

Related Blogs

Related News

Explore Topics

Promoted Post

Boston Ivy Gets Competitive With Its TLDs, Offers Registrars New Wholesale Pricing

With a mission to make its top-level domains available to the broadest market possible, Boston Ivy has permanently reduced its registration, renewal and transfer prices for .Broker, .Forex, .Markets and .Trading. more»

Industry Updates – Sponsored Posts

Global Domain Name Registrations Reach 329.3 Million, 2.3 Million Growth in Last Quarter of 2016

Verisign Releases Q4 2016 DDoS Trends Report: 167% Increase in Average Peak Attack from 2015 to 2016

Neustar to be Acquired by Private Investment Group Led by Golden Gate Capital

Verisign Q3 2016 DDoS Trends Report: User Datagram Protocol (UDP) Flood Attacks Continue to Dominate

2016 U.S. Election: An Internet Forecast

Government Guidance for Email Authentication Has Arrived in USA and UK

ValiMail Raises $12M for Its Email Authentication Service

Don't Gamble With Your DNS

Defending Against Layer 7 DDoS Attacks

Understanding the Risks of the Dark Web

New TLD? Make Sure It's Secure

Verisign Releases Q2 2016 DDoS Trends Report - Layer 7 DDoS Attacks a Growing Trend

How Savvy DDoS Attackers Are Using DNSSEC Against Us

Radix Adds Dyn as a DNS Service Provider

Facilitating a Trusted Web Space for Financial Service Professionals

MarkMonitor Partners with CYREN to Deepen Visibility into Global Phishing Attacks

Verisign Named to the Online Trust Alliance's 2016 Honor Roll

Dyn Partners with the Internet Systems Consortium to Host Global F-Root Nameservers

Verisign Q1 2016 DDoS Trends: Attack Activity Increases 111 Percent Year Over Year

Is Your TLD Threat Mitigation Strategy up to Scratch?

Sponsored Topics