← Back to context

Comment by bubblethink

8 years ago

How do you check if a website uses cloudflare ? Any scripts that do that ?

Response headers will contain a "cf-ray" header or "server: cloudflare-nginx"

  • Both should be there, as well as 'Set-Cookie: __cfduid=...'

      $ curl -I okcupid.com
      Set-Cookie: __cfduid=...
      Server: cloudflare-nginx
      CF-RAY: 335f033b77742b76-AMS
    

    EDIT: Better yet, make that 'curl -IL domain.com' to follow redirects because it may not show in the first response.

There is no reliable way to check. The problem is that even if you verify that a site isn't using CloudFlare now, that doesn't mean that they didn't use it in the past (and you'd still be affected).

In other words: Just assume that everything has been compromised. With how much of the web CloudFlare controls nowadays, you're not going to be far off anyway.

$ host -t NS digitalocean.com

digitalocean.com name server walt.ns.cloudflare.com.

digitalocean.com name server kim.ns.cloudflare.com.

  • That may not necessarily work. Example:

      $ host -t NS okcupid.com
      okcupid.com name server nameserver2.okcupid.com.
      okcupid.com name server nameserver1.okcupid.com.
    

    But if you check the response headers you'll see 'CF-RAY:...' and 'Server: cloudflare-nginx'

$ dig example.com

to get the A Record, then

$ whois 1.2.3.4|grep Cloudflare

Not 100% reliable, but should do the Job.