1 2 |
> host -t ns example.com # -t : type , ns: dns > host -t mx |
You can also use nslookup!
1 |
> nslookup |
You can also use dig, which is my favorite
1 |
> dig |
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.
Automate the Forward DNS Lookup of common hostnames using the host command and a Bash script.
1 2 3 4 5 6 7 8 |
> 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.example.com;done |
1 2 |
> for ip in $(seq 155 190);do host XX.x.x.$ip;done | grep -v "not found" # grep -v :: --invert-match |
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.
1 2 3 4 5 |
> host -l example.com ns1. # ns1 refused us our zone transfer request and -l :: list all hosts in a domain > host -l example.com ns2. # 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. |
1 2 3 |
> host -t ns # -d :: --delimiter=DELIM ; # -f :: --fields=LIST select only these fields on each line; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# /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 |
DNSRecon
1 2 3 4 |
> dnsrecon -d # -d :: domain # -t :: type of Enumeration to perform # axfr :: test all ns servers for zone transfer |
DNSEnum
1 |
> dnsenum |
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)