Foot Printing, HBE, DNS
Foot Printing, HBE, DNS
Key Points
Main technique:
DNS Zone Transfer (AXFR)
Subdomain Enumeration
DNS Record Analysis
Internal Domain Discovery
Critical tools:
dig - Primary DNS query tool
dig ns - Nameserver queries
dig axfr - Zone transfers
dig @server domain - Targeted queries
dnsenum - Advanced enumeration
/usr/share/seclists wordlists
Common pitfalls:
Assuming root domain transfer failure means no access
Always check subdomains and internal domains
Missing follow-up enumeration
One finding should lead to more tests
Forgetting to check different record types
A, TXT, CNAME, etc.
Not documenting found information
IPs, hostnames, and patterns are important
Purpose of exercise/Question
Start with a clear statement of the exercise's main goal
The primary objective of this exercise is to demonstrate comprehensive DNS enumeration techniques and
understand how misconfigured DNS servers can lead to information disclosure. Through a series of
interconnected challenges, you learn how initial discoveries can lead to deeper enumeration opportunities.
Question: Interact with the target DNS using its IP address and enumerate the FQDN of
it for the "inlanefreight.htb" domain.
Answer: ns.inlanefreight.htb.
Hint:
we get ns.inlanefreight.htb
Related Section
Question: Identify if its possible to perform a zone transfer and submit the TXT record
as the answer. (Format: HTB{...})
Answer: HTB{DN5_z0N3_7r4N5F3r_iskdufhcnlu34}
to do this we are going to try and performa an internal zone transfer on the domain
Related Section
This one took a little more work so here is a graph explaining why
This did not give me what I was looking for when it comes to the txt file
dig axfr inlanefreight.htb @10.129.14.128
but
internal.inlanefreight.htb inlanefreight.htb
This command targeted the internal subdomain not the root domain
The AXFR (zone transfer) request was successful because:
Zone transfers were likely enabled for the internal zone
No transfer restrictions were in place
This domain contained the TXT record we were looking for
This is a common scenario in security assessments where internal DNS zones might have weaker controls
than external ones, allowing for information disclosure through zone transfers.
Answer: 10.129.34.16
Hint: Zones often have the name of a subdomain.
Question: What is the FQDN of the host where the last octet ends with "x.x.x.203"?
Answer: win2k.dev.inlanefreight.htb
Hint: Remember that different wordlists do not always have the same entries.
This one took a little work for me to get through as well (I had also read through the question a little too fast
and didnt break it down as much as I should have) they were looking for the hostname or FQDN that ended
in .203 as the last octet
where I went wrong was attempting to brute force the normal domain trying to find the answer when I should
have been brute forcing the subdomains for hosts
after looking through the subdomains we had and running fierce_hostlist.txt against each of them this is what
I came up with for the answer
Step 1: NS Query
ns.inlanefreight.htb
Transfer Successful
IP Ends With
Simple explanation: Think of a name server like a phone book operator. Before we can ask for any other
information, we need to know who to ask. The dig ns command is like asking "Who's in charge of the phone
book for inlanefreight.htb?"
Result: We found ns.inlanefreight.htb - this is our operator who knows all the information.
Simple explanation: A zone transfer is like asking the phone book operator "Can I have a copy of the entire
phone book?" Usually, they should say no - but sometimes they accidentally say yes! This is what happened
here. We got information about different parts of the network, including a subdomain called
dev.inlanefreight.htb .
It's like finding out there's not just one phone book, but several different ones for different departments.
What we did: After finding out there was an internal domain, we tried dig axfr
internal.inlanefreight.htb @10.129.82.99
Simple explanation: We found out there was another phone book for "internal" numbers. When we asked
for a copy of this one, we got:
This is like finding the internal company directory that shouldn't have been shared with outsiders.
What we did: Used dnsenum with a special wordlist to look deeper at dev.inlanefreight.htb
Simple explanation: After finding the development subdomain, we used a tool that's like a really fast
assistant that tries common computer names. It's like going through the phone book and looking for specific
types of entries.
It's like finding one key that opens a door, behind which there are more keys and more doors!
In a secure system:
🔗 Cross-References
Related Techniques
Zone Transfer Attacks
DNS Reconnaissance
Subdomain Enumeration
🎓 Additional Resources
Official documentation:
BIND 9 Documentation
RFC 1035 - Domain Names Implementation and Specification
Helpful blogs:
HackTricks - DNS Pentesting
Port Swigger - DNS Enumeration
Video tutorials:
IppSec's DNS Enumeration Techniques
TCM Security - DNS Recon
Practice labs:
HackTheBox Academy - DNS Enumeration
TryHackMe - DNS in Detail
Command Variations
1. Basic NS query:
1. Basic enumeration:
1. fierce:
2. host command:
3. nslookup:
Best Practices
1. Always start with passive reconnaissance
2. Use multiple tools to validate findings
3. Document all discovered subdomains and records
4. Check both root domain and subdomains for zone transfers
5. Verify findings with multiple DNS servers when possible