DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

How to Implement DNS Enumeration

DNS enumeration offers TONS of helpful info on public servers, including IP addresses, server names, and purposes. Let's take a closer look.

Austin Songer user avatar by
Austin Songer
·
Nov. 06, 18 · Tutorial
Like (1)
Save
Tweet
Share
5.94K Views

Join the DZone community and get the full member experience.

Join For Free

DNS offers a variety of information about public organizations servers, such as IP addresses, server names, and server purposes. Let's take a closer look at how to implement our own DNS enumeration.

Interacting With a DNS Server

> host -t ns alight.com           # -t : type , ns: dns
> host -t mx alight.com           # mx : mail server


You can also use nslookup!
> nslookup alight.com


You can also use dig, which is my favorite
> dig alight.com


Automating Lookups

We have some initial data from the megacorpone.com domain, we can continue to use additional DNS queries to discover more hostnames and IP addresses belonging to megacorpone.com.

Forward Lookup Brute Force

Automate the Forward DNS Lookup of common hostnames using the host command and a Bash script.

> echo www > list.txt
> echo ftp >> list.txt
> echo mail >> list.txt
> echo owa >> list.txt
> echo proxy >> list.txt
> echo router >> list.txt
> echo api >> list.txt
> for ip in $(cat list.txt);do host $ip.alight.com;done


Reverse Lookup Brute Force


> for ip in $(seq 155 190);do host 50.7.67.$ip;done | grep -v "not found"
# grep -v :: --invert-match



DNS Zone Transfers

A zone transfer is similar to a database replication act between related DNS servers. This process includes the copying of the zone file from a master DNS server to a slave server. The zone file contains a list of all the DNS names configured for that zone. Zone transfers should usually be limited to authorized slave DNS servers.

> host -l alight.com ns1.alight.com   
# ns1 refused us our zone transfer request and -l :: list all hosts in a domain
> host -l alight.com ns2.alight.com 
# The result is a full dump of the zone file for the alight.com domain
# which providing us a convenient list of IPs and DNS names for the alight.com domain.


Receiving the Given Domain in a Clean Format

 > host -t ns alight.com | cut -d " " -f 4
 # -d :: --delimiter=DELIM ;
 # -f ::  --fields=LIST select only these fields on each line;


Simple Zone Transfer Bash Script

# /bin/bash
# Simple Zone Transfer Bash Script
# $1 is the first argument given after the bash script
# Check if argument was given, if not, print usage
if  [-z "$1" ]; then
echo "[-] Simple Zone transfer script"
echo "[-] Usage : $0 <domain name> "
exit 0
fi

# if argument was given, identify the DNS servers for the domain
for server in $(host ­-t ns $1 | cut ­-d" " ­-f4);do
# For each of these servers, attempt a zone transfer
host -l $1 $server | grep "has address"
done


Using Kali Linux Tools

DNSRecon

> dnsrecon -d alight.com -t axfr
# -d :: domain
# -t :: type of Enumeration to perform
# axfr :: test all ns servers for zone transfer


DNSEnum

> dnsenum zonetransfer.me


Domain Name System

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 11 Observability Tools You Should Know
  • Real-Time Analytics for IoT
  • How To Choose the Right Streaming Database
  • Front-End Troubleshooting Using OpenTelemetry

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: