pentesting, updated

dnsrecon

dnsrecon: DNS enumeration and zone/record sweeps, used to spot dangling records for subdomain takeover.

What it’s for

Enumerate DNS records for a domain and check for weaknesses such as zone transfer and dangling CNAMEs that enable subdomain takeover.

Options

Target and resolver

FlagEffect
-d example.comTarget domain
-n ns1.example.comQuery a specific nameserver
-r 10.0.0.0/24Reverse-lookup a range (with -t rvl/-t rvs)

Scan type (-t)

ValueEffect
stdStandard records: SOA, NS, A, AAAA, MX, SRV, TXT
axfrAttempt a zone transfer against every NS
brtBrute-force hostnames from a wordlist
rvlReverse lookup of an IP range
srvEnumerate common SRV records
zonewalkWalk a DNSSEC-signed zone (NSEC)

Brute force and output

FlagEffect
-D subs.txtWordlist for brt
-fFilter out wildcard answers while brute forcing
--threads NParallel lookups
-x out.xmlSave results as XML
-j out.jsonSave results as JSON
-c out.csvSave results as CSV

Examples

Standard enumeration

dnsrecon -d example.com                                # SOA, NS, A/AAAA, MX, SRV, TXT
dnsrecon -d example.com -n 1.1.1.1                     # force a specific resolver
dnsrecon -d example.com -t std -j out.json             # standard sweep saved as JSON

Zone transfer — always try first

dnsrecon -d example.com -t axfr                        # test AXFR on every nameserver

Brute forcing and reverse lookups

dnsrecon -d example.com -t brt -D subs.txt -f          # brute hostnames, drop wildcards
dnsrecon -d example.com -t brt -D subs.txt --threads 20 # more threads for large lists
dnsrecon -r 203.0.113.0/24 -t rvl                      # reverse-lookup a network block
dnsrecon -d example.com -t zonewalk                    # enumerate an NSEC-signed zone

References

§ home
~/knubertus/home/
1,1 Top