Some helper subdomain_takeover_tools to validate subdomain takeovers
Project description
Subdomain Takeover Tools
A set of tools to validate the initial outcome of subtake.
Installation
-
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 onhostname.tld
andwww.hostname.tld
.--inverse
: do inverse reporting, so report all subdomains that are not vulnerable
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
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file subdomain_takeover_tools-0.41.0.tar.gz
.
File metadata
- Download URL: subdomain_takeover_tools-0.41.0.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c556ca4eaefb452c943ec53304ea97877ac4630e9d6e10693518ab316c61490 |
|
MD5 | b261837ae669ad0669da95d25b273ae6 |
|
BLAKE2b-256 | c897d6204c23f2f80734a7517bc635c94c431e51d183ed76f5c4f851f3e89a68 |
File details
Details for the file subdomain_takeover_tools-0.41.0-py3-none-any.whl
.
File metadata
- Download URL: subdomain_takeover_tools-0.41.0-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0663782cd56a945606f8493ab7fcc51ebfbeb43c38338f42c15a84f7d6bc90b0 |
|
MD5 | ec7a3758187eb43aec46ae28ccf32f13 |
|
BLAKE2b-256 | b1b6efc67b8772e7d2228a275ce55b9a50da986cbd8c901b2fe7681ae0aeef82 |