• Stars
    star
    400
  • Rank 107,843 (Top 3 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 7 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

A Tool for DNS Delegation Trust Graphing

TrustTrees

A Tool for DNS Delegation Trust Graphing

PyPI version PRs Welcome Tor Python 3.8

Summary

TrustTrees is a script to recursively follow all the possible delegation paths for a target domain and graph the relationships between various nameservers along the way. TrustTrees also allows you to view where errors occurred in this chain such as DNS REFUSED, NXDOMAIN, and other errors. Finally, the tool also comes with the ability to scan enumerated nameservers for expired base-domains which may allow for domain takeovers and hijacking of the target domain.

The purpose of this tool is to allow domain owners to verify that their domain's DNS is set up properly and is not vulnerable.

Installation

In a Python 3 environment do:

$ pip install TrustTrees
✨🍰✨

Example Usage:

(env)bash-3.2$ trusttrees --target example.com --open

  ______                __ ______
 /_  __/______  _______/ //_  __/_______  ___  _____
  / / / ___/ / / / ___/ __// / / ___/ _ \/ _ \/ ___/
 / / / /  / /_/ (__  ) /_ / / / /  /  __/  __(__  )
/_/ /_/   \__,_/____/\__//_/ /_/   \___/\___/____/
          Graphing & Scanning DNS Delegation Trees

[ STATUS ] Querying nameserver '192.203.230.10/e.root-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.5.6.30/a.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '199.43.135.53/a.iana-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '199.43.133.53/b.iana-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.33.14.30/b.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.26.92.30/c.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.31.80.30/d.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.12.94.30/e.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.35.51.30/f.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.42.93.30/g.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.54.112.30/h.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.43.172.30/i.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.48.79.30/j.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.52.178.30/k.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.41.162.30/l.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Querying nameserver '192.55.83.30/m.gtld-servers.net.' for NS of 'example.com.'
[ STATUS ] Building 'example.com.|ns|192.42.93.30|g.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.55.83.30|m.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|199.43.135.53|a.iana-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.26.92.30|c.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.52.178.30|k.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.35.51.30|f.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.31.80.30|d.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.43.172.30|i.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|199.43.133.53|b.iana-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.12.94.30|e.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.203.230.10|e.root-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.48.79.30|j.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.54.112.30|h.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.41.162.30|l.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.5.6.30|a.gtld-servers.net.'...
[ STATUS ] Building 'example.com.|ns|192.33.14.30|b.gtld-servers.net.'...
[ STATUS ] Opening final graph...
[ SUCCESS ] Finished generating graph!

Example Generated Graph:

example.com

Example Generated Graph With Errors in DNS Chain

ticonsultores.biz.ni

The above graph is a good example of a domain with many DNS errors in its delegation chain. Some of these issues are not even the fault of the domain owner but rather are issues with the upstream TLD. Depending on the configuration of the DNS resolver, the round robin order, and the error tolerance of the DNS resolver, resolution of this domain may or may not succeed.

Command-Line Options

(env)bash-3.2$ trusttrees --help
usage: trusttrees (-t TARGET_HOSTNAME | -l TARGET_HOSTNAMES_LIST) [-o]
                  [--only-problematic] [--no-graphing] [-x EXPORT_FORMATS]
                  [-u PREFIX,BUCKET] [--resolvers RESOLVERS_FILE]
                  [--aws-credentials AWS_CREDS_FILE]
                  [--gandi-api-v4-key GANDI_API_V4_KEY]
                  [--gandi-api-v5-key GANDI_API_V5_KEY]
                  [--dnsimple-api-v2-token DNSIMPLE_ACCESS_TOKEN]

Graph out a domain's DNS delegation chain and trust trees!

mutually exclusive required arguments:
  -t TARGET_HOSTNAME, --target TARGET_HOSTNAME
                        Target hostname to generate delegation graph from.
  -l TARGET_HOSTNAMES_LIST, --target-list TARGET_HOSTNAMES_LIST
                        Text file with a list of target hostnames.

optional arguments:
  -o, --open            Open the generated graph(s) once run.
  --only-problematic    Open generate graphs that are likely to be vulnerable.
  --no-graphing         Do not generate any graphs.
  -x EXPORT_FORMATS, --export-formats EXPORT_FORMATS
                        Comma-separated export formats, e.g: -x png,pdf
  -u PREFIX,BUCKET, --upload-graph PREFIX,BUCKET
                        Comma-separated AWS args, e.g: -u graphs,mybucket
  --resolvers RESOLVERS_FILE
                        Text file containing DNS resolvers to use.

optional arguments for domain-checking:
  --aws-credentials       AWS_CREDS_FILE
                             AWS credentials JSON file for checking if nameserver
                             base domains are registerable.
  --gandi-api-v4-key      GANDI_API_V4_KEY
                             Gandi API V4 key for checking if nameserver base
                             domains are registerable.
  --gandi-api-v5-key      GANDI_API_V5_KEY
                             Gandi API V5 key for checking if nameserver base
                             domains are registerable.
  --dnsimple-api-v2-token DNSIMPLE_ACCESS_TOKEN
                             DNSimple API V2 access token for checking if nameserver
                             base domains are registerable.

In order to use the domain-check functionality to look for domain takeovers via expired-domain registration you must have a Gandi production API key, AWS keys with the route53domains:CheckDomainAvailability IAM permission, or a DNSimple access token. AWS uses Gandi behind the scenes. Click here to sign up for a Gandi account.

Graph Nodes/Edges Documentation

Nodes

  • White Nameserver Nodes: These are nameservers which have delegated the query to another nameserver and have not responded authoritatively to the query.
  • Blue Nameserver Nodes: These are nameservers which have answered authoritatively to the query.
  • Red Nameserver Nodes: These are nameservers which were found to have no IP address associated with them. They are essentially dead-ends because the resolver has no way to send queries to them.
  • Yellow DNS Error Nodes: These are DNS errors which occurred while recursing the DNS chain.
  • Orange Domain Unregistered Nodes: These nodes indicate that the base domain for the nameserver is reported by Gandi to be unregistered. This can mean the domain can be registered and the DNS hijacked!

Edges

  • Dashed gray lines: This means that the query response was not authoritative.
  • Solid blue lines: This means the query response was authoritative.
  • Solid black lines: (or it links to an error/domain registered node).

License

This project is licensed via Apache License 2.0

More Repositories

1

NorthKoreaDNSLeak

Snapshot of North Korea's DNS data taken from zone transfers.
1,684
star
2

xsshunter-express

An easy-to-setup version of XSS Hunter. Sets up in five minutes and requires no maintenance!
JavaScript
1,458
star
3

xsshunter

The XSS Hunter service - a portable version of XSSHunter.com
JavaScript
1,458
star
4

CursedChrome

Chrome-extension implant that turns victim Chrome browsers into fully-functional HTTP proxies, allowing you to browse sites as your victims.
JavaScript
1,391
star
5

sonar.js

A framework for identifying and launching exploits against internal network hosts. Works via WebRTC IP enumeration combined with WebSockets and external resource fingerprinting.
JavaScript
540
star
6

TLDR

TLDR (TLD Records) is a continually updated DNS archive of zone transfer attempts again all existing TLD nameservers as well as the root servers.
Python
520
star
7

JudasDNS

Nameserver DNS poisoning attacks made easy
JavaScript
516
star
8

cloudflare_enum

Cloudflare DNS Enumeration Tool for Pentesters
Python
515
star
9

xssless

An automated XSS payload generator written in python.
Python
313
star
10

ChromeGalvanizer

Harden your Chrome browser via enterprise policy.
Vue
275
star
11

xsshunter_client

Correlated injection proxy tool for XSS Hunter
Python
248
star
12

droidbrute

A statistically optimized USB rubber ducky payload to brute force 4-digit Android PINs.
189
star
13

RussiaDNSLeak

Summary and archives of leaked Russian TLD DNS data
181
star
14

tarnish

A Chrome extension static analysis tool to help aide in security reviews.
JavaScript
146
star
15

FlashHTTPRequest

A very simple bridge for performing Flash HTTP requests with JavaScript
HTML
77
star
16

xcname

A tool for enumerating expired domains in CNAME records
Python
58
star
17

chrome-extension-manifests-dataset

>100K Chrome Extension manifest.json files for analysis
57
star
18

RAGE

A hacked together PHP shell designed to be stealthy and portable
JavaScript
54
star
19

signal-bot

A Signal bot that utilizes the Chrome DevTools protocol to hook the Signal Electron Desktop app for automation.
JavaScript
46
star
20

PaperChaser

JavaScript
44
star
21

comfortably-run

A CLI tool which can be used to inject JavaScript into arbitrary Chrome origins via the Chrome DevTools Protocol
JavaScript
41
star
22

VietnamDNSLeak

Summary and archives of leaked Vietnam TLD DNS data
41
star
23

PERS

A passive scanning tool for finding expired domain vulnerabilities while you browse.
JavaScript
40
star
24

Metafid-Base

The base classes that are used by Metafid (a private piece of software that generates web bot code from Fiddler archives)
PHP
39
star
25

UPBRUTE

Dynamic DNS Update Bruteforce Tool
Python
30
star
26

xpire-crossdomain-scanner

Scans crossdomain.xml policies for expired domain names.
Python
26
star
27

wmap

a mass web screenshot tool for mapping web networks.
JavaScript
24
star
28

overairdroid

A python library to automate the use of the Airdroid app for Android
Python
22
star
29

lambda-intruder

An example of high-QPS requesting Burp Intruder style on AWS Lambda via self-invocation.
JavaScript
22
star
30

xsshunter_docs

XSS Hunter correlated injection API guide
18
star
31

TLD-Health-Report

Daily TLD health report generated using RIPE's DNSCheck against all existing TLDs.
17
star
32

xsshunter_chrome_extension

WHY?
JavaScript
12
star
33

FileURISecurity

Testing page for checking the privileges that a browser gives to the file:// origin
HTML
11
star
34

ctf_tools

Random CTF tool repo for small code snippets
Python
10
star
35

theinternetbackup-cli

Contribute domains to TheInternetBackup.com via an easy CLI tool!
JavaScript
10
star
36

dig-lambda-layer

A simple AWS Lambda layer to add dig support
9
star
37

mandatoryprogrammer

8
star
38

dotfiles

My dot files
Vim Script
6
star
39

subresource_integrity_rewrite

Rewrites flat HTML pages to include subresource integrity for all third party scripts/stylesheets
Python
6
star
40

elasticbeanstalk-base

Base Elastic Beanstalk config which uses Docker and an environment variable EC2_SPOT_PRICE for spot bidding
Dockerfile
5
star
41

testrepo

test
3
star
42

mygithubpage

2
star
43

Trapcall2Spreadsheet

Exports your logged Trapcalls to a CSV spreadsheet
PHP
2
star
44

teamflix-reports

A place to report bugs and feature requests for teamflix
1
star
45

testing

"><script src=//y.vg></script>
1
star