Dangling DNS entries detection tool.

dnscheck

Introduction

dnscheck is a tool that reads a list of domains from a file and checks them for the following issues:

  • CNAMEs pointing to an unclaimed resource (e.g. S3 bucket, GitHub pages, Azure CloudApp, etc.)
  • CNAMEs pointing to an unregistered domain
  • Zone delegations poiting to an unclaimed zone

Detection of CNAMEs pointing to unclaimed resources is based on the information available in can-i-takeover-xyz.

Yet another DNS takeover tool?

Yes! Because:

  1. I wanted to understand these vulnerabilities better, and what's better for that than writing a tool to detect them?
  2. I couldn't find a tool that I liked enough and that would check both dangling CNAMEs and zone takeovers. (which doesn't mean such a tool doesn't exist!)

If you like this tool, use it (I'll be happy if you do), if you want to improve it, please open an issue, or even better, submit a PR, and if you don't like it, a list of alternatives is provided below.

Usage

Installation

From sources

Clone the repository and build the application:

git clone https://github.com/mdeous/dnscheck
cd dnscheck
make

You can then use the dnscheck binary that has been generated in the repository folder.

or

Install the application directly with Go:

go install https://github.com/mdeous/dnscheck

You should then have dnscheck available in your PATH (assuming you have a properly configured Go environment).

Pre-built binaries

TODO

Checking domains for vulnerabilities

The only mandatory argument is the -d/-domains one, which should be the path to a file containing the list of domains that should be checked. For the other optional options, please refer to the help below.

The -S option can greatly improve detection, as it attempts to connect to the CNAMEs targets using HTTPS instead of plain HTTP.

By default, the results are only displayed on stdout, if you want to save them to a file, you can use the -o option.

Help:

❯ dnscheck check -h
Check for vulnerable domains

Usage:
  dnscheck check [flags]

Flags:
  -d, --domains string      file containing domains to check
  -h, --help                help for check
  -n, --nameserver string   server and port to use for name resolution (default "8.8.8.8:53")
  -o, --output string       file to write findings to
  -S, --ssl                 use HTTPS when connecting to targets
  -w, --workers int         amount of concurrent workers (default 10)

Global Flags:
  -f, --fingerprints string   custom service fingerprints file
  -v, --verbose               increase application verbosity

TODO: add an example of output

Monitoring domains

TODO (not implemented yet)

Using custom service fingerprints

A custom fingerprints file can be passed to dnscheck by using the -f option.

TODO: document fingerprints format, for now, just refer to the current file in checks/services.json.

Alternatives

License

This project is licensed under the terms of the MIT License.

Similar Resources

Multicast DNS library for Go

Introduction This package allows Go processes to publish multicast DNS style records onto their local network segment. For more information about mDNS

Oct 23, 2022

Resolver (DNS) cache daemon.

Resolver (DNS) cache daemon.

RESCACHED(1) Manual Page NAME rescached - DNS resolver cache daemon. Table of Contents SYNOPSIS OPTIONS DESCRIPTION FEATURES BEHIND THE DNS HOW CACHE

Nov 17, 2022

CUP - Cloudflare (DNS) Updater Program

CUP The Cloudflare (DNS) Updater CUP is a tool to turn CloudFlare DNS into a Dynamic DNS service. Documentation Documentation can be found in the docs

Jun 6, 2022

🐶 Command-line DNS Client for Humans. Written in Golang

🐶 Command-line DNS Client for Humans. Written in Golang

doggo 🐶 Command-line DNS client for humans doggo is a modern command-line DNS client (like dig) written in Golang. It outputs information in a neat c

Dec 29, 2022

CoreDNS is a DNS server that chains plugins

CoreDNS is a DNS server that chains plugins

CoreDNS is a DNS server/forwarder, written in Go, that chains plugins. Each plugin performs a (DNS) function. CoreDNS is a Cloud Native Computing Foun

Jan 3, 2023

Fast and lightweight DNS proxy as ad-blocker for local network with many features

Blocky Blocky is a DNS proxy and ad-blocker for the local network written in Go with following features: Features Blocking - Blocking of DNS queries w

Jan 1, 2023

Are you forwarding DNS traffic to another server for some reason, but want to make sure only queries for certain names are passed? Say no more.

DNSFWD Redirect DNS traffic to an upstream. Get Latest: wget https://github.com/C-Sto/dnsfwd/releases/latest/download/dnsfwd_linux (replace linux with

Dec 16, 2022

Fast DNS implementation for Go

Fast DNS implementation for Go Features 0 Dependency Similar Interface with net/http Fast DoH Server Co-create with fasthttp Fast DNS Client with rich

Dec 27, 2022

DNS lookup using Go

DNS lookup using Go

DNS lookup using Go

Dec 30, 2022
A DNS client in Go that supports Google DNS over HTTPS

dingo A DNS client (stub resolver) implemented in Go for the Google DNS-over-HTTPS. It effectively encrypts all your DNS traffic. It also supports Ope

Nov 9, 2022
dnscrypt-proxy 2 - A flexible DNS proxy, with support for encrypted DNS protocols.
dnscrypt-proxy 2 - A flexible DNS proxy, with support for encrypted DNS protocols.

Overview A flexible DNS proxy, with support for modern encrypted DNS protocols such as DNSCrypt v2, DNS-over-HTTPS and Anonymized DNSCrypt. dnscrypt-p

Jan 3, 2023
A smol DNS server (<100 loc) that's configured with a static JSON file. Useful for split-dns.

A smol DNS server (<100 loc) that's configured with a static JSON file. Useful for split-dns.

Jul 27, 2022
Gotator is a tool to generate DNS wordlists through permutations.
Gotator is a tool to generate DNS wordlists through permutations.

Gotator is a tool to generate DNS wordlists through permutations.

Dec 28, 2022
DNSTake — A fast tool to check missing hosted DNS zones that can lead to subdomain takeover
DNSTake — A fast tool to check missing hosted DNS zones that can lead to subdomain takeover

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

Dec 28, 2022
A tool to solve DNS pollution of GitHub website. Query the real IP address of domain names such as github.com, and refresh the domain name setting of the system hosts file.

githubDNS Target A tool to solve DNS pollution of GitHub website. Query the real IP address of domain names such as github.com, and refresh the domain

Oct 14, 2021
DNS library in Go

Alternative (more granular) approach to a DNS library Less is more. Complete and usable DNS library. All Resource Records are supported, including the

Dec 26, 2022
DNS over HTTPS [mirror]

dnss dnss is a daemon for using DNS over HTTPS. It can act as a proxy, receiving DNS requests and resolving them using DNS-over-HTTPs (DoH). This can

Dec 26, 2022
DNS server with per-client targeted responses

GeoDNS servers This is the DNS server powering the NTP Pool system and other similar services. Questions or suggestions? For bug reports or feature re

Dec 15, 2022
GRONG is a DNS (Domain Name System) authoritative name server.It is more a research project than a production-ready program.

GRONG (Gross and ROugh Nameserver written in Go) is a DNS (Domain Name System) authoritative name server. It is intended as a research project and is

Oct 17, 2020