DEV Community

Cover image for Certificate Parsing with `domain-recon`
Ervin Szilagyi for recon-tools

Posted on • Updated on • Originally published at

Certificate Parsing with `domain-recon`

What is Certificate Parsing?

Certificate parsing is a way of conducting web hacking reconnaissance when an attacker is targeting an organization. The goal is to gather information about the organization and widen the attack space by enumerating every possible domain and subdomain owned by an organization. One methodology of enumerating domains and subdomains is to take advantage of the SSL certificates used by the organization. There are several online databases like and sslmate which can be used to enumerate certificates issued for domains owned by an organization. Moreover, if we take a look at the Subject Alternative Name of a certificate, we might be able to enumerate other hostnames for which the certificate is applied.

What is domain-recon?

domain-recon is an open-source command line tool written in Rust, which automates certificate parsing. It uses []( database to fetch information about certificates issued for a domain and all of its subdomains. It extracts all the hostnames from the Common Name and Matching Identities fields, the result of which will be a list of domains requiring further filtering. We can distinguish the following type of domains in the list:

  • registered domains that can be resolved as IPv4 or IPv6 IP addresses;
  • unregistered domains;
  • wildcard domains, domain names which contain a wildcard character (*), for example: * Wildcards are used to secure multiple subdomain names (hosts) pertaining to the same base domain.

domain-recon filters out wildcard domains from the list and tries to do a domain resolution for each non-wildcard domain. It drops all the domain names which are not registered and it displays a list only with the "valid" domain names.

In the case of the wildcard domains, it will try to guess possible subdomains. This is accomplished by taking a wordlist as input and replacing the wildcards with entries from the list. To detect which domain names are registered, it tries to do a domain resolution for each new entry and displays a new list with the successful queries.

Example of Usage

The source code for domain-recon tool can be found on GitHub. Executables are built and released for all Linux, Mac, and Windows operating systems and can be downloaded from the releases.

List all the domains and subdomains for

domain-recon -d -f words.txt
Enter fullscreen mode Exit fullscreen mode

The output of which will be something like this:

Fetching certificates...
Extracting domains.... A,, A,,, A,, A, A, A,,, A, A, A A A, A A A

Expanding wildcards... A, A, A,, A,, A,
Enter fullscreen mode Exit fullscreen mode

We can omit to expand wildcards by not specifying a wordlist:

domain-recon -d
Enter fullscreen mode Exit fullscreen mode


Fetching certificates...
Extracting domains.... A, A,, A,,, A, A A,, A, A, A A A,,, A, A A
Enter fullscreen mode Exit fullscreen mode

We can use the --plain flag to suppress displaying IP addresses. This can be useful if we want a list with domain names only, which can be provided as input for tools such as httpx.


$ domain-recon -d -f words.txt --plain | httpx -probe -sc -title -ip

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/              v1.2.5

Use with caution. You are responsible for your actions.
Developers assume no liability and are not responsible for any misuse or damage. [SUCCESS] [301] [] [] [SUCCESS] [301] [] [] [SUCCESS] [301] [] [] [SUCCESS] [] [Fastly error: unknown domain] [] [SUCCESS] [301] [] [] [SUCCESS] [200] [DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»] [] [SUCCESS] [308] [] [] [SUCCESS] [200] [Hello from Forem Admin Docs | Forem Admin Docs] [] [SUCCESS] [301] [] [] [SUCCESS] [200] [thank you] [] [SUCCESS] [200] [Webpack App] [] [SUCCESS] [200] [Forem Shop] [] [SUCCESS] [301] [] [] [SUCCESS] [200] [[Forem] Community for Everyone] [] [SUCCESS] [200] [DEV Status] [] [SUCCESS] [200] [Customer Service Status] [] [SUCCESS] [301] [] [] [SUCCESS] [200] [St Monica Trust IT Status] [] [SUCCESS] [302] [] [] [SUCCESS] [200] [Dunder Mifflin Community πŸ“„] []
Enter fullscreen mode Exit fullscreen mode


domain-recon can discover domain names that have public SSL certificates. Currently, it scans only valid certificates, this can be easily changed to include invalid ones as well, but according to my experience, this is not as useful.

Nowadays, most websites have SSL certificates, including development and testing environments as well. It can be helpful for a pen-tester to scan for these environments. Obviously, it can not find environments without registered SSL certificates.

domain-recon currently uses Google, Cloudflare, and Quad9 domain resolvers. By default, it is set to use Google only, which we can override with --dns_resolver argument. We can also set to use multiple resolvers at the same time (--dns_resolver="google,cloudflare,quad9"). According to my experience, having only one resolver might invoke rate limiting if we are scanning a huge number of domains at the same time. Unfortunately, there are slowdowns with multiple resolvers as well. It relies on async-std-resolver crate for DNS resolution. A future improvement would be to optimize the usage of async-std-resolver to achieve better performance. Since it relies on async calls, we can run on errors related to having too many opened connections. This is somewhat mitigated by limiting the DNS calls to a lower number, but I'm sure there better ways to deal with it.

Further Reading

domain-recon tool was inspired by "Bug Bounty Bootcamp: The Guide to Finding and Reporting Web Vulnerabilities" book by Vickie Li. It is a great resource for anyone interested in web hacking and penetration testing.

Source Code and Contributing

As mentioned above, the source code for domain-recon can be found on GitHub: It is written entirely in Rust. Any contribution is welcomed. ;)

Top comments (0)