• Stars
    star
    804
  • Rank 54,648 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DNSTake β€” A fast tool to check missing hosted DNS zones that can lead to subdomain takeover

DNSTake

DNSTake

A fast tool to check missing hosted DNS zones that can lead to subdomain takeover.


What is a DNS takeover?

DNS takeover vulnerabilities occur when a subdomain (subdomain.example.com) or domain has its authoritative nameserver set to a provider (e.g. AWS Route 53, Akamai, Microsoft Azure, etc.) but the hosted zone has been removed or deleted. Consequently, when making a request for DNS records the server responds with a SERVFAIL error. This allows an attacker to create the missing hosted zone on the service that was being used and thus control all DNS records for that (sub)domain.ΒΉ

Installation

from Binary

The ez way! You can download a pre-built binary from releases page, just unpack and run!

from Source

NOTE: Go 1.16+ compiler should be installed & configured!

Very quick & clean!

β–Ά go install github.com/pwnesia/dnstake/cmd/dnstake@latest

β€” or

Manual building executable from source code:

β–Ά git clone https://github.com/pwnesia/dnstake
β–Ά cd dnstake/cmd/dnstake
β–Ά go build .
β–Ά (sudo) mv dnstake /usr/local/bin

Usage

$ dnstake -h

  Β·β–„β–„β–„β–„   ▐ β–„ .β–„β–„ Β·β–„β–„β–„β–„β–„ β–„β–„β–„Β· β–„ β€’β–„ β–„β–„β–„ .
  β–ˆβ–ˆβ–ͺ β–ˆβ–ˆ β€’β–ˆβ–Œβ–β–ˆβ–β–ˆ β–€.β€’β–ˆβ–ˆ  β–β–ˆ β–€β–ˆ β–ˆβ–Œβ–„β–Œβ–ͺβ–€β–„.β–€Β·
  β–β–ˆΒ· β–β–ˆβ–Œβ–β–ˆβ–β–β–Œβ–„β–€β–€β–€β–ˆβ–„β–β–ˆ.β–ͺβ–„β–ˆβ–€β–€β–ˆ ▐▀▀▄·▐▀▀β–ͺβ–„
  β–ˆβ–ˆ. β–ˆβ–ˆ β–ˆβ–ˆβ–β–ˆβ–Œβ–β–ˆβ–„β–ͺβ–β–ˆβ–β–ˆβ–ŒΒ·β–β–ˆ β–ͺβ–β–Œβ–β–ˆ.β–ˆβ–Œβ–β–ˆβ–„β–„β–Œ
  β–€β–€β–€β–€β–€β€’ β–€β–€ β–ˆβ–ͺ β–€β–€β–€β–€ β–€β–€β–€  β–€  β–€ Β·β–€  β–€ β–€β–€β–€

        (c) pwnesia.org β€” v0.0.1

Usage:
  [stdin] | dnstake [options]
  dnstake -t HOSTNAME [options]

Options:
  -t, --target <HOST/FILE>    Define single target host/list to check
  -c, --concurrent <i>        Set the concurrency level (default: 25)
  -s, --silent                Suppress errors and/or clean output
  -o, --output <FILE>         Save vulnerable hosts to FILE
  -h, --help                  Display its help

Examples:
  dnstake -t (sub.)domain.tld
  dnstake -t hosts.txt
  dnstake -t hosts.txt -o ./dnstake.out
  cat hosts.txt | dnstake
  subfinder -silent -d domain.tld | dnstake

Workflow

DNSTake use RetryableDNS client library to send DNS queries. Initial engagement using Google & Cloudflare DNS as the resolver, then check & fingerprinting the nameservers of target host β€” if there is one, it will resolving the target host again with its nameserver IPs as resolver, if it gets weird DNS status response (other than NOERROR/NXDOMAIN), then it's vulnerable to be taken over. More or less like this in form of a diagram.

Currently supported DNS providers, see here.

References

License

DNSTake is distributed under MIT. See LICENSE.