Understanding Wildcard Domains: Challenges and Solutions
Lire en françaisUnderstand wildcard domains, their impact on subdomain enumeration, and how DNS filtering and HTTP probing improve attack surface visibility.
Table of contents
What Is a Domain Name?
A domain (or domain name) is a unique name used to access resources on the internet, such as websites. Through DNS (Domain Name System), a domain name can be resolved to an IP address. For example, a domain name such as example.com can resolve to an IP address associated with the infrastructure serving that website. This process is called DNS resolution: resolving a domain name into its IP address. It exists to make accessing websites easier, since remembering domain names is far more convenient than remembering IP addresses.
A domain name is part of a website's URL, which is the complete web address pointing to a specific page, file, or resource on the internet. The domain itself is made of several levels:
-
Top-Level Domain (TLD): the extension at the end of the domain, such as
.com,.orgor.ma. Different TLDs have different intended uses or registration rules. For instance,.comis commonly used for commercial websites, while.eduis generally reserved for eligible educational institutions. -
Second-Level Domain (SLD): the main part of the domain name, which usually represents the brand or name of the website (
exampleinexample.com). -
Subdomain: A subdomain is added before the main domain to organize or separate services or sections of a website. For example,
mail.example.comis a subdomain ofexample.com.
The entire combination (subdomain + SLD + TLD) makes up the fully qualified domain name (FQDN), such as blog.example.com.
What Are Wildcard Domains and How Do They Work?
A normal domain typically resolves to one or more IP addresses through explicitly configured DNS records, whereas a wildcard domain allows multiple subdomains, including names that have not been explicitly configured, to resolve to the same IP address or set of IP addresses.
For example, hundreds or thousands of subdomain names can automatically resolve to the same server without requiring an individual DNS record for each one.
This is achieved by configuring a wildcard DNS record using an asterisk (*), such as *.example.com.
Wildcard patterns can also be used in other configurations, such as SSL/TLS certificates (which let you secure many subdomains of a main domain with a single certificate) or web server routing, although these are separate from DNS wildcard behavior.
What Are Wildcards Used For?
Wildcards are useful when you have many subdomains and want to manage them under a single configuration:
-
Ease of management: instead of configuring each subdomain individually, a wildcard consolidates them under a single setup.
-
TLS certificates: a wildcard certificate allows multiple subdomains at the same level to be secured using a single certificate, making certificate management more efficient.
How Do Wildcards Affect Reconnaissance, Subdomain Enumeration, and ASM?
In the Attack Surface Management (ASM) lifecycle, an important step is subdomain enumeration and DNS resolution.
These steps help us discover and understand a company's publicly exposed infrastructure. By identifying subdomains and their associated IP addresses, we can gain better visibility into the company's assets, services, and overall attack surface.
However, wildcard DNS configurations can return valid DNS responses even for subdomain names that have not been explicitly configured. This can lead to a large number of misleading results, presenting the user or security analyst with an inflated subdomain count and an inaccurate representation of the company's attack surface.
This is why it's important to understand that a high number of discovered subdomains doesn't necessarily mean better attack surface coverage.
How to Work Around This: Wildcard Filtering
One way to get better coverage is to add a wildcard filtering system. Approaches differ, but one way to go about it is:
Detect the wildcard: Try resolving a randomly generated subdomain that is highly unlikely to have been explicitly configured, e.g., x7k2q9m4b1.example.com. If it resolves to an IP address, this may indicate that a wildcard DNS configuration is in place. The returned IP(s) give us a baseline of the wildcard's DNS behavior. Repeat with multiple random names to improve reliability.
Filter by IP: For any result that resolves to the same IP(s) as our wildcard baseline, we add a tag indicating that it might be wildcard-generated, rather than immediately removing it.
Add HTTP probing: HTTP probing is the process of sending HTTP or HTTPS requests to a server to determine whether a web service responds and to collect information about its behavior, such as status codes, used technologies, headers, redirects, and response content.
By probing both the discovered subdomains and randomly generated wildcard-backed names, we can compare their responses and better understand what the default wildcard behavior looks like at the HTTP layer.
For example, if multiple subdomains return the same generic page, with identical response characteristics, this could indicate that they are being handled by a default wildcard configuration rather than distinct web applications.
On the other hand, if a discovered subdomain returns a different application, unique content, or other meaningful response characteristics, this provides additional evidence that it may represent a legitimate asset.
Of course, this isn't a perfect guarantee: a wildcard configuration can return successful HTTP responses, and legitimate subdomains can share identical content.
However, by combining DNS wildcard detection with HTTP probing and response comparison, we can significantly improve the accuracy of subdomain enumeration and reduce misleading results.
What HexBox Does Differently
At HexBox, our approach is not simply to remove every subdomain that looks like a wildcard result.
Instead, we aim to provide a clearer and more accurate representation of the company's attack surface by combining wildcard detection, filtering, and HTTP probing.
We identify potential wildcard-generated results and present them with dedicated tags, allowing users to understand which findings may be affected by wildcard configurations.
Alongside this, HTTP probing provides additional information about the discovered subdomains, helping distinguish generic wildcard responses from potentially legitimate services.
The goal is to give security analysts a more complete view of their discoveries, while avoiding inflated result counts and preserving potentially valuable assets that could otherwise be filtered out.
In short, we don't just want to show more subdomains; we want to show more meaningful results.
Key Takeaways
Wildcard domains are normal: They are widely used because they simplify DNS management and support flexible infrastructure configurations.
More results don't necessarily mean better coverage: A large number of discovered subdomains can be misleading when wildcard DNS configurations are involved.
Wildcard filtering improves accuracy: Combining DNS analysis with HTTP probing helps reduce false positives and provides a clearer, more reliable picture of a company's attack surface.