Kuboid
Open Luck·Kuboid.in
Black Hat2023
Open in YouTube ↗

Deleting Your Domain? Preventing Data Leaks at TLD Scale

Black Hat1,479 views40:28about 2 years ago

This talk demonstrates the security risks associated with expired domain names, specifically focusing on how attackers can register deleted domains to intercept sensitive email traffic. The researchers introduce 'LEMMINGS' (DeLeTed doMain MaiL warNinG System), a system designed to detect mail traffic directed at deleted domains and alert the former registrants. The presentation highlights the methodology for analyzing large-scale DNS data to identify potential data leaks and discusses the challenges of communicating these risks to non-technical domain owners. The system effectively reduces the risk of data exposure by providing timely warnings during the domain's quarantine period.

The Silent Data Leak: Why Expired Domains Are Your Next Big Finding

TLDR: Expired domains are a goldmine for attackers, allowing them to register abandoned infrastructure and intercept sensitive email traffic. Researchers at SIDN Labs developed a system called LEMMINGS to monitor DNS traffic for deleted domains and alert registrants before their data is exposed. Pentesters and bug bounty hunters should prioritize checking for dangling DNS records and expired domains as part of their reconnaissance to identify potential account takeover or data exfiltration vectors.

Security researchers often obsess over complex zero-day chains or novel memory corruption techniques, but the most reliable way into a network remains the path of least resistance. One of the most overlooked vectors is the lifecycle of a domain name. When an organization stops paying for a domain, it eventually enters a deletion process. If that domain was previously used for email services, the DNS records might still point to infrastructure that is now ripe for the taking.

The Mechanics of Domain Hijacking via Expiration

The attack flow is straightforward but devastating. An organization registers example.nl and configures a mail server at mail.example.nl. Over time, they move to a new domain or simply forget to renew the old one. Once the domain expires and passes through the registry’s quarantine period, it becomes available for anyone to register.

If the organization failed to clean up their DNS records, or if third-party services still attempt to send mail to that domain, the new owner of the domain can intercept that traffic. By setting up a catch-all email address on the newly acquired domain, an attacker can receive sensitive communications, password reset tokens, and internal business data that was never intended for them. This is a classic example of T1584.004 in the MITRE ATT&CK framework, where an adversary compromises infrastructure to facilitate further operations.

Analyzing Traffic at TLD Scale

The research presented by SIDN Labs at Black Hat 2023 provides a masterclass in how to handle massive datasets to solve a security problem. They operate the registry for the .nl TLD, which gives them a unique vantage point. They process roughly four billion DNS queries daily. To make sense of this, they utilize a stack consisting of Apache Hadoop for distributed storage and Apache Spark for processing, storing the results in Apache Parquet format for efficient querying.

The challenge is filtering the signal from the noise. A significant portion of DNS traffic is just automated scanning, spam, or marketing-related queries. To isolate the dangerous traffic, the researchers look for specific attributes:

  • AS Number: Identifying traffic from known bulk email or marketing networks.
  • High NXDOMAIN rates: Flagging resolvers that query a high volume of non-existent domains, which often indicates automated scanning or misconfigured services.
  • Newly Seen Resolvers: Monitoring for traffic from sources that haven't been observed in the recent past.

By combining this DNS data with their own web crawler, they can determine if a domain was actually hosting a website or if it was just a placeholder. This allows them to prioritize alerts for domains that were likely in active use.

Practical Application for Pentesters

For those of us in the field, this research highlights a critical step in the reconnaissance phase. When you are mapping an organization's external attack surface, do not just look at the live assets. Use tools like dig or subfinder to identify all subdomains and check their current registration status. If you find a subdomain that resolves to an IP address but the domain itself is expired or available for registration, you have found a high-impact finding.

During a red team engagement, identifying these "dangling" records can provide a persistent foothold. If you can register the domain, you can potentially receive traffic from internal systems that are still configured to communicate with the old infrastructure. This is not just theoretical; it is a proven method for intercepting traffic that can lead to full account takeovers or the compromise of sensitive internal workflows.

Defensive Measures

Defenders need to treat domain expiration with the same urgency as a critical patch. The primary defense is a rigorous inventory of all domain names and their associated DNS records. If a domain is no longer needed, the associated DNS records must be purged from all authoritative and recursive servers.

Furthermore, organizations should implement monitoring for their own domains to detect if they are nearing expiration or if they have been inadvertently released. The LEMMINGS system is a proactive approach, but for most companies, the responsibility lies in maintaining a clean DNS configuration. If you are managing infrastructure, ensure that your DNS management process includes a decommissioning step that removes all records associated with a retired domain.

The gap between a domain being deleted and it being re-registered is a window of opportunity for attackers. By understanding the lifecycle of these assets and the data they carry, researchers and defenders can close this gap before it becomes a liability. Keep your DNS clean, monitor your assets, and never assume that a retired domain is truly gone until you have verified that the records are dead.

Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in