DNS Enumeration and Scanning Tool.


git clone https://github.com/darkoperator/dnsrecon.git
python3 -m pip install -r requirements.txt


dnsrecon.py [-h] [-d DOMAIN] [-n NS_SERVER] [-r RANGE] [-D DICTIONARY] [-f] [-a] [-s] [-b] [-y] [-k] [-w] [-z] [--threads THREADS] [--lifetime LIFETIME] [--tcp] [--db DB] [-x XML] [-c CSV] [-j JSON] [--iw]
                   [--disable_check_recursion] [--disable_check_bindversion] [-V] [-v] [-t TYPE]


  -h, --help            show this help message and exit
  -d DOMAIN, --domain DOMAIN
                        Target domain.
  -n NS_SERVER, --name_server NS_SERVER
                        Domain server to use. If none is given, the SOA of the target will be used. Multiple servers can be specified using a comma separated list.
  -r RANGE, --range RANGE
                        IP range for reverse lookup brute force in formats   (first-last) or in (range/bitmask).
                        Dictionary file of subdomain and hostnames to use for brute force.
  -f                    Filter out of brute force domain lookup, records that resolve to the wildcard defined IP address when saving records.
  -a                    Perform AXFR with standard enumeration.
  -s                    Perform a reverse lookup of IPv4 ranges in the SPF record with standard enumeration.
  -b                    Perform Bing enumeration with standard enumeration.
  -y                    Perform Yandex enumeration with standard enumeration.
  -k                    Perform crt.sh enumeration with standard enumeration.
  -w                    Perform deep whois record analysis and reverse lookup of IP ranges found through Whois when doing a standard enumeration.
  -z                    Performs a DNSSEC zone walk with standard enumeration.
  --threads THREADS     Number of threads to use in reverse lookups, forward lookups, brute force and SRV record enumeration.
  --lifetime LIFETIME   Time to wait for a server to respond to a query. default is 3.0
  --tcp                 Use TCP protocol to make queries.
  --db DB               SQLite 3 file to save found records.
  -x XML, --xml XML     XML file to save found records.
  -c CSV, --csv CSV     Save output to a comma separated value file.
  -j JSON, --json JSON  save output to a JSON file.
  --iw                  Continue brute forcing a domain even if a wildcard record is discovered.
                        Disables check for recursion on name servers
                        Disables check for BIND version on name servers
  -V, --version         Show DNSrecon version
  -v, --verbose         Enable verbose
  -t TYPE, --type TYPE  Type of enumeration to perform.
                        Possible types:
                            std:      SOA, NS, A, AAAA, MX and SRV.
                            rvl:      Reverse lookup of a given CIDR or IP range.
                            brt:      Brute force domains and hosts using a given dictionary.
                            srv:      SRV records.
                            axfr:     Test all NS servers for a zone transfer.
                            bing:     Perform Bing search for subdomains and hosts.
                            yand:     Perform Yandex search for subdomains and hosts.
                            crt:      Perform crt.sh search for subdomains and hosts.
                            snoop:    Perform cache snooping against all NS servers for a given domain, testing
                                      all with file containing the domains, file given with -D option.
                            tld:      Remove the TLD of given domain and test against all TLDs registered in IANA.
                            zonewalk: Perform a DNSSEC zone walk using NSEC records.


Standard DNS recon

$ python3 dnsrecon.py -d example.com -t std

[*] Performing General Enumeration of Domain:example.com
[-] All nameservers failed to answer the DNSSEC query for example.com
[*]      SOA ns.icann.org
[*]      NS a.iana-servers.net
[*]      NS a.iana-servers.net 2001:500:8f::53
[*]      NS b.iana-servers.net
[*]      NS b.iana-servers.net 2001:500:8d::53
[*]      A example.com
[*]      AAAA example.com 2606:2800:220:1:248:1893:25c8:1946
[*]      TXT example.com v=spf1 -all
[*] Enumerating SRV Records
[-] No SRV Records Found for example.com
[+] 0 Records Found

DNS Zone Transfer

$ python3 dnsrecon.py -d megacorpone.com -t axfr
[*] Checking for Zone Transfer for megacorpone.com name servers
[*] Resolving SOA Record
[+]      SOA ns1.megacorpone.com
[*] Resolving NS Records
[*] NS Servers found:
[+]      NS ns1.megacorpone.com
[+]      NS ns3.megacorpone.com
[+]      NS ns2.megacorpone.com
[*] Removing any duplicate NS server IP Addresses...
[*] Trying NS server
[+] Has port 53 TCP Open
[-] Zone Transfer Failed (Zone transfer error: REFUSED)
[*] Trying NS server
[+] Has port 53 TCP Open
[+] Zone Transfer was successful!!
[*]      NS ns1.megacorpone.com
[*]      NS ns2.megacorpone.com
[*]      NS ns3.megacorpone.com
[*]      TXT Try Harder
[*]      TXT google-site-verification=U7B_b0HNeBtY4qYGQZNsEYXfCJ32hMNV3GtC0wWq5pA
[*]      MX @.megacorpone.com fb.mail.gandi.net
[*]      MX @.megacorpone.com fb.mail.gandi.net
[*]      MX @.megacorpone.com fb.mail.gandi.net
[*]      MX @.megacorpone.com spool.mail.gandi.net
[*]      A admin.megacorpone.com
[*]      A beta.megacorpone.com
[*]      A fs1.megacorpone.com
[*]      A intranet.megacorpone.com
[*]      A mail.megacorpone.com
[*]      A mail2.megacorpone.com
[*]      A ns1.megacorpone.com
[*]      A ns2.megacorpone.com
[*]      A ns3.megacorpone.com
[*]      A router.megacorpone.com
[*]      A siem.megacorpone.com
[*]      A snmp.megacorpone.com
[*]      A support.megacorpone.com
[*]      A syslog.megacorpone.com
[*]      A test.megacorpone.com
[*]      A vpn.megacorpone.com
[*]      A www.megacorpone.com
[*]      A www2.megacorpone.com
[*] Trying NS server
[+] Has port 53 TCP Open
[-] Zone Transfer Failed (Zone transfer error: REFUSED)

DNS BruteForce

Discovery of subdomains via brute force.

Download your desired list to use as input, for example at Github.com - SecLists

$ dnsrecon -d megacorpone.com -D ~/list.txt -t brt
[*] Performing host and subdomain brute force against megacorpone.com
[*]     A www.megacorpone.com
[*]     A mail.megacorpone.com
[*]     A router.megacorpone.com
[+] 3 Records Found

URL List