A lightweight Python utility to detect dns records that are suspected as dangling.
Project description
DDFR - Dangling Domains Finder
A lightweight Python utility to detect dns records that are suspected as dangling.
Description
Do you have a large cloud environment with many services and VMs? Then probably some of your domain names are pointing to unclaimed IP addresses due to improper deprecation of services/VMs.
DDFR to the rescue!
Basically, the tool gets a list of your DNS records and checks if the pointed IPs belongs to your cloud accounts.
Behind the scenes
-
You provide DDFR with a list of your DNS records (see Usage section).
-
You provide DDFR with a list of all your registered cloud IPs in one of the following ways:
- Allow DDFR to automatically collect all of your registered IPs from Palo Alto's Prisma Cloud product.
- Manually provide a file with your registered cloud IPs.
-
DDFR compares the lists to see if there are domains pointing to IPs not owned by you and therefore suspected as dangling.
NOTE: DDFR also provides you with a mechanism to reduce false positives, read more about it below.
-
DDFR generates a report of the suspected DNS records.
Installation
Prerequisites
- [Optional] To pull records from Prisma Cloud, fill in the required environment variables:
export PRISMA_API_KEYID = your-value-here
export PRISMA_API_SECRET = your-value-here
export PRISMA_URL = your-value-here
PIP (recommended)
pip install ddfr
Manual
git clone https://github.com/playtika/DDFR.git
cd DDFR
pip install .
Recommended Python Version
DDFR was developed and tested only with Python3.
Usage
Short Form | Long Form | Description |
---|---|---|
-d | --domains | Full path to a file contains your DNS records |
-i | --ips | Full path to a file contains your owned ips (if non-existent will pull from prisma) |
-cn | --ssl-common-names | Full path to a file contains key words that should appear in your CNs (for reducing false positives) |
-r | --ranges | Full path to a file contains AWS ip ranges |
-o | --output | Full path to output directory |
Domains file needs to be in the following format (JSON):
[{"name": "domain name", "record_type": "DNS type (CNAME,A)", "record_value": "(ip,ec2 domain name)", "source": "dns management system/provider"}]
Usage Examples
- Pull ips form prisma
ddfr -d "domains.json" -r "aws-ranges.txt" -cn "common-names.txt"
- Receive ips from a file
ddfr -d "domains.json" -r "aws-ranges.txt" -cn "common-names.txt" -i "my-ips.txt"
The Motivation for Creating DDFR
Subdomains takeovers have become a popular technique used by attackers and bug bounty hunters.
DNS records that points to unclaimed IP addresses is a specific use case of this attack that is pretty hard to catch (for both blue and red teams).
As a red-teamer, this kind of takeovers are hard to find as they require many resources to perform a successful attack (bruteforcing VMs IP addresses attached by the cloud providers) and reverse DNS lookup.
As a blue-teamer, companies nowadays have thousands of DNS records which makes it extremely hard to find manually.
By being able to pull your company's DNS records from your DNS management system be it AWS Route53 or any other, you can proactively look for those dangling records with this tool and mitigate these takeovers.
Roadmap
- Automate AWS ranges fetching
- Support for more cloud providers
Contributing
Feel free to fork the repository and submit pull-requests.
License
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 ddfr-0.9.2.tar.gz
.
File metadata
- Download URL: ddfr-0.9.2.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d806a7c97fe1e483083eeb23138aa8a6e6bd4c031ec4d3d4bc347482144ab80 |
|
MD5 | 05ba30757ceb0448e038e95a9e2636a4 |
|
BLAKE2b-256 | 105168d496d8d19076b7d59d36f1fcd457177d6e9ec236319a20c9b86bb29e2c |
Provenance
The following attestation bundles were made for ddfr-0.9.2.tar.gz
:
Publisher:
publish-to-pypi.yml
on PlaytikaOSS/DDFR
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
ddfr-0.9.2.tar.gz
- Subject digest:
5d806a7c97fe1e483083eeb23138aa8a6e6bd4c031ec4d3d4bc347482144ab80
- Sigstore transparency entry: 150465541
- Sigstore integration time:
- Predicate type:
File details
Details for the file ddfr-0.9.2-py3-none-any.whl
.
File metadata
- Download URL: ddfr-0.9.2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 488b710e7a29e41adfad2b5084e64b69f7f603e8cbaeb27cc370282c3f7b6295 |
|
MD5 | 60727568ced51663d1e8d5320411d8e1 |
|
BLAKE2b-256 | 44b88494e18af1785f2b390903e040071f6e5c93e2e0ccb0ac2da824d03fd38f |
Provenance
The following attestation bundles were made for ddfr-0.9.2-py3-none-any.whl
:
Publisher:
publish-to-pypi.yml
on PlaytikaOSS/DDFR
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
ddfr-0.9.2-py3-none-any.whl
- Subject digest:
488b710e7a29e41adfad2b5084e64b69f7f603e8cbaeb27cc370282c3f7b6295
- Sigstore transparency entry: 150465543
- Sigstore integration time:
- Predicate type: