Unified DNS View to Track Threats
Dhia Mahjoub (Senior Security Researcher, Technical Leader · OpenDNS), Thomas Mathew (Security Researcher · OpenDNS)
BruCON 0x07 · Day 2
Overview
In their BruCON talk, Dhia Mahjoub and Thomas Mathew from OpenDNS presented groundbreaking research on developing a unified DNS view to identify and track internet threats. The core of their work lies in analyzing DNS traffic from both below and above the recursive layer, leveraging OpenDNS's immense global dataset to detect subtle, attacker-resistant patterns. This approach moves beyond traditional domain reputation systems, which have become increasingly ineffective against the evolving tactics of cybercriminals.

Key moments
- 4:00 The "needle in a haystack" problem with massive DNS data.
- 6:30 Limitations of classic domain reputation against new threats.
- 11:00 Block diagram of the unified DNS threat detection system.
- 15:00 Using DNS query types to classify malicious spike behavior.
- 23:50 Decision tree classifier reduces 100K domains to 50 for analysts.
- 26:00 Documented hosting patterns of malicious domains and infrastructure.
- 36:00 Case study: Evolving hosting infrastructure of the Nuclear exploit kit.
- 40:00 Detecting Domain Generation Algorithms (DGAs) with unique query patterns.
Unified DNS View to Track Threats
Speakers: Dhia Mahjoub, Senior Security Researcher, Technical Leader, OpenDNS; Thomas Mathew, Security Researcher, OpenDNS
Conference: BruCON
YouTube: https://www.youtube.com/watch?v=8edBgoHXnwg
Overview
In their BruCON talk, Dhia Mahjoub and Thomas Mathew from OpenDNS presented groundbreaking research on developing a unified DNS view to identify and track internet threats. The core of their work lies in analyzing DNS traffic from both below and above the recursive layer, leveraging OpenDNS's immense global dataset to detect subtle, attacker-resistant patterns. This approach moves beyond traditional domain reputation systems, which have become increasingly ineffective against the evolving tactics of cybercriminals.
The speakers highlighted the limitations of relying solely on static domain attributes and introduced a dynamic methodology centered on DNS query patterns. Their system is designed to automatically identify and classify various forms of financially motivated cybercrime, including exploit kits, ransomware, banking Trojans, spam, ad fraud, fake software, and phishing campaigns. By combining sophisticated traffic analysis with deep insights into malicious hosting infrastructures, OpenDNS aims to provide a more comprehensive and proactive defense against the most prevalent online threats.
This research is particularly significant given the sheer scale of modern cyberattacks and the ease with which bad actors can acquire new domains and hosting. The methods described offer a scalable and efficient way to cut through the noise of billions of daily DNS queries, pinpointing malicious activity that would otherwise go undetected. It represents a critical shift towards understanding the behavioral fingerprints of threats, rather than just their static characteristics.
Background
▶ Watch: The "needle in a haystack" problem with massive DNS data. (4:00)
The landscape of cybercrime is dominated by financially motivated attacks, often involving the infection of numerous machines with various malware strains. The delivery mechanisms for such malware typically include exploit kits (EKs) dropped after visiting compromised websites or malvertising campaigns, or through phishing emails containing malicious attachments. The challenge for security researchers is to detect the ephemeral and rapidly changing infrastructure supporting these attacks.
OpenDNS, with its vast global network comprising 25 data centers and over 100 recursive resolvers across five continents, processes an astonishing 70 billion DNS queries per day, translating to approximately half a terabyte of data per hour. This massive dataset includes two distinct types of DNS traffic: authoritative DNS traffic, which provides the global, historical mappings between domain names and IP addresses, and recursive DNS traffic, which represents individual client queries. While authoritative data is useful for tracking historical domain-IP relationships, detecting fast flux domains, and building basic domain reputation, it falls short against modern threats.
Traditional domain reputation systems, developed 10-15 years ago, rely on static attributes like IP reputation, registrar information, and registrant email. However, these methods are easily circumvented today. Domain Generation Algorithms (DGAs) can rapidly create new domains, compromised legitimate domains fly under the radar due to their "good" reputation, and the low cost of domains allows attackers to flood the internet with new, un-reputated sites. This creates a "needle in a haystack" problem, where the sheer volume of data makes manual analysis impossible and automated systems need to evolve beyond static indicators.
Recognizing these limitations, the OpenDNS team posited that DNS query patterns offer a more resilient signal for threat detection, as these patterns are significantly harder for attackers to control or obfuscate. While attackers can manipulate features like lexical makeup, timing granularity, hosting details (IP prefix, ASN), and registration information, they struggle to mask the global temporal and geographical characteristics of client queries to malicious domains. The research focuses on extracting these inherent, attacker-resistant features from DNS traffic to identify malicious campaigns.
Key Findings
▶ Watch: Block diagram of the unified DNS threat detection system. (11:00)
The OpenDNS research unveiled several key findings and methodologies for detecting threats through a unified DNS view:
- Spike Detection as an Initial Filter: The core idea is that malicious domains, particularly those used for exploit kits, exhibit sudden, significant spikes in DNS traffic. A spike is defined as a jump in traffic over a 2-hour window that crosses a calculated threshold. This initial filter, implemented via a MapReduce job, effectively identifies domains with unusual activity, filtering out naturally popular sites like Google or Facebook. However, it still yields 50,000 to 100,000 domains daily, necessitating further refinement.
- Multi-Dimensional Spike Analysis: To reduce false positives and categorize threats, the spike analysis was extended with additional dimensions:
- DNS Query Type (Q-type) Analysis: Each DNS request includes a Q-type (e.g., A for IP address, MX for mail server, TXT for text record, SPF for mail authentication, ANY for all records). By partitioning spiked domains based on their combinations of received Q-types (31 possible partitions), distinct patterns emerge. For instance, Q-type 1 (A) and 15 (MX) often indicate legitimate mail servers, sometimes exhibiting periodic query patterns. Conversely, partitions with a broader mix of Q-types, or very specific combinations, correlate with spam or exploit kit activity. Notably, Q-type 99 (SPF) alone was never observed in a spike domain over an 8-month study.
- Domain History Filter: This filter eliminates domains with a long history of consecutive non-zero hours of traffic, focusing on newly active or re-purposed domains. It specifically retains domains where the spike lasts no more than a certain number of consecutive non-zero hours, a characteristic observed in short-lived attack campaigns like exploit kits (e.g., Nuclear Exploit Kit landing domains show a flat history before a sudden spike).
- Active Probing / Domain Records Filter: This involves actively querying domains for specific DNS records (A, MX, TXT, CNAME, NS). The presence or absence of certain records, or the values returned (e.g., specific name servers), can indicate compromise or malicious intent.
- Decision Tree Classifier for Refinement: A basic decision tree classifier was employed to automatically categorize the filtered domains. Features fed into the classifier included the partition class (from Q-type analysis), the height of the spike, and the number of unique client IPs querying the domain. This process dramatically reduced the list of 100,000 domains to a manageable 50-60 true positives for human analysts to review.
- Hosting Infrastructure Monitoring: A critical component of the "unified view" is documenting and tracking the hosting patterns of malicious domains. Key observed patterns include:
- Domain Shadowing: Compromised legitimate second-level domains (2LDs) injected with malicious subdomains pointing to exploit kit landing pages or proxies. GoDaddy was identified as a frequently abused registrar for this technique.
- Diversified IP Space: Malicious domains often resolve to multiple IPs across different prefixes, ASNs, and hosters for fault tolerance and evasion.
- Bulletproof Hosting: Use of offshore providers in regions with lax regulations (Caribbean, Southeast Asia, Eastern Europe) that are slow to respond to abuse reports. They often diversify IP presence across different RIRs (e.g., Afrinic, RIPE).
- Abuse of Large Providers: Major hosting providers like Hetzner, Leaseweb, and DigitalOcean are frequently abused due to their scale.
- Shady Hosters: Smaller, often purpose-built hosting providers catering primarily to criminals (e.g., Eurobyte.ru, VPS server.ru, Hostlife.net, Q Hoster).
- IP Fingerprinting and Predictive Analysis: Identifying common web server (e.g., Nginx), SSH, and operating system fingerprints across neighboring IPs can predict future malicious hosting, as observed with Q Hoster.
- Registrant Email Pivoting: Tracking registrant emails (e.g.,
[email protected]) can uncover networks of malicious domains, including services likeav-check.ru(a "VirusTotal for criminals"). - Evolution of Exploit Kit Hosting: The Nuclear Exploit Kit demonstrated adaptation, initially using free domains from Freenom with compromised name servers on DigitalOcean/Choopa/Vultr, then switching to Freenom's own name servers and abusing smaller ASNs of DigitalOcean. Vultr, a child company of Choopa, was identified as a highly attractive target for criminals due to its affordable VPS services and large IP space.
- DGA Signatures: DGAs exhibit a distinct and highly repeatable query pattern. Infected machines call out simultaneously to the same set of domains, resulting in almost identical numbers of resolvers, client IPs, and resolver distributions across a cluster of DGA domains. This makes them relatively easy to identify with this method, with traffic patterns lasting longer (around 24 hours) compared to EKs (5-6 hours).
- False Positive Mitigation: The system incorporates mechanisms to identify false positives. For instance, Chinese SEO sites, which might spike, can be identified by lexical analysis (presence of Pinyin) and by observing client IPs also visiting other legitimate Chinese SEO domains.
Technical Deep Dive
▶ Watch: Decision tree classifier reduces 100K domains to 50 for analysts. (23:50)
The technical architecture for OpenDNS's unified view is designed for massive scale and automated threat detection, leveraging both passive and active DNS analysis.
The system begins with the ingestion of hourly logs from OpenDNS's global network of recursive resolvers. This raw data contains critical information: timestamp, client IP, domain queried, resolver queried (providing geographical location), and the query type (Q-type). Given the scale of 70 billion queries per day, efficient processing is paramount.
The first stage is a spike detection algorithm, implemented as a MapReduce job. This algorithm identifies domains exhibiting a sudden, statistically significant surge in traffic over a 2-hour window, exceeding a pre-calculated threshold. This threshold helps filter out legitimate, high-traffic domains that might naturally experience spikes due to popularity. The output of this stage is a large set of potentially suspicious domains, typically ranging from 50,000 to 100,000 daily.
To refine this large set, a series of filters are applied:
- Domain History Filter: This filter is crucial for distinguishing between newly malicious or re-purposed domains and those with a long, benign history. It eliminates domains that have shown more than 'X' consecutive non-zero hours of traffic in the past, effectively focusing on domains with little to no prior activity. Conversely, it retains domains whose recent spike activity lasts no more than 'Y' consecutive non-zero hours, a characteristic often seen in short-lived attack campaigns like exploit kits. For example, a Nuclear Exploit Kit landing domain would typically show a flat traffic history before its sudden, brief spike.
- Parallel Filtering (Q-type and Active Probing):
- Q-type Filter: This component analyzes the distribution of DNS query types associated with each spiked domain. The five primary Q-types considered are:
- 1 (A record): Maps domain to IPv4 address.
- 15 (MX record): Specifies mail exchange servers.
- 16 (TXT record): Stores arbitrary text, often used for SPF.
- 99 (SPF record): Sender Policy Framework.
- 255 (ANY record): Requests all available records.
The system partitions spiked domains into 31 distinct groups based on the combinations of Q-types received. Specific partitions correlate strongly with different domain behaviors. For instance, domains receiving both A and MX records (e.g., Q-type 1 and 15) are often legitimate mail servers, frequently exhibiting a periodic query pattern. In contrast, domains displaying a wide array of Q-types, or unusual combinations, are often indicative of spam or other malicious activities. The absence of specific Q-types in certain malicious contexts (e.g., Q-type 99 never seen in a spike domain over eight months) also provides valuable signal.
- Active Probing / Domain Records Filter: This involves actively querying the identified domains for various DNS records (A, MX, TXT, CNAME, NS). The presence or specific values of these records can reveal the domain's intended purpose or compromise. For example, a compromised domain might be re-purposed to use specific name servers for malware delivery, which would be evident from its NS records.
The combined output of these filters feeds into a decision tree classifier. This classifier uses features such as the Q-type partition class, the height of the traffic spike, and the number of unique client IPs that queried the domain. The decision tree is trained on a dataset of known good and bad domains collected over several months, acknowledging the challenge of classifying truly novel threats. Its primary role is to reduce the 50,000-100,000 daily spiked domains to a highly refined list of 50-60 domains that are most likely malicious, making them manageable for human analysts.
Beyond traffic analysis, a crucial aspect of the unified view is hosting infrastructure monitoring. Once a malicious domain is identified, the system pivots around its associated indicators—IP addresses, IP ranges, ASNs, hosting providers, and registrant emails—to expand the intelligence graph. This multi-hop exploration reveals interconnected malicious infrastructure. Examples include:
- Domain Shadowing: Identifying compromised 2LDs (e.g., GoDaddy domains) with injected subdomains resolving to suspicious IPs, which often host exploit kits or malvertising.
- Bulletproof Hosting: Tracing IPs to offshore hosting providers in countries with lax regulations (e.g., Belize, Seychelles) that facilitate criminal operations and delay abuse response.
- Abuse of Major Providers: Detecting patterns where large, legitimate providers like DigitalOcean, Hetzner, or Leaseweb are abused. For instance, the Nuclear Exploit Kit evolved its hosting from using compromised name servers on DigitalOcean/Choopa/Vultr to using Freenom's name servers and abusing smaller, specific ASNs of DigitalOcean in locations like Singapore.
- Shady Hosters: Pinpointing smaller hosting entities like Eurobyte.ru or Q Hoster (registered in Belize, operating across multiple RIRs like Afrinic and RIPE), which are frequently complicit or directly cater to criminals.
- IP Fingerprinting: Analyzing common service fingerprints (e.g., Nginx web server, SSH port, specific OS) across IP ranges. This has enabled the prediction of future malicious hosting, where IPs with identical fingerprints within a malicious range subsequently began hosting exploit kits.
- Registrant Email Pivoting: Tracking registrant emails like
[email protected]revealed its use for both exploit kit domains and services likeav-check.ru, which helps criminals test their malware against antivirus solutions.
This dynamic, multi-faceted approach allows OpenDNS to not only detect active threats but also to map out the underlying infrastructure, predict future attacks, and understand the evolving tactics of cybercriminals. The system's "URL and content agnostic" nature provides a significant advantage, though verification with URL and content analysis remains a philosophical underpinning of their approach.
Demo / Proof of Concept
▶ Watch: Documented hosting patterns of malicious domains and infrastructure. (26:00)
While a live demonstration of the system in action was not explicitly presented, the speakers provided numerous concrete examples and case studies that served as a compelling proof of concept for their methodology. They illustrated how their unified DNS view successfully identified various types of threats, detailing the specific patterns and infrastructure involved.
For instance, they showcased traffic spikes for exploit kit landing domains (e.g., Nuclear Exploit Kit), spam domains , DGA-generated domains, fake software downloads, browser locker campaigns (e.g., Russian police-themed MVD/FSB alerts often behind Cloudflare), and phishing campaigns (e.g., Amex, Nova Scotia Bank, Royal Bank of Canada). They provided visual representations of these spikes, contrasting them with legitimate traffic patterns.
Crucially, the presentation delved into the detailed hosting infrastructure associated with these threats. Examples included:
- An exploit kit domain hosted on Eurobyte.ru (under Webzilla ASN).
- A domain shadowing example (
mit.academysubdomain) on VPS server.ru (Russia), leading to further discovery of related EK domains on Hostlife.net (under Leaseweb) through IP range exploration. - An exploit kit domain on Q Hoster, with subsequent analysis of its registrant email (
[email protected]) revealing its connection toav-check.ru. - The evolving hosting patterns of the Nuclear Exploit Kit, transitioning from compromised name servers on DigitalOcean/Choopa/Vultr to Freenom's name servers and targeting smaller DigitalOcean ASNs.
- Examples of fake software hosted on multiple IPs without domains, waiting for activation.
The speakers also demonstrated how false positives, such as Chinese SEO sites, were identified using lexical analysis (Pinyin) and client IP distribution, validating the system's ability to differentiate between malicious and benign traffic spikes. These detailed examples effectively served as a robust demonstration of the system's capabilities and its practical application in real-world threat detection.
Defensive Implications
▶ Watch: Detecting Domain Generation Algorithms (DGAs) with unique query patterns. (40:00)
The detailed insights provided by OpenDNS's unified DNS view offer several critical implications for network defenders:
- Shift from Static Reputation to Behavioral Analysis: Defenders must move beyond relying solely on static domain reputation scores. Modern threats, particularly those using DGAs or compromised legitimate domains, easily bypass such defenses. Instead, prioritize monitoring dynamic DNS query patterns, looking for sudden spikes, unusual Q-type distributions, and anomalous domain history.
- Implement Multi-Stage DNS Filtering: A robust defense requires a layered approach. Incorporate spike detection algorithms, domain history filters, and active DNS record probing into security systems. This multi-stage filtering significantly reduces the alert volume, allowing analysts to focus on high-fidelity threats.
- Leverage DNS Q-Type Data: Analyze the types of DNS queries directed at domains. Unusual combinations of Q-types (e.g., A, MX, TXT, SPF, ANY) or the complete absence of expected Q-types can be a strong indicator of malicious activity, helping to differentiate legitimate services (like mail servers) from attack infrastructure.
- Integrate Hosting Infrastructure Intelligence: DNS traffic analysis alone is insufficient. Defenders should actively track and correlate DNS activity with hosting infrastructure intelligence. This means monitoring IP ranges, ASNs, hosting providers, and registrant emails associated with identified threats. Understanding common patterns of domain shadowing, bulletproof hosting, and the abuse of major providers (like DigitalOcean, Hetzner, Leaseweb) is crucial for proactive defense and takedown efforts.
- Proactive IP Range and Fingerprint Monitoring: Implement systems to monitor IP ranges known to host malicious content. Furthermore, leverage IP fingerprinting (e.g., identifying specific web server, SSH, and OS configurations) across neighboring IPs. This allows for the prediction of future malicious hosting, enabling defenders to pre-emptively block or monitor suspicious infrastructure before it's actively used in attacks.
- Develop DGA-Specific Detection: Recognize that DGAs produce unique, highly repeatable query patterns due to synchronized call-outs from infected machines. Defenders should develop or deploy detection models specifically tailored to identify these tight clusters of DGA activity, which are a hallmark of many banking Trojans and botnets.
- Automate and Augment Analyst Capabilities: Given the overwhelming volume of DNS data, automation is non-negotiable. Employ machine learning classifiers, such as decision trees, to automatically categorize and prioritize threats. This reduces the burden on human analysts, allowing them to focus their expertise on the most critical and complex cases.
- Stay Aware of Attacker Evasion Tactics: Attackers constantly adapt. Defenders need to be aware of evolving evasion techniques, such as using free domain registrars (Freenom), leveraging registrar-provided name servers to blend in, or diversifying IP space across different ASNs and countries to complicate takedowns and extend campaign lifetimes. Continuous monitoring of these adaptive patterns is essential.
- Embrace a Unified Data View: The most effective defense comes from combining diverse data sources. Integrating recursive DNS traffic, authoritative DNS data, and hosting intelligence provides a holistic, unified view that significantly enhances threat detection, prediction, and response capabilities.
Key Takeaways
- DNS query patterns are a resilient signal: Traditional domain reputation is insufficient. Dynamic DNS query patterns, including traffic spikes and Q-type distributions, offer attacker-resistant signals critical for detecting modern threats like exploit kits, DGAs, and phishing.
- Multi-stage filtering is essential for scale: A multi-layered system incorporating spike detection, domain history filtering, Q-type analysis, and active DNS record probing effectively reduces billions of daily queries to a manageable number of high-priority threats for human analysts.
- Hosting infrastructure is integral to threat intelligence: Analyzing how malicious domains are hosted—including patterns like domain shadowing, bulletproof hosting, abuse of legitimate providers, and IP fingerprinting—provides crucial context, enables predictive capabilities, and completes a "unified DNS view."
- Automation is key to managing data volume: Automated classification tools, such as decision trees, are vital for processing the massive scale of DNS data, reducing 100,000 potential threats to a handful of true positives for efficient human review.
- Attackers are adaptive, requiring continuous monitoring: Cybercriminals constantly evolve their infrastructure and evasion tactics (e.g., switching registrars, diversifying IP space). Security systems must adapt with "micro models" and graph-based intelligence expansion to pivot and discover new threats as they emerge.
- DGA domains have distinct, identifiable signatures: Domain Generation Algorithms create unique, repeatable query patterns from infected machines, making them a specific and detectable class of threat through the analysis of synchronized client call-outs and tight clustering.
About the Speaker(s)
Dhia Mahjoub is a Senior Security Researcher and Technical Leader at OpenDNS. His expertise lies in graph algorithms and their application to large-scale datasets for pattern extraction and threat detection. His work focuses on leveraging the vast amount of DNS data to identify and track malicious activities on the internet.
Thomas Mathew is a Security Researcher at OpenDNS. His background is rooted in machine learning and time series analysis, which he applies to develop sophisticated methods for analyzing DNS traffic patterns and identifying emerging cyber threats.