2

There is this Web App which uses cloudflare and to bypass certain things I had to find a way to access the actual web server directly. I tried numerous things and finally I think I have found the actual server's IP but seems like direct access to IP is blocked as am greeted with this error.

Error 1003 Ray ID:
Direct IP access not allowed

What header (or referer's value? ) to supply with our original request so that the web server accepts my request as a request routed via cloudflare's reverse proxy?

In other words, I want the actual server to believe am coming via cloudflare. I believe to do that we have to supply specific header or a specific referer's value but I can't figure out what to supply in actual request. Any help would he appreciated.

Thanks.

John
  • 21
  • 2
  • While no one can tell you for sure how they are blocking external traffic, normally it is done by blocking connections from any IP address **except** cloudflare. Given the error message, it seems very likely that they are doing that here, in which case there is nothing you can do unless you somehow manage to get your traffic to originate from cloudflare (which is effectively impossible). Regardless, this question is off topic for this site, so it will likely be closed soon. – Conor Mancone Jan 02 '20 at 13:57
  • 1
    @ConorMancone: while blocking connections from IP address except CloudFlare is possible, it's not recommended by CloudFlare. The recommended way to restrict so only CloudFlare can access your origin server, is called [Authenticated Origin Pull](https://support.cloudflare.com/hc/en-us/articles/204899617-Authenticated-Origin-Pulls) in their docs, essentially you setup your server to authenticate CloudFlare requests with TLS client certificate. – Lie Ryan Jan 02 '20 at 23:56

1 Answers1

2

You haven't found the IP address of your target server: you have just one of the numerous IP addresses used by Cloudflare servers.

As Cloudflare assigns the same IP address to multiple sites, you need to tell which site you're trying to reach, there is this text in the error page:

A valid Host header must be supplied to reach the desired website.

This IP address won't be useful to you, unfortunately.


To answer the original question: when you'll find the real webserver, if it only responds to Cloudflare servers, you might be out of luck, since the server might be configured to respond to Cloudflare IP addresses.

I would still have a look at Cloudflare Workers, since it might allow you to perform HTTP requests as if you were a Cloudflare server, but I haven't tried it some there might be some limitations that prevents you to do that.

Benoit Esnard
  • 13,942
  • 7
  • 65
  • 65
  • I hadn't heard of cloudflare workers before, interesting. It wouldn't surprise me if cloudflare has them setup in a different IP address space to avoid exactly what you are suggesting (but I've obviously never tried). Also, just curious: is there any particular reason why you think that they *haven't* reached the actual server (other than the fact that they intentionally hide it) – Conor Mancone Jan 02 '20 at 14:00
  • @ConorMancone: because "Ray ID" in an error context is a very big hint that Cloudflare returned that response. Moreover, accessing the Cloudflare IPs assigned to medium.com (found in a DNS query) gave me exactly the same error: http://104.16.120.127/ , so my guess is that the asker haven't found the origin server yet (and it can sometimes be really hard to find it). – Benoit Esnard Jan 02 '20 at 14:05
  • Makes perfect sense. Not that I doubted you, but I also googled that error message and it is clearly a Cloudflare specific error message. – Conor Mancone Jan 02 '20 at 14:12