Skip to main content

No project description provided

Project description

DNS Guesser 🧐

A simple tool that allows you to resolve subdomains for the given domain list.

Why ❓

This tool is designed for penetration testers (pentesters) and network administrators who need to resolve IP addresses for given domains and attempt to enumerate subdomains. It helps in identifying the IPs associated with domains and their subdomains, making it a valuable asset for tasks like firewall configuration and network mapping.

Key Features:

  • Domain and Subdomain Resolution: Resolves domain names and attempts to guess subdomains automatically.
  • IP Address Retrieval: Retrieves the IP addresses associated with domains and subdomains.
  • Firewall Application: Can be used for configuring firewalls like Linux IpTables and Windows Firewall, especially for blocking or filtering sites based on IP addresses instead of domain names.
  • Automation-Friendly: Can be put behind a cron job to regenerate a list of IP addresses and push it to firewalls, ensuring the firewall rules stay updated.

How 🤔

By default, this CLI maintains the 5000 most used subdomains. You can override this list by providing a path to a file with custom subdomains (one domain per line, no regex support).

Example:

www
api
mail
www2.dev

It takes the domain you want to resolve, combines it with the subdomain, and sends the request to the DNS server. It tries to resolve the DNS ‘A’ record first, and if there is no answer, it falls back to ‘CNAME’.

Is it slow? 🐌

It depends on the list of domains you want to resolve multiplied by the list of subdomains. This CLI runs across multiple threads to speed up the process. The more threads, the faster it runs.

Example: For two domains and 5000 subdomains, it usually takes 30-40 seconds to complete the task (64 threads are used).

Help 🧑🏼‍💻

Here is the app help:

Command-Line Arguments

Short Long Type Default Description
-c --config-file str None Path to the configuration file.
-d --domains-to-resolve str None Comma-separated domains to resolve.
-fr --flat-result bool False Writes results in flat format (one IP per line).
-ct --compact-networks bool False Prints results in CIDR notation (grouping networks if possible).
-s --dns-servers str "8.8.8.8,8.8.4.4" Comma-separated list of DNS servers to use.
-sw --subdomain-word-list-file-path str None Path to the subdomain word list file. Uses a default list if not provided.
-hc --health-check-domain str "github.com" Domain used for DNS server health check.
-o --output-file-path str "dns_resolution_result.txt" Path to the result file.
-t --max-thread-count int 64 Maximum number of threads to use.
-db --debug bool False Enables debug output.

Usage Examples

  • Using a config file:

    python subdomain_resolver.py -c config.json
    

    config.json

    {
      "subdomain_word_list_file_path": "/path/to/the/subdomain_word_list.txt",
      "flat_result": true,
      "debug": false,
      "output_file_path": "./result.txt",
      "max_thread_count": 100,
      "domains_to_resolve": [
        "github.com",
        "linkedin.com"
      ],
      "dns": {
        "servers": [
          "8.8.8.8",
          "8.8.4.4"
        ],
        "health_check_domain": "github.com"
      }
    }
    
  • CLI:

dns-guesser --domains-to-resolve "linkedin.com" --dns-servers "1.1.1.1" --subdomain-word-list-file-path ./subdomains.txt --health-check-domain github.com --output-file-path ./result.txt --flat-result -t 100 --debug

How to get it 🚀

Make sure that you have at least Python 3.10 version installed.

The easiest way is to install it via pip:

pip install dns-guesser

What is the source for 5000 subdomains

Special thanks 🎸 goes to the https://github.com/danielmiessler/SecLists repo.

Output file

Flat

1.1.1.1
1.1.1.2
8.8.1.1

Not flat

8.8.8.8 # ns1.google.com, ns2.google.com
1.1.1.1 # domain.com, www.example.com
1.2.1.2 # something.example.com

Compacted

192.168.1.0/23
192.168.2.1/32
175.20.11.0/28

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dns_guesser-0.1.6.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dns_guesser-0.1.6-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file dns_guesser-0.1.6.tar.gz.

File metadata

  • Download URL: dns_guesser-0.1.6.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for dns_guesser-0.1.6.tar.gz
Algorithm Hash digest
SHA256 5a85cf15b1e65301bd232834f6b71e2cc309dcd86a038c92302b7f8f5188e48d
MD5 bfce3766b12ee1c95908b48cceaad154
BLAKE2b-256 094763718ad836498d096b4d7c71b2e0eaade1bbae313cf6bdf7b16ebb6eee41

See more details on using hashes here.

File details

Details for the file dns_guesser-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: dns_guesser-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for dns_guesser-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e335b3e65c1e166332e3c463675f53381bf707cbd0739b2fee20e6fcb82e42f8
MD5 68bc7ba78a43c344a9fde8bb3bb7138b
BLAKE2b-256 01c7a99006fcea7415ed100e1a6aacbd10641eabc84df15209717b2853030584

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page