Footprinting DNS - Dan Clancey
Footprinting DNS - Dan Clancey
Cybersecurity Professional
Footprinting DNS
May 30, 2024
4 min read
HTB Cybersecurity Offensive Walkthrough
Now we will be working on the Footprinting DNS section in the Footprinting module on Hack The Box academy.
DNS Zone Transfers used to be one of my weakpoints; however, when I originally did this on Hack the Box, it helped
tremendously in understanding how DNS works. I highly recommend reading through the section if you struggle. And as always,
practice makes perfect!
1. Interact with the target DNS using its IP address and enumerate the FQDN of it for the
“inlanefreight.htb” domain.
sudo vi /etc/hosts
127.0.0.1 localhost
127.0.1.1 kali.siffer.local kali
10.129.247.162 inlanefreight.htb
Now we can use dig to enumerate the domain. Remember to use the IP address as the name server!:
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 592ef17f37c631600100000066591a67f2ecfe076c188838 (good)
;; QUESTION SECTION:
;inlanefreight.htb. IN NS
;; ANSWER SECTION:
inlanefreight.htb. 604800 IN NS [redacted]
;; ADDITIONAL SECTION:
ns.inlanefreight.htb. 604800 IN A 127.0.0.1
2. Identify if its possible to perform a zone transfer and submit the TXT record as the answer. (Format:
HTB{…))
Now lets check to see if we can do some zone transfers! We can use dig with axfr option to enumerate:
app.inlanefreight.htb
dev.inlanefreight.htb
internal.inlanefreight.htb
mail1.inlanefreight.htb
We can now try to transfer each record. Both app and dev failed; however, internal worked!
Several TXT records, and our flag is contained in one of them (redacted).
We can get the answer for this question in the internal transfer as well. It is part of the snipped portion above
4. What is the FQDN of the host where the last octet ends with “x.x.x.203”?
This one takes a bit of trial and error with the tool dnsenum. We need to enumerate the correct subdomain and use the right
wordlist. The proper command is:
First I tried against the app subdomain and the NS query failed, so then I moved on to dev and started getting results; However,
the first few lists I tried were not returning an IP with the last octet 203. Finally got there using fierce-hostlist.txt
Host's addresses:
__________________
Name Servers:
<SNIP>
Mail (MX) Servers:
<SNIP>
Trying Zone Transfers and getting Bind Versions:
_________________________________________________
<SNIP>
This is an excellent example that you shouldn’t rely on a single wordlist. Always do a couple passes during enumeration with
differnt wordlists to paint a full picture! Enumeration is the most important step of a penetration test, so be as thorough as
possible.