Pentest List Wiki
  • What is Pentest List Wiki?
  • OFFENSIVE SECURITY
    • External Infrastructure
      • Discovery
        • Email Address Discovery
        • Subdomain Discovery
        • Data Discovery
        • Port & Service Discovery
      • Exploitation
        • Password Spraying
        • Vulnerability Scanning
    • Internal Infrastructure
      • General Discovery
        • AD Attack Path Discovery
        • Port & Service Discovery
      • Credential Discovery
        • Passwords and NetNTLM
        • SAM & LSA secrets
        • NTDS.dit secrets
        • LSASS secrets
        • DCSync
        • DPAPI secrets
      • Movement
        • Credential Spraying
        • SMB Relaying
        • Pass The Hash
      • Infiltration/Exfiltration
        • Pivoting (Proxying)
    • Web Application
      • Discovery
        • Testing API Keys
        • Vulnerability Scan
        • Web Content Discovery
        • Parameter Discovery
        • VHOST Discovery
        • CMS Scanners
      • Exploitation
        • Authentication
          • Email Address Forms
          • AWS Cognito
        • JSON Web Tokens
        • Injection Attacks
          • SQL Injection
          • Cross-Site Scripting
          • HTTP Headers
      • Bypasses
        • Cloudflare Bypass
        • HTTP 403 Bypass
    • Mobile (iOS/Android)
      • iOS
        • IPA Decryption
        • Filesystem Analysis
        • Static Analysis
    • Cloud
      • AWS
        • Vulnerability Scanners
        • S3 Buckets
      • Azure
        • Vulnerability Scanners
        • m365 & Entra ID
  • DEFENSIVE SECURITY
    • Forged Kerberos Tickets
    • Logon Event Visualisation
Powered by GitBook
On this page
  • Context
  • How to Bypass Cloudflare
  1. OFFENSIVE SECURITY
  2. Web Application
  3. Bypasses

Cloudflare Bypass

How to bypass Cloudflare.

PreviousBypassesNextHTTP 403 Bypass

Last updated 12 months ago

Context

You may be in a situation where you come across a web resource protected by Cloudflare and you need to bypass it. Cloudflare is configured by giving control of the DNS records for a web resource, which then forces any traffic destined for the web resource to be firstly routed through Cloudflare before hitting the final destination servers. This enables the Cloudflare Web Application Firewall.

How to Bypass Cloudflare

As Cloudflare protects the web resource by presenting its own content delivery network, the only method to bypass Cloudflare is by finding the web resources real IP Address. Once the real IP address is known, it is possible to access the web server directly and avoid Cloudflare altogether.

To following ways may lead to finding the real IP address:

Browsing the configured DNS records

Just because Cloudflare takes control of the DNS records does not mean that a web resource has been configured correctly or has even been enabled. Using a website such as mxtoolbox which presents a web resources DNS records can allow you to view any IP Addresses that may be set and could be non-Cloudflare. Special attention should be made to records such as MX (mail), as often these are forgotten about or not enabled with Cloudflare and so, present a real IP Address.

Using a historical IP Address checker

Websites exists that track historical web data. As part of this data, they may keep logs of previous IP addresses that have been used by a web resource before Cloudflare was introduced. Once the real IP address is known, Cloudflare is bypassed. The following websites track historical IP addresses:

Subdomain Bruteforce

Looking for subdomains may lead to finding unprotected web resources. For example, if the protected website you are viewing is https://example.com, it may be that https://development.example.com is not protected by Cloudflare but still uses the same server and therefore, the same IP address.

There are a variety of tools that can help look for subdomains, we recommend bbot:

bbot -t evilcorp.com -f subdomain-enum | tee output.txt

Using Web Functionality

Using the protected web application to send data back to yourself is a strong method to find it's real IP address. If you can have the web application send you a password reset email or a "thanks for contacting us" from the contact us form, you have a chance to look at the received email headers and viewing an potentially unprotected IP address. Any area of a web application that is able to call out to yourself in someway, such as a server you can monitor the connections for, is a potential bypass.

CloudFlare Scanner

An easy way to conduct most of the above, is use a tool to automate it:

python3 cloakquest3r.py <URL>

https://mxtoolbox.com/DNSLookup.aspx
securitytrails.com
sitereport.netcraft.com
https://viewdns.info
https://github.com/blacklanternsecurity/bbot
https://github.com/spyboy-productions/CloakQuest3r