Network Tools

CloudFrunt – Identify Misconfigured CloudFront Domains

CloudFrunt is a tool for identifying misconfigured CloudFront domains.

CloudFront is a Content Delivery Network (CDN) provided by Amazon Web Services (AWS). CloudFront users create “distributions” that serve content from specific sources (an S3 bucket, for example).

Each CloudFront distribution has a unique endpoint for users to point their DNS records to (ex. All of the domains using a specific distribution need to be listed in the “Alternate Domain Names (CNAMEs)” field in the options for that distribution.

When a CloudFront endpoint receives a request, it does NOT automatically serve content from the corresponding distribution. Instead, CloudFront uses the HOST header of the request to determine which distribution to use. This means two things:

If the HOST header does not match an entry in the “Alternate Domain Names (CNAMEs)” field of the intended distribution, the request will fail.
Any other distribution that contains the specific domain in the HOST header will receive the request and respond to it normally.

This is what allows the domains to be hijacked. There are many cases where a CloudFront user fails to list all the necessary domains that might be received in the HOST header. For example:

The domain “” is a CNAME record that points to “”.
The “” domain is set up to use a CloudFront distribution.
Because “” was not added to the “Alternate Domain Names (CNAMEs)” field for the distribution, requests to “” will fail.
Another user can create a CloudFront distribution and add “” to the “Alternate Domain Names (CNAMEs)” field to hijack the domain.

This means that the unique endpoint that CloudFront binds to a single distribution is effectively meaningless. A request to one specific CloudFront subdomain is not limited to the distribution it is associated with.


$ pip install boto3
$ pip install netaddr
$ pip install dnspython
$ git clone
$ cd cloudfrunt
$ git clone

CloudFrunt expects the dnsrecon script to be cloned into a subdirectory called dnsrecon.

Usage [-h] [-l TARGET_FILE] [-d DOMAINS] [-o ORIGIN] [-i ORIGIN_ID] [-s] [-N]

-h, –help Show this message and exit
-s, –save Save the results to results.txt
-N, –no-dns Do not use dnsrecon to expand scope
-l, –target-file TARGET_FILE File containing a list of domains (one per line)
-d, –domains DOMAINS Comma-separated list of domains to scan
-o, –origin ORIGIN Add vulnerable domains to new distributions with this origin
-i, –origin-id ORIGIN_ID The origin ID to use with new distributions


$ python -o -i S3-cloudfrunt -l list.txt

CloudFrunt v1.0.3

[+] Enumerating DNS entries for
[-] No issues found for

[+] Enumerating DNS entries for
[+] Found CloudFront domain –>
[+] Found CloudFront domain –>
[-] Potentially misconfigured CloudFront domains:
[#] –>
[+] Created new CloudFront distribution EXBC12DE3F45G
[+] Added to CloudFront distribution EXBC12DE3F45G

Download CloudFrunt

About the author

Mazen Elzanaty

Add Comment

Click here to post a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: