Crazy amount of guests

I'd like Google to be able to index, but want to be sure it's coming directly from Google and not a bot spoofing Google.
You can do that at cloudflare, and honestly, you're better of to get the easy stuff sorted at CF, DNS first line of defence and all, with a block to anything spoofing trying to be Google that is not.
 
This goes against the open, anonymous foundation of the internet, where many web services are expected to respond without any authentication first.
It does but it has become a matter of self defense, thanks to the AI bros.

Blindly taking a cookie reported by the client without validating it is a stupid shortcut from the days of trustworthiness in the good nature of the internet, not an effective control.
Absolutely. Sadly it is uncritically promoted as the best invention since sliced bread by a lot of those in this thread who use and promote Cloudflare. To be fair: While it is neither trustworthy nor safe it is probably better than nothing as long as the bots do not figure out how easy it is to fake and as long as there is no built in support from XF for a better solution (which won't happen, judging from the statements by @Chris D further up) or a 3rd party it is as good as you can get with a decoupled filter. This is one of the reasons why I like the approach of IP Threat Manager despite the obvious architectural downsides.
As long as the bots do not specifically target XF as a platform but scrape rather generically the probably won't bother to fake this cookie.
 
In the realm of nginx front-to-back configuration, the option of using the subrequest authentication (auth_request) does exist. However, I've not gone to the extent of implementing that... yet. Might be a good weekend project.
We actually use auth_request where we run Anubis to allow it to be dropped in and out as required. It does in that case of course mean the Anubis install isn't as optimised as it could be to the target site.
It would require some form of custom code between a WAF and the backend machine to efficiently communicate session legitimacy when it comes to cookie validation.
You could use a signed token instead, ie something like a JWT then a WAF layer can authenticate that without a round trip to the database/XF layer if it has the same secret. Beyond the csrf cookie however and user cookie there are no sessions to speak for 'new' connections (I thought?), the session cookie is only set once a user is logged in.

Th initial communication will always be "out of the blue" however unless you go for a members only approach (although even then you have to serve enough to allow them to perform the authentication). I do think some work on abnormal user analysis will probably be useful for the future since scraping is bound to move towards authenticated users in the future and assuming the registrations are done either via humans or decent AIs and via proxies I expect filtering out those users at registration will get progressively harder. I remember years back when admins on various sites we'd host would call to say they had hundreds of registrations they needed to go through, obviously these days we do try to automate and weed out the worst!

As long as the bots do not specifically target XF as a platform but scrape rather generically the probably won't bother to fake this cookie.
Quite, checking it is just a quick way of culling down the connections that need scrutiny. I think it would be nice/useful if it could be validated outside of XF (well and it could be the data is in the DB if you want it), but the cost of doing any of these validations has to be less than the cost of serving the request ultimately (although the bots grind my gears and it does almost become a matter of principle to stop them!). Signing the cookie data would seem like the obvious way of doing that then if you're using CF or something you could (not a big CF user so I may be wrong) use a CF worker or similar maybe to check the signature and make the check more robust than just a "present/absent".

Ultimately I don't see a way of blocking these cheaply other than looking for clues in the connection and as noted upthread the key for that is probably the tcp timing vs the tls timing (the former being to the proxy and the latter (most likely) being to the actor) and if they differ significantly you can be fairly sure the actor is behind a proxy. Indeed this seems to be the main mooted "solution" out there. There are a few nginx hacks to expose enough of the data to be useful, but I've not seen a clean off the shelf open source solution using this yet. Combine that with RBLs of those IPs and you might have some kind of solution (until the proxy providers and actors decide they are happy with the traffic being MITM'd by the proxy). However I expect there will be a good amount of fallout. There simply isn't that much data up front when a new connection is made. At present yes they tend to re-use user agents, but it'd be trivial to add some random noise in there and to shore that up. There are sometimes discrepancies in the TLS connection to identify non-browser clients, but again that's again down to sloppiness on their part, sometimes patterns in the scraping once more just lack of effort from them. All those clues can be cleaned up. So you're left with an HTTP request that looks 100% legitimate and the only "tell" you have is that you're getting a lot more of them than you'd expect.

Absolutely. Talking about how to fight bots in a forum that gets constantly scraped by 2-4.000 of exactly these bots to feed an AI seems not to be most clever idea.
Indeed.
 
I challenged Hetzner recently as so much dodgy stuff coming from there. Since doing that a new cf verified bot appeared. PoliasBot. Declares itself, described as a search engine. Couldn't find more about it, but Claude eventually found it was a search engine that sells its data to AI. It was behaving aggressively so added to robots.txt (which it says it respects in Cloudflare).

So one more for robots.txt if anyone is interested. It's very new apparently.
 
Combine that with RBLs of those IPs and you might have some kind of solution (until the proxy providers and actors decide they are happy with the traffic being MITM'd by the proxy)
I should have also noted that it wouldn't be a "good" solution because you have issues like CGNAT and even multiple home users behind the same IP. A compromised TV or phone doing proxying might take out an IP address being used by many legitimate users if combining such flags into RBLs (for speed).
 
I should have also noted that it wouldn't be a "good" solution because you have issues like CGNAT and even multiple home users behind the same IP.
I do sometimes have the occurence that multiple of my users are using the same IP at the same time b/c they are using public transport, randomly sitting in the same train and use the train's internet connection, not knowing of each other. :D
 
You could use a signed token
Hmmmm, there's an idea: at logon, user gets a cookie with the username, a timestamp, but also a digital signature taking the user and timestamp as seeds through a private key on server. Then a CF filter can check if the signature checks out based on the user and timestamp in the cookie and the public key stored in CF. No query to server needed, could let all validated forum members bypass all filtering rules.

Maybe implement a date-based choice of rotating private/public keys every month and you're set.
 
Hmmmm, there's an idea: at logon, user gets a cookie with the username, a timestamp, but also a digital signature taking the user and timestamp as seeds through a private key on server. Then a CF filter can check if the signature checks out based on the user and timestamp in the cookie and the public key stored in CF. No query to server needed, could let all validated forum members bypass all filtering rules.

Maybe implement a date-based choice of rotating private/public keys every month and you're set.
That'd be an interesting take actually. Definitely an avenue to consider/explore.
 
I'm seeing insane cloudflare breakthrough that forces me to turn UAM on to survive on another site i manage.
~300k unique IP addresses, all from cox communications, all on macos.
Proxycheck.io picks up an entire 5% of them.

It's like we're missing another layer of logic that looks at traffic as a while, and probably the reason is that cloudflare is based on SQL internally, which at such a large scale. Another layer missing is looking at global activity. They have enough data to connect the dots, but they don't use it.

Maybe the missing brain cells could be bolted on via API if you could at least read the right data.

Meanwhile we are having a good time with Anubis quite consistently and not seeing any serious residential proxy breakthrough, it's exceptional at mowing down bots. We are running a difficulty level of 3, of which the display of on first hit is brief. No complaints from users since installing it.
 
There's an increased flurry of talks speculating that, with AI's ability for huge mathematical breakthroughs (recently it proved the golden problem of mathematicians, the Riemann hypothesis, with a proof consisting of 250,000 pages that nobody understands yet but seems to be correct), there are non-negligible chances that it broke through the encryption algorithms that sustain the internet, and it's kept hush-hush because otherwise it would mean the complete lockdown of the internet and basically all modern systems integrations.

It sounds like a conspiracy theory alright, but being somewhat inadvertently with a foot through the door that shows what AI is capable of, my hair stands up on the back of my neck and I can't completely dismiss it as complete nonsense.
 
I also read this benchmark about how well different technologies can get through cloudflare and the article makes it look dismal.
https://dev.to/thomas77889900/bench...loudflare-10000-requests-empirical-study-1nmp
That is actually interesting b/c it shows that using latency as a criterium for identifying bad boys may indeed be possible:

1795939214285.webp

The other somewhat bizarre thing is that this guy is absolutely not willing to accept that site owners clearly do not want him to scrape their data. By taking efforts to circumvent the barriers he will possibly sooner or later cross the border to what is officially something in the area of "cyber crime" - which would actually be a good thing.
 
this guy is absolutely not willing to accept that site owners clearly do not want him to scrape their data
It's time for the reminder that free, unlimited, unrestricted, anonymous access to copyrighted data for other purposes than the license allowing humans to read it with their own eyes is not a right, but a privilege, and whenever that privilege starts getting abused, it will be withdrawn.
 
Another layer missing is looking at global activity. They have enough data to connect the dots, but they don't use it.

Yes it does seem like there’s some option missing in cf like that - maybe it’s only on the Enterprise plan? I don’t know. Or maybe cf primarily just suppplies the tools to build something with - but limited tools .

Thousands of ip’s a second , coming globally all going direct to a certain pathway does look suspicious! But then that’s on Xenforo and not other sites perhaps.

My only tip is - block Philippines and Thailand if you don’t need them (along with China). Twice now I have made the mistake of gradually unblocking one of these (because I do have guests from that part of the world and potential members). Should have learned the first time.

My request numbers had been so low for so long - everything was working - but real users were being blocked in these countries. I decided to move one country to a challenge instead of a block and monitor, after checking the log first and seeing only a handful of requests and most of them real people - within an hour I had to block it again. It started with a slow trickle and got bigger. And as happened the previous time, once re blocked it wasn’t enough and it somehow triggered a bit of a swarm of worldwide residential proxies again. Which found my small exemption and started getting through. I did stop them with fingerprinting for now but they will probably adapt. I had another option that would have stopped them but hopefully I can avoid that to keep it working without having to challenge more real guests from main countries.

Having said that my numbers are still very low anyway - only 135,000 requests a day now - but I was watching them increase by the minute after that and it had been down to 90,000. These can't solve the challenge though - if they have some fingerprinting aspect to challenge.

I had also got things under control while not challenging my main membership countries (or hardly) so had thought to try and open things up a bit more in other countries- sad thing is it seems it will never be possible at this rate. Yes they could use a vpn but most won’t bother if it was clicking a link from a Google search and being blocked - even if it’s a friendly html block with a hint to use a vpn.

More needs to be done to allow sites to be open in most of the world instead of us having to gatekeep.

This is not an exact science but I have found that the ones that carry fake referers can't solve challenges (maybe not 100% proof but generally). The ones without referers don't need them because they can solve - or a large proportion can.
 
Last edited:
I was about to start a new thread about this and came across this one. We’ve been seeing similar behaviour on my forum recently, and it’s had a noticeable impact on the server.

During one spike, Apache logged 2,361 requests to /threads/.../post-<id> in a single minute. In two earlier samples, almost every request to that route came from a different logged IP. CPU reached around 95%, with PHP-FPM doing most of the work, and the homepage took nearly six seconds to start responding.

DDoS-Guard initially adjusted its filtering for HTTP/1.x and later added filtering for HTTP/2 requests showing similar patterns. That’s helped considerably. The homepage is back to around 0.3 seconds, and we’ve been able to remove the temporary Nginx rate limit we put on direct post links. We’re still seeing around 830–860 requests per minute to that route, though, so the traffic hasn’t gone away.

Has anyone else seen most of this traffic hitting direct post links? If you found a way to reduce the load while keeping those links usable for members, I’d be interested to hear what worked.

@Rhody, your example on page 52 looks close to what we’re seeing. On the forum it’s spread across many /threads/.../post-<id> URLs, with many returning 301. In one minute we had 2,255 requests to that route from 2,248 distinct logged IPs. DDoS-Guard’s HTTP/1.x and HTTP/2 filtering helped, but the route still gets a fair amount of traffic. Did yours stay focused on one post, or did it eventually spread across other post IDs? Did you find anything that reduced the origin load while keeping direct post links usable for members?
 
It's like we're missing another layer of logic that looks at traffic as a while, and probably the reason is that cloudflare is based on SQL internally, which at such a large scale. Another layer missing is looking at global activity. They have enough data to connect the dots, but they don't use it.
Having all this data is the huge USP that Cloudflare has and they would be stupid not to use it. In fact they to use it for the products and their statistics - i.e. the whole radar statistics are based on it.
 
Until I can configure something more useful, I'm seriously considering my archive idea. Only, we don't have a mechanism in XF to do it the way I want. Our Google ranking for thousands of topics (if not hundreds of thousands) is fed through our older threads, so I don't want to turn off access to 24 out of 25 years of nearly a million threads. If we had way to set up a usergroup that detected something like CF's "verified bot" header (or could tie into something that could look up if the bots are legit--matching user agent to their IPs/ASN for instance), and allowed only a small number of helpful bots through to index the content, that would be ideal. (We automatically close threads after a year. My idea was to move all of the closed threads to separate "archive" forums, which would reduce our attack surface.) If we could show maybe a short excerpt of the first post in the thread as the teaser, that gives the AI bots little to feed on.

It's sad we have to do all this, but I'm still on the side of the "layered like an onion" approach. Let CF clean away a lot of the crap. Then have Anubis (or similar) clean up more. Then as a last resort, use XF add-ons to catch what falls through (if needed). If that means archiving/hiding older threads, so be it.
 
I was about to start a new thread about this and came across this one. We’ve been seeing similar behaviour on my forum recently, and it’s had a noticeable impact on the server.

During one spike, Apache logged 2,361 requests to /threads/.../post-<id> in a single minute. In two earlier samples, almost every request to that route came from a different logged IP. CPU reached around 95%, with PHP-FPM doing most of the work, and the homepage took nearly six seconds to start responding.

DDoS-Guard initially adjusted its filtering for HTTP/1.x and later added filtering for HTTP/2 requests showing similar patterns. That’s helped considerably. The homepage is back to around 0.3 seconds, and we’ve been able to remove the temporary Nginx rate limit we put on direct post links. We’re still seeing around 830–860 requests per minute to that route, though, so the traffic hasn’t gone away.

Has anyone else seen most of this traffic hitting direct post links? If you found a way to reduce the load while keeping those links usable for members, I’d be interested to hear what worked.

@Rhody, your example on page 52 looks close to what we’re seeing. On the forum it’s spread across many /threads/.../post-<id> URLs, with many returning 301. In one minute we had 2,255 requests to that route from 2,248 distinct logged IPs. DDoS-Guard’s HTTP/1.x and HTTP/2 filtering helped, but the route still gets a fair amount of traffic. Did yours stay focused on one post, or did it eventually spread across other post IDs? Did you find anything that reduced the origin load while keeping direct post links usable for members?
I think what a lot of people do, including myself, is challenge before they get to your site or the server at Cloudflare level. So you could challenge the pathways and exempt registered members. Any guests would get a cloudflare challenge though but it's quite quick.

Eg challenge whats new, search, posts, threads. Once a real guest passes the challenge they don't get challenged again for a period of time (a period you can set). So they are then free to browse. The same goes for bots who solve the challenge! It should stop 70% or so of them though.
 
  • Like
Reactions: Maa
Back
Top Bottom