The domain name can provide important information about the job of a target system: As humans have a hard time remembering a random sequence of numbers, IT systems are usually assigned a meaningful designation. As attackers we can take advantage of this fact by attempting to narrow down the target network or a domain via DNS queries. Here, we can perform both forward lookups and reverse lookups.

When we use a forward lookup, we attempt to resolve a domain name into its associated IP address via the responsible DNS server. This occurs, for example, when opening a website using its name. Furthermore, we may attempt to identify additional IT systems in a network by probing various subdomains. For example, a company like Dubius Payment Ltd. may designate a firewall through the subdomain fw. This means we need to carry out a forward lookup for the full domain name fw.dubius-payment.com. These types of DNS queries can be accomplished with the dig tool (domain information groper):

  • dig ${domain name} @${DNS server} +short

Unlike a forward lookup, with a reserve lookup we have the IP addresses of the target systems available to us and we “only“ aim to determine the domain name. As mentioned previously, the domain name reveals information about the function of a system. The domain name db.dubius-payment.com, for instance, is likely to hold a database on the existing system. So we should query the possible domain name for each IP address in a network:

-dig -x ${IP address} @${DNS server} +short

Sometimes we get lucky as attackers. With DNS, this would be a permitted zone transfer. With a successful zone transfer, we end up with a list of resource records and are thus endowed with the relevant information on a domain:

-dig axfr ${Domain} @${DNS server}

But as much as we would like to have the zone file of a domain available to us, this is rarely the case. It may even be the case that no DNS entries are stored for an IT system, so that we should be grateful for any additional information available.

Last modified: Dec. 15, 2022

Penetation Testing Course

About Pentest Training

Discover the world of penetration testing. Learn how to infiltrate networks and successfully penetrate systems and applications. Acquire the necessary hacking skills and use them when conducting professional penetration tests. Become a real penetration tester. Here you will find the free documents for the Pentest Training of binsec academy GmbH. The binsec academy GmbH offers the corresponding security training lab environments and certifications. However, the knowledge and wiki articles on hacking and penetration testing is universal.

About binsec academy GmbH

binsec academy GmbH is the European provider of online security training with virtual laboratory environments. The core component of all security training is the focus on practice, practice and more practice. In the wiki here you will find the public and freely available course materials. You can put the theory into practice at binsec-academy.com.