Skip to main content

Subdomain Takeover Tools

Latest Package version Build status Supported versions

A set of tools to validate the initial outcome of subtake.

Installation

  1. Install using pip:

    pip install subdomain_takeover_tools

    for windows:

    py -m pip install subdomain_takeover_tools

    Alternatively, you can download or clone this repo and call pip install -e ..

Confirming takeovers

All scripts support the following two parameters:

  • --strict: only report as vulnerable if the issue is not also applicable on hostname.tld and www.hostname.tld.
  • --inverse: do inverse reporting, so report all subdomains that are not vulnerable

Supported input formats

In addition to plain hostnames, the scripts accept the output of two scanners and auto-detect which one is used per line:

  • subtake: [service: target]<tab><tab>domain
  • nuclei takeover templates: [template-id] [protocol] [severity] url ["extracted-cname"]

For the unified confirm_takeover dispatcher, nuclei template ids such as github-takeover and aws-bucket-takeover are mapped to the matching service validator automatically. Findings for services without a validator are considered unsupported and dropped by default. The dispatcher accepts two extra parameters:

  • --full: output the full input line instead of just the domain.
  • --include-unsupported: also emit unsupported findings (services with no validator), so a single pass over nuclei output keeps both confirmed-vulnerable and not-yet-disproven findings.

Some scripts require a config file to be present, the location is .subdomain_takeover_tools.ini, an example of the file can be found below:

[azure]
subscription_id=44713cf2-8656-11ec-a8a3-0242ac120002
[github]
username=martinvw
access_token=44713cf2-8656-11ec-a8a3-0242ac120002
repo=44713cf2-8656-11ec-a8a3-0242ac120002
[fastly]
api_token=44713cf2-8656-11ec-a8a3-0242ac120002
service=44713cf2-8656-11ec-a8a3-0242ac120002
version=3

Confirming S3

Subtake has some false positives on Google Cloud buckets as S3 buckets, also some access denied's end up in the results.

The script confirm-s3.py will make sure that the bucket is actually vulnerable.

grep "\[s3 bucket: " subtake-output.txt | confirm_s3

Confirming ELB

Some patterns of elb are vulnerable while others are not, to filter them we can use our script:

grep "\[elasticbeanstalk: " subtake-output.txt | confirm_elb

Note: the parameter --strict is accepted here but will not lead to expected results.

Please note that some regions are not enabled by default, when you receive the following error:

botocore.exceptions.ClientError: An error occurred (InvalidClientTokenId) when calling the CheckDNSAvailability operation: The security token included in the request is invalid.

This could mean you have not yet enabled these, opt-in, regions, see https://console.aws.amazon.com/billing/home?#/account

Confirming Shopify

It seems that all current shopify examples are vulnerable, the following check just validates the DNS.

grep "\[shopify: " subtake-output.txt | confirm_shopify

Filtering Pantheon

Please note that for pantheon this repo currently only provides an initial check to eliminate some FALSE positives.

grep "\[pantheon: " subtake-output.txt | confirm_pantheon

Filtering Cargo Collective

Please note that for Cargo Collective this repo currently only provides an initial check to eliminate some FALSE positives.

grep "\[cargo: " subtake-output.txt | confirm_cargo

HTTP-fingerprint validators

The following services are validated by fetching the candidate host over HTTP(S) and looking for the provider's "domain not connected / unclaimed" error page. They need no config or credentials, and they short-circuit (return not-vulnerable) for the provider's own hostnames, which filters the bulk of self-referential false positives:

Command Service Fingerprint
confirm_framer Framer Site Not Found | Framer
confirm_leadpages Leadpages "This page couldn't be found…"
confirm_meteor Meteor / Galaxy "No applications registered for host"
confirm_surveysparrow SurveySparrow "Account not found."
confirm_greatpages GreatPages "Página não encontrada (Erro 404)"
confirm_wix Wix "Error ConnectYourDomain occurred"
confirm_mashery Mashery "Unrecognized domain"
grep "\[framer: " subtake-output.txt | confirm_framer

These are also wired into the unified confirm_takeover dispatcher via their nuclei template ids (framer-takeover, leadpages-takeover, meteor-takeover, surveysparrow-takeover, greatpages-takeover, wix-takeover, mashery-takeover).

Separate tools

Extracting domain names

As part of my process I want to know the domains involved in my findings.

Example usage:

cut -f3 < subtake-output.txt | extract_domain_names | sort -u > involved.domains

Note that extract_domain_names also support groups, such as domain.(co.id|in.th|ph|vn), this will be expanded automatically.

Resolving from the authoritative DNS authority

For validation of the results I want to validate whether the DNS record is still accurate.

To do this we fetch the authoritative result's step by step from the authoritative DNS servers.

authoritative_resolve "github.com" "martinvw.nl"

Exporting and enriching

The subtake_enrich_and_export will split the existing output and add some additional columms:

  • has a wildcard
  • domain name
  • tld
  • still vulnerable
  • authoritative results
subtake_enrich_and_export < subtakee-output.txt

Release files for subdomain-takeover-tools 0.57.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for subdomain-takeover-tools 0.57.0
File Size Uploaded
subdomain_takeover_tools-0.57.0.tar.gz 24.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for subdomain-takeover-tools 0.57.0
File Interpreter ABI Platform
subdomain_takeover_tools-0.57.0-py3-none-any.whl Python 3 none any Details

Total release size:61.0 kB

Release files / subdomain_takeover_tools-0.57.0.tar.gz

Download URL subdomain_takeover_tools-0.57.0.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
189259e77efd1537ee53ed4c2b37a6208f47a85f72c309a4329d09c6dc3335f7
BLAKE2b-256 checksum
How to use checksums
2a02b813d7e7b85a9245c5ef8cfd84dbfb2afddd6323b0a9ac62a19ff1748fd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release files / subdomain_takeover_tools-0.57.0-py3-none-any.whl

Download URL subdomain_takeover_tools-0.57.0-py3-none-any.whl
Size 36.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4bfe257cbd3709315a81d742bed2e6329cb0c72e6685a7b8ab39558143676922
BLAKE2b-256 checksum
How to use checksums
27612e551e9c120412fa1704f1ba2d13101c9925016b29694d0cd1b15a50afbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.57.0 This release

2 release files

0.56.0

2 release files

0.54.0

2 release files

0.53.0

2 release files

0.52.0

2 release files

0.51.0

2 release files

0.50.0

2 release files

0.47.0

2 release files

0.46.0

2 release files

0.45.0

2 release files

0.44.0

2 release files

0.43.0

2 release files

0.42.0

2 release files

0.41.0

2 release files

0.39.0

2 release files

0.38.0

2 release files

0.37.0

2 release files

0.36.0

2 release files

0.32.0

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.28.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page