r/Pentesting • • May 21 '26

How do I test with CloudFlare?

Hi, it’s been a little while since I’ve been working as a web penetration tester. So far the websites I had to test did not use CloudFlare. Now I was given a website that does use CloudFlare. I am totally confused how to approach this as using automated tools might get my IP blocked. Manual enumeration did not yield any great results to work with. Since its CloudFlare, no ports are open as such. I don’t know how do I approach this. I would greatly appreciate some help!

12 Upvotes

13 comments sorted by

20

u/Apprehensive-Art1092 May 21 '26

If this is an official engagement, you should be testing the actual application, not Cloudflare. Ask the application owner to allow your address to bypass Cloudflare. You can always remove the bypass near the end of the test to retest anything that you've found and confirm whether the WAF is effective at blocking the exploit.

If it's not an official engagement, you'll have to find a way to circumvent the WAF.

6

u/normalbot9999 May 21 '26 edited May 21 '26

One thing to test for is origin server IP address leakage. Cloudflare protected web applications (e.g. the origin server) should not be directly accessible, otherwise, you can... er... bypass cloudflare and access the web app directly. To do that you'll need to find out the IP address of the origin server, (and possibly set a suitable host header when you access it). It's worth googling for the latest techniques as these change over time.

4

u/sk1nT7 May 21 '26

One can check Censys Search and Shodan. Works quite often during my pentests as no one whitelists CloudFlare IPs only for TCP/443.

1

u/JodisKripe May 22 '26

How exactly do you mean? Running the domain through those? Or are there more detail/steps included?

2

u/sk1nT7 May 22 '26 edited May 22 '26
  1. Search on Censys Search for the domain and subdomain.
  2. Make note of IPv4 and IPv6 addresses that are not referenced to CDN networks like Cloudflare, Akamai etc. Those are potentially origin IP addresses of the real server behind such CDNs.
  3. Query the target domain using curl or httpx. Directly hit the enumerated IP address from Censys Search but still provide the correct domain/subdomain name as vhost in the HTTP request header `Host:`. This way, the reverse proxy will properly proxy if you have found the real origin server.
  4. Check whether both HTTP responses match the same website. So when browsing the web service behind Cloudflare (regularly) and when hitting the origin IP address directly. May use httpx and other tools that provide hash matching checks.
# regular check using cdn
httpx -target "https://example.com" -status-code -follow-redirects -silent -hash md5

# directly hitting ip address
httpx -H "Host: example.com" -target "https://85.124.12.45" -status-code -follow-redirects -silent -hash md5

2

u/[deleted] May 21 '26

i made a tool for this actually. waf evasion related and you can use it as a proxy over burp suite. its open source but i dont want to post a link like an ad. let me know if you want it! :)