DNS 53
Nmap Enumeration
Basic Scan for DNS
nmap -p 53 <target_range> -vv -oA dns.txtWhere <target_range> could be a single IP (e.g., 10.10.10.10) or a range (e.g., 10.11.1.1-254).
Finding the DNS Server
Using nslookup
nslookupnslookup <hostname> <dns_server_ip>Using dig
digBasic Queries:
dig @<dns_server_ip> <hostname>Reverse Lookup:
dig -x <ip_address> +shortForward Lookup Bruteforce
Using dnsrecon
dnsreconInstall dnsrecon:
sudo apt install dnsreconRun a forward lookup brute force:
dnsrecon -d example.com -D /usr/share/wordlists/dnsmap.txt -t std --xml dnsrecon.xmlUsing dnsmap
dnsmapInstall dnsmap:
sudo apt install dnsmapRun DNS enumeration:
dnsmap example.comUsing host
hostFor a basic lookup:
host example.comFor specific records:
host -mx example.com # MX Records
host -tx example.com # TXT RecordsAutomating Forward Lookups with Bash
Prepare a list of subdomains (e.g., list.txt):
www
ftp
proxy
mailRun the following script:
for subdomain in $(cat list.txt); do host $subdomain.example.com; doneReverse Lookup Bruteforce
Using Bash
For a range of IPs:
for ip in $(seq 50 100); do host 38.100.193.$ip; done | grep -v "not found"Using dnsrecon
dnsreconReverse lookup brute force:
dnsrecon -d example.com -t rvlDNS Zone Transfers
Using host
hostCheck for a vulnerable zone transfer:
host -l example.com <dns_server_ip>Using dnsrecon
dnsrecondnsrecon -d example.com -t axfrUsing dnsenum
dnsenumInstall dnsenum:
sudo apt install dnsenumRun zone transfer:
dnsenum zonetransfer.meCommon Use Cases
Forward Lookups: Identify valid subdomains and their associated IPs.
Reverse Lookups: Discover hostnames for a given range of IPs.
Zone Transfers: Exploit misconfigured DNS servers to dump entire domain records.
Brute Forcing: Use wordlists to uncover hidden or forgotten subdomains.
Custom Wordlists
You can use wordlists from the SecLists repository for DNS brute-forcing:
sudo apt install seclistsExample location:
/usr/share/seclists/Discovery/DNS/Last updated