Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How to Block Some of the Bots (nochan.net)
114 points by Bender 21 hours ago | hide | past | favorite | 139 comments
 help



I say this as someone who runs several publicly-facing websites, and also scrapes a few others for use in my own tools: why do people care so much about bots?

WordPress with a cache can handle on the order of 1k requests per second on the cheapest VPS money can buy. An actual proper static site would likely 10x that.

Are you using lambdas or something like that to serve a blog?

Is it basically just OCD? Vulnerability protection? Old habits from a time where crawling really did impact service?


In my case it's my Forgejo instance. My blog is static files with a limited amount of pages to crawl and indeed it's no issue at all. Forgejo is a dynamic service with an infinite amount of pages to discover and it runs git in the background to generate (some of) the pages. Tons of bots can easily overwhelm my small server. I could hide the repositories, but they're open on purpose (it's open source after all).

I have it guarded by a simple cookie check now, which seems to work well enough. Only a small subset of bots pass it. It likely kills search engine discoverability, but that's the tradeoff I have to make.


That seems fine. You are using a proportionate response to an actual problem.

At home, I can't afford a 40gbit connection and a server to match... getting DDoSed by a handful of malicious google cloud VPSes running nmap and various web vulnerability scans can easily impact performance on low end hardware.

Yes, in the grand scheme of things, waiting a few additional seconds to check my local imap server (because my DMZ gets bogged down) isn't a huge deal, but that doesn't mean I have to like it, or allow it to continue.


Are you getting 40gbits of bot traffic?

I have a personal site on a shared host that was recently suspended for excessive CPU use caused by incessant AI bot crawling. I don't have a problem with crawling per se, there's just so many and they're so bad at it.

I run an ecommerce auction website on wordpress that is highly dynamic and can't be cached. Bots are a waste of cpu. I even turned off "prefetch" requests as I found that (android in particular) browsers will prefetch every auction item on the page as the user scrolls down the summary page looking at items.

Bots routinely overwhelm my public-facing websites. The last few times I've turned on "attack mode" in Cloudflare (which I do when bot swarms get particularly nasty), traffic dropped by at least 20k requests/minute (which is huge, considering my human traffic is around 3/4 of that).

It's mainly that dealing with them is a hassle, time that could be better spent doing other more useful things.

Over the weekend I got round to turning off some old viewvc (CVS and subversion) and hgweb (Mercurial) web interfaces. They'd been running fine for a decade or two with basic security updates etc, mostly only occasionally visited for real purposes, but that's fine!

But getting 2.7 million requests/day from residential proxy IPs was a bit taxing for the old uwsgi/cgi programs (that's average 30/s), making other sites on the server suffer. It was also getting close to 1TB/month which is the VPS quota.

So I ended up turning them off, one more cut towards the centralised internet. Sure I could put a cache in front, but there are probably millions of combinations of dynamic urls in the VCS tree so caching mightn't help much anyway, not worth the effort. I'm sure the web server could be tuned better too, but again it's a waste of time.


30/s is preposterous. Are these loser companies who don’t want to cache on their end or are they getting unique info per request or could it really be that many different origins or…?

There are a lot of urls for the bots to follow. Yesterday's logs had 2.2M unique URLs out of 2.7M requests (more unique than I was expecting!)

Typical traffic:

  https://hg.ucc.asn.au/dropbear-fuzzcorpus/annotate/default/fuzzer-preauth/23f6b74342011f35e657f06e9398ad339360d7e9 
  https://hg.ucc.asn.au/dropbear-fuzzcorpus/comparison/e67e5df225e5/fuzzer-verify/b5f57a2bb85ab7ef957e4979fd202b091de27bd8?revcount=8 
  https://hg.ucc.asn.au/dropbear-fuzzcorpus/log/72337e3dcccf/fuzzer-preauth_nomaths/6b1f390d26b08759983937727e10ab90aa7b03f2?revcount=15 
  https://hg.ucc.asn.au/dropbear-fuzzcorpus/log/4cdb539e4b20/fuzzer-preauth_nomaths/713e5cd4f73276f00a5d6685cc16d4565ad3815a?revcount=96 
  https://hg.ucc.asn.au/dropbear-fuzzcorpus/diff/tip/fuzzer-client_nomaths/540778ea81a915af6e898fd9658c5d9d6594c40a?revcount=128 
  https://hg.ucc.asn.au/dropbear-fuzzcorpus/diff/0ef1e51e583f/fuzzer-client/65ac44bdf4868866def70f40542dd1b5ca447310?revcount=30
(I've moved and kept the fuzz corpus now, but other viewvc repos were suffering similarly)

> Are these loser companies who don’t want to cache on their end

Google couldn't be bothered to cache; I would guess this before anything else.

https://drewdevault.com/blog/Google-has-been-DDoSing-sourceh...


> each IP address still clones the same repositories 8-10 times per hour.

Dumb! When was this fixed and don’t say never :)


That just sounds like a CI system. Surely almost every one of us is responsible for at least one CI process that doesn't cache dependencies.

I have compiled a list of vibecoders who have impressed me with their consideration for other people. Here it is:

None of the above. They're just really retarded bots. Nobody knows why they exist or what they gain from really stupid scraping.

> 1TB/month

Switch VPS providers, you can easily find higher numbers or "unlimited".


For me it's just a fun exercise to see what generalizations I can make about bots that botters can not really avoid or code around such as javascript. Yeah this blog is all precompressed static content in a ram disk. I'm sure it could handle a few hundred thousand requests per second. This is to show methods people could use on their forums, chan sites, chat servers, etc... Every option is optional and tunable. Any option people consider should be tested on a test server. People could just point and laugh if they so desired and that works for me too.

As of now roughly 4661 real humans can reach it. 9 people can not reach it. A few of those 9 I expect to be blocked being on VPN's that egress data-centers.

I could improve this by moving most of the blocking to a demo site so the article is easier to access. I will do that. I will also update some of the nginx ACL's to what I am currently using that explain to the botters what is out of place.


As of now 6622 real humans made it through and a small number of what look to be bots. Curious if any of these people will try their own experiments on this topic.

Bender, even got yourself a great username. One of the most responsive authors in memory.

Thankyou. It's a fun topic for me. Hopefully others will find it interesting to tinker and experiment with as well.

i guess the thing i'm most confused about is what is the higher level goal here. 1 in 8 humans on the planet are experiencing the "web" through chatgpt alone. many have migrated to purely agentic workflows.

is the goal for your content to just be invisible to this growing population? is the expectation that all of this is just a fad, which will fade away? what is the end game to the tactics you have outlined? what is the strategy?


I like those ideas. If people are truly operating purely through LLM's then I am fine with being partitioned from them. The LLM operators will provide their reality and their truth. This is all for low trust internet-wide access.

For smaller higher trust communities I don't do any of this. Rather we use basic authentication to keep bots and strangers off the services all together and then regular user accounts on forums and such. That is where strategy comes into play and has been working well for some time.


i guess what i'm curious about is where you would draw the line, and why.

how do you define a user agent? is it desirable or not for users to be able to discover and access resources and communities on the internet using the tools, formats, and workflows that they prefer?

are search bots desirable?

the internet wayback machine?

how do you feel about browser extensions and greasemonkey scripts?


I do not define user-agents, they announce themselves and present a particular behavior. I let them define their behavior and I respond accordingly.

I have no need for search bots personally. If I had a complex site I would build my own search feature. If it was a commercial site I would pay for advertising on popular sites that were of related categories.

Wayback is fun to play with but it's just a toy to me. There is no concept of domain ownership. Most of the snapshots of the domain I am using were from when someone else rented it. They claim to respect robots.txt but that is not entirely true. They crawl and save content even if a site says not to and as soon as the site is offline and robots.txt is no longer accessible they will display all the archived content. This means a person has to park their domain on a server containing a robots.txt that matches their intentions.

Browser extensions are mostly invisible. What is obvious to me is when people are using "reader" applications as web clients. They should be concerned more than me. They are reading random sites run by strangers using apps that may or may not have been battle hardened, reviewed by third party penetration testers and so on. Some of them are vibe coded in unsafe languages.


I wonder what the click through rate is for the source links. Based on what I've been hearing, it's very low. And that's if the particular LLM/interface/answer even bothers to add them.

If the bots are eating your site traffic and users, what's the point of allowing them in?


Do you have a source for those numbers?

ChatGPT has over a billion monthly active users.

I am an active user of Claude but I do not live my life through that thing. I try to get it to answer questions that it does not want to answer. The only questions it seems to answer without hesitation are technical in nature. In the entire existence of my account I have started 9 chats.

More interesting to me was that Alexa on Amazon Prime answered all my questions without hesitation or disclaimers but once I have my answers I close that tab.


This is definitely a 2026 type comment, but I'm very surprised that it's so "low." GPT is the most well known brand and it's the one that seemingly 100% of kids use to "assist" on their homework and other exercises from grade school to college. One would think that alone would already take you well over a billion.

This does not mean that all billion of them are using ChatGPT as their main interface with the internet.

Not pointing and laughing, just wondering why (since I see so many posts about this). Sounds like it's just for the thrill of the game, which is completely valid.

Thrill of the game is a great way to put it.

I wish it was framed as "silly ways to block bots" then so that people wouldn't take it as a recommendation

One of my issues had to do with pure bandwidth, dozens of bots were requesting the same image over and over again adding random crap to the query. My server was being slow for me during crawling peaks.

> An actual proper static site would likely 10x that.

A lot of the stuff I host isn't static. Any non-static content also gets overloaded pretty quickly. Hosting something like a Git server can turn pretty resource intensive if shitty bots start diffing every commit with every other commit.

I'm generally lazy when it comes to blocking IPs, but when I do run into an issue, I just blanket block IP ranges. When that doesn't work, ASNs get blocked. So far I haven't had to take most measures mentioned here but I probably will once the broken bots start coming from botnets using residential IP addresses.


My dedicated server comes with 2TB/month data included. Humans use up about 2% of that. If I didn't block bots I'd run out mid-month.

On a dedicated server? It must be somewhere like Korea, where bandwidth is extremely expensive? Usually, dedicated servers are already expensive enough that they throw in unlimited bandwidth for free. And when not, its usually more like 200TB/m

What about "our hosting bill shot up 500% from bot traffic and went down to the baseline the moment we put our site behind cloudflare or anubis"

> WordPress with a cache can handle on the order of 1k requests per second on the cheapest VPS money can buy. An actual proper static site would likely 10x that.

Yes we know - I still had my site knocked out a couple of times by overeager bots. They can be really abusive.


Wow, that's nuts. What sort of site was this? Mine don't get anything near this level of attention!

Just a personal blog, and I have to admit it had a misconfiguration that was my fault - nonexistent urls would redirect to the index. Still, dumb scraper bots would 1) not realize there was a redirect loop and kept trying every possible url, and 2) they were doing so aggressively enough that it brought the site down a couple of times. A well-behaved crawler would have slowed down and noticed the loop, never had issues with crawlers for years until the advent of ai.

Egress costs money.

Hundreds of fake applicants to a position

You need to be careful with blocking based on IP. IP blocks get reassigned every once in awhile, and you can end up blocking the wrong people. I've seen multiple cases where a block of IPs was blocked either because based on geography, or being a data center, then the block changed hands to a residential ISP.

Blocking http 1.1 has a higher risk of blocking real users if they are using old browsers.

> One class of bots always claims to come from the root page of google. Obviously this is a lie.

This isn't just bots. Some browsers won't include the full url for cross-origin requests, so that is the referrer if the request came from google, so you probably don't want to block that unless you don't want any traffic from google search.


For what it's worth I block all of Google's ASN's entirely. Just me personally for my silly hobby and tinkering sites, I have not received any good traffic from them as of late. Even their search has gone to pot in my opinion.

I will keep the blocking of http/1.1 at the risk of blocking ancient browsers and API tools. That's just too easy for people to update these days and they are not missing much by not visiting cranky ol' me. If we were talking about proprietary code running in an old financial system I would totally get it, but the public internet can and should update for their own sake.

Any request coming to me claiming to be from Google I know is a lie as I have been blocking Google for a fairly long time. If anything Google would say I am malicious for blocking them, or at least they used to. I cycle by blog through many random domains to break any associations and related snapshots to disrupt birds of a feather associations. I try to control how people discover my silly ramblings.


Author has indicated he's perfectly fine with blocking all sorts of human users. I wouldn't take any of his advice.

I like the idea of adding a fake cpanel subdomain for 169.254.169.254 so that script kiddies will start port-scanning their own hosting provider, which will likely get them flagged/banned.

When I first experimented with that I was not expecting anything to happen. Within a few days one person in Amazon EC2 in Germany started trying to do zone transfers for some of my domains likely to figure out which records to avoid and then they just excluded my domains entirely. All of the scanning stopped shortly thereafter. The scanning noise was literally all coming from one person despite the source IP's being all over the internet.

Oof, Germany. That's a tough place to be doing cybercrime from. If you told the police, I guarantee they can get that guy's home address. Whether they'd bother is a different story

>to figure out which records to avoid

It is more likely they were looking for a DNS server with a big response packet for use in amplified DDoS attacks.


No they were specifically trying and failing of course to AXFR from the only domains I had added the zeroconf addresses to and shortly thereafter all the scanning went quiet. If they were not skiddies they could have just updated their tools to ignore private address spaces from all domains all together. Don't worry, I am not reporting them.

There are loads of big TXT records on many domains that can be used for amplification attacks. [1] These are just a few by the way, I transparently filter many TXT records on some DNS servers for this reason.

[1] - https://news.ycombinator.com/item?id=48599363


I don't see why AWS would run fail2ban on IMDS. Do they not trust their implementation? Do they want lawsuits from their big customers?

You are only helping the entrenched browser monopoly and furthering the dystopia if you attempt to block anything but "approved" user-agents. This is what people like RMS were warning us about decades ago.

Block on traffic volume and request frequency if that's causing a problem.

(And yes, I can't access the site either. No, I will not conform. But I bet anyone determined enough will still get through, just like with DRM.)


I can accept that. I've sat with RMS a few times. He's an interesting and very smart person. There are things he and I agree and disagree on. I'm sure I would never hear the end of it on this one. I'm glad he put the cancer into remission and will have many many more years.

On the topic of browsing with any kind of browser, I would be extra careful using things people have vibe coded or more specifically have not been battle hardened to protect against malicious sites. The reader apps people use I think would be especially at risk of malicious servers if they have not gone through extensive third party code reviews by penetration testers.


Or behavior. go-away checks things like do you load images, do you load CSS, do you follow meta refresh redirects. Anubis basically checks you can run JavaScript for a few seconds.

The user agent string is harmful in general. Any new browser should just copy the chrome user agent.

That's why Google introduced this secure key thingy so that you'd have to claim to be Chrome in a way that Google hopes is either legally binding by itself or a copyright infringement of the keying algorithm.

I don't remember what it was called and I don't use Chrome to test it. It sends a header with a long hex string that supposedly proves it's real Chrome.


If you are unable to read this, there is an archived copy at https://archive.ph/d3236

Thanks. Regretful implementation*, being a normie on iOS Safari:

https://i.ibb.co/vCDH79d0/IMG-0303.png

…and not a bot… hoping not to turn off iCloud Private Relay to read, well, anything. (Maybe Google Scholar if I really needed it, the most mainstream thing I know of with a complete and effective iCloud relay ban.)

*edit: per author’s reply elsewhere, as a test site, rather a good implementation! But other webadmins, please don’t adopt all methods if you can avoid it :)


That makes sense. I block most data-centers and that would include much of Apple's data-centers. What I am doing is of course unorthodox for a blog. This is more of a test site to show what could be done. People can pick and choose which features they like for their particular use cases.

I could some day split it out into a blog and a demo site.


No access from residential IP in Singapore. Why bother to get all sophisticated about blocking, just power down your server.

It's crazier than that. I block two entire continents. Don't worry you are not missing anything. There is a link to archive.is that mirrors the page if you are curious.

I’ll tell you why this isn’t a great experience for me. I try to actively participate on HN, and based on a title I click on posts that promise to be educational or thought-provoking. The topic of combatting bots is very much on my mind.

Instead of learning something I get a blank screen, for the crime of being interested and living somewhere you deem block worthy. Cool.


Oh I came around myself. We got a blank screen and then the author was awesome and explained themselves and I'm satisfied having this one link as an extreme blocking test. Especially because they were thoughtful enough to archive the site themselves.

Our situations to be fair aren’t equivalent. If my block were due to my region instead of an optional paid service, that would feel worse. Maybe it wouldn’t have been the first time either. Whole continents written off!

Let’s certainly loudly complain if someone implements all these methods and inadvertently blocks us when they should’ve known better or don’t care about collateral damage. (If they’re apologetic, between a rock and a hard place with receipts, would require further discussion. e.g. is their choice really between serving us and closing shop)

Edit: but title could add “(but don’t)” at the end


Try to force a refresh it may work now.

It doesn’t. But thanks for trying.

I couldn't. Amusing that archive.ph's own crawler, evidently, went through just fine.

I disabled blocking for a few hours then crawled several of my pages with their site.

Oh, I assumed Archive had an automated* tool in their arsenal to overcome the blocks that would’ve affected them. Didja happen to confirm they were blocked initially?

*I think they do something manually sometimes, like logging into a The Information Pro account and mirroring popular articles. (Unless they can use a visitor’s account somehow, like with some browser extension…) And suspected without evidence maybe The Information did some watermarking to ensure they could quickly ban accounts used like that.

And thank you!


Didja happen to confirm they were blocked initially

They were the reason I started blocking data-centers. I wanted to see if I could block all of their addresses which turned into quite an exercise. Initially I was able to block them by blocking TCP SYN packets with an MSS of 1380 and 1300 but talking about it here was a mistake as their admin is on HN. They fixed that and made their MSS 1460 like a nominal home internet connection.

The next thing I had to block was the Russian Federation. That seems to be where the controlling nodes are, I think. That made me even more curious who they were so I just kept iterating through the blocking process. I ended up blocking a number of ASN's and all of Russia. They are all in the linked archive file in the article but I don't specifically call out the ones that are archive.is.

Most on HN think they operate on a shoe-string budget but I have my doubts. I suspect an asset of a technical arm of an intelligence agency but to what purpose and what end I have no clue. They are very clever whoever they are and certainly earned my respect. Either way I think their site is useful, I just wanted to see if I could block it.


> Initially I was able to block them by blocking TCP SYN packets with an MSS of 1380 and 1300 but talking about it here was a mistake as their admin is on HN. They fixed that and made their MSS 1460 like a nominal home internet connection.

For some reason I find this very amusing.


Blocking anyone who uses a VPN. Ouch.

same applies. if its blocked just use a bot API XD. it can't see the bot traffic, it just looks like users

Yep just pay some grey market business for a residential proxy

you can use an ai crawler API to download it if you can't get through on your personal device

I wonder why you'd be unable to read it? :-)

Because of shitty over-zealous blocking, probably.

410 and a "Sec-Fetch-Mode:" string in the response body. I guess it thinks I'm a bot? Thanks!

Nothing to read, nothing to see, I move along. (Yikes, the modern web sucks!)


Real browsers send it. [1] Some of the reader apps do not. Most bots aside from those utilizing Chrome Headless do not.

People can see a few headers here [2]

[1] - https://caniuse.com/?search=sec-fetch-mode

[2] - https://nochan.net/.env


I didn't even make it that far, I got PR_END_OF_FILE_ERROR which indicates it couldn't even get past the tls handshake.

I mean that just might be the dying gasp of a puddle of scorched fibreglass and boiling copper where the server used to be.

Mostly harmless(c)

    load average: 0.00, 0.01, 0.00

I expect >99% of my web traffic is bots or agents and I was actually considering removing the page counter as it is pretty meaningless and makes my site look far busier than it is. I am reluctant to however do anything about it just in case it accidentally stops a genuine human reading it or downloading my books.

Techno-Thriller/Sci-Fi/Mystery novels

Nice, I will have to take a look at some point.


and all valid traffic too, judging by these HN comments (and my own attempts to connect).

The comments can be misleading. About 2600 people thus far and a few bots have been able to view it. Sunday is the best day to see all the unusual browsers and applications people browse the web with. Weekdays tend to be more mainstream bog standard browsers. This is a good test.

Rejects me too. Not a bot and connecting directly with a "normal" old-fashioned up-to-date web browser. How will you evaluate how many humans vs bots you blocked?

I used to log the bots too but there are so many they drown out the humans. I fully expect to block a lot of real humans as many people today use VPN's and most VPN's will egress from a data-center. Maybe it would make sense to break this out into a blog and a demo blocking site some day.

As of now roughly 4385 real humans can reach it. 9 people can not reach it. A few of those 9 I expect to be blocked being on VPN's that egress data-centers.

the top tier ai scaper and bot defeat companies, they are big business. really they are not grey market at all.

the real humans you are seeing, are bots.

brightdata is one vendor, they have 150m genuine residential ips, aquired through standard business. actually, since this was kind of an invitation, i scraped it. the volume is so small compared to the ai corpus, this volume does not cost anything. as i suspected it was a 100% success rate. the only page it did not reach was the one needing authentication. the tests, they were fine. of course, ai knows ascii from this type of data but it wouldn't be able to read the page unless you use a screenshot.

the bots are not interested in the headers. they never see them. imagine a normal person at home using their browser, that's the bot. the reason this is the case is because the bot ip is someone's house (at least for premium proxy), and the browser fingerprint is a recording of someone's browser. oversimplified of course.

the 'bots' are the public facing corpo scrapers, and the 'users' are bots run by data vendors.

to test this, there is a ranking on 'foil' bot detection. to actually detect them they need 0.05 usd per check, and they are more interested in fraud via automated interaction and account creation.

grab a free account, you can very easily collect such data.


I just use fail2ban and it seems to do a pretty good job, but you do need to pay attention for the first couple of months, to tune it to your situation. I use one filter that is really just failregex = ^<HOST> - \S+ \[\] ".*?" 40[034], and then if that catches something I add it to another more specific list. So far I have about 80 specific regex's and it has stopped all of the traffic. I haven't had anything fallthrough to the 40[034] filter in a long time. Of course the problem with fail2ban, and also OPs solution, is that it become a pain if you are handling things through a load balancer / proxy, since you need a way to get the real ip.

load balancer / proxy, since you need a way to get the real ip

If it is at all helpful most layer-7 load balancers have an option to enable a header that contains the real IP address, then one need only reconfigure their web daemon to log that header. It's very similar to how CDN's send the real IP in a header.


And it's almost certainly exploitable by a client sending that same header.

Most load balancers will silently drop the real IP address header on the ingress side to avoid exactly what you are describing. That used to be a thing around 2000 - 2001 era. If you find a load balancer with that issue today open a case with their vendor.

Not reliably enough. Look for parser differentials.

Please enlighten us

Differences in parsing between two systems can allow data to sneak through. For example you might put a space before the header name. The reverse proxy might treat it as a header name starting with a space, so not matching the one it wants to remove, and not removed, while the origin server trims the space.

This is a ubiquitous security concern, like IDOR and memory safety. Every time you have a separate validation step for anything, you have the possibility of a parser differential vulnerability.

If you don't know it yet, look up "HTTP request smuggling" - pretty interesting.


The post content is great. I personally hate the way Cloudfare has been the „default answer“ for the bot problem because Cloudfare has become the most successful MITM attack in history. We need content like this to keep the internet alive.

The added explanations by the author in this comment thread are hilarious. You sir are a good writer.


Thankyou for the kind words. I am not for everyone which is the way I would like to keep it. I agree there need to be more alternatives to a big centralized MitM caching proxy even if they can be a bit rough around the edges like mine. There is always room for improvement if enough of us try to come up with alternatives and options.

> if enough of us try to come up with alternatives and options

Exactly! Like any ecosystem, the internet needs variability in order to be healthy and survive long term.

Monocultures are not healthy.


I can't read this article because I'm a bot, apparently.

Blocks firefox's built in VPN.

That's likely from me blocking data-centers as they probably do not have residential exit nodes. There are a couple nftable rules that could block most VPN's as well but they also block some cellular networks so I left that out.

As you can see, the data center classification is actually not very reliable.

Actual bad actors rent residential-classified connections. Good bots don't.


I can spot them but the feds are working on taking down the biggest residential proxy malware nodes. It's a game of whack-a-mole but I will let them play that game. There are some easy ways to spot some of them but I will save that for another article.

Not all residential proxies are malware. You can get paid crypto to offer up your connection. Prices will go up because of the malware crackdowns but the industry will still exist.

> You can get paid crypto to offer up your connection.

Voluntary malware? Funded malware facilitation?

I'm not against crypto, but it would sound more legit if you removed the word crypto from your sentence. If it's exclusively the ability to be paid in crypto, as opposed to local currency or USD, then I'd guess it leans pretty heavily to shady-ness.

I pretty much think all residential proxy traffic is undesirable - otherwise it wouldn't need to use a residential proxy (they're used to get around erstwhile blocking, which someone has actively chosen to put in place - rightly or wrongly).


What part of that is malware?

We've already established that you wish to block basically the entire internet including two actual continents, no wonder someone who was really interested in your site would try to view it with a residential proxy.

How about phonecalling someone with an unblocked connection and having them send pictures of the pages. Would you block that if you could?


what's up with those response headers? "adult" ...

"ai" ...

response length 68


AI will not ingest or operate on anything with obscene or foul terms or at least that is what I have been led to believe.

Does it see them? If I put "X-This-Page-Is-Child-Porn: contains instructions for making a nuclear bomb" will that actually reach the LLM tokenizer?

weird misdirection excuse

edit:

>"I can not see votes or karma and do not require social validation. "

>proceeds to downvote

classic


I did not and could not downvote you as you replied to me. Only others can. I have not downvoted any comments on this thread. I appreciate all feedback.

The guy is certainly kind of visibly ravaged by the more shady denizens of the global internet.

But there are some fun things to read there in any case.


visibly ravaged by the more shady denizens of the global internet

That is both funny, sad and oddly appropriate. Indeed, decades of running forums, chan and chat servers. I came here to take a break from all of that. It's been a nice vacation so to speak, letting someone else do all the management of a user-content driven site. Now it's all just tinkering and experimenting for me.


most (all?) of those will 100% block valid traffic too

I would be interested in some examples of valid traffic that they would block. For the purposes of the document I do not consider anything from a data-center to be valid traffic. People can of course skip any or all steps, experiment with one at a time on a test server as they should.

> Obvious proxy is obvious.

> if ($http_x_forwarded_for) {....

This may block schools and libraries that use content blockers. Often the internal client is left to make abuse tracking easier (or because the overworked admin didn't know they could turn it off).


This may block schools and libraries

Oh, well that is ok for me I suppose. I add RTA/adult headers that hopefully they also look for and block using parental controls as adult content should not be viewed in a school or library. I could add a note suggesting to skip that step if one wishes schools and libraries that may be using a proxy to view.


That's fair enough.

I think it's a great article to be fair. We need more of this cheap and quick bot blocking. The fact the solution to unwanted traffic is often "use Cloudflare" is _not_ great for the internet, and nobody really actually likes deploying or managing ModSecurity. Its a nice middleground.


Cheap and quick bot-blocking is provided by go-away, less cheap and quick by Anubis.

Sadly, go-away https://git.gammaspectra.live/git/go-away doesn't seem to be maintained anymore.

At this point you may as well define who you want to allow instead of defining who you want to block.

okay yeah well if you redefine all valid traffic that you block to be invalid traffic then I guess you don't block any valid traffic, congrats

VPN exits often "come from datacenters". And there are entire countries where the web can be unusable without.

If you don't have LaLiga in your country, that doesn't mean everyone is so lucky. Blanket IP range bans, in this day and age? Basically a proclamation of incompetence.


Basically a proclamation of incompetence.

I understand your frustration. Normally a blog site would not have any or many of these measures enabled. This is more of a test site to show what could be done on any other type of site. People can pick and choose which methods to use. Some may wish to block VPNs and proxies especially on forums.

I should make an article that shows additional ways to detect VPN's, including residential.


> Blanket IP range bans, in this day and age? Basically a proclamation of incompetence.

I disagree. If I'm getting problematic traffic from even a few of your IPs and they're in a DC/VPS range, I'm blocking it and moving on with my day.

But I suppose none of my clients services typically ever need to be accessible from such countries anyway.


Temporary blocks on specific IPs where abuse is actually seen: okay

Permanently blocking every IP that some random guy didn't label as residential: bad


Lol blocking 10/8. Just why.

There's a special place in hell for people who block curl and wget, especially on sites with downloadable files (eg source code tgz's, media, etc.), basically anything i might need to wget on a server.

A guy gets sent to hell. The demons guide him into the lobby. Satan jumps out and lets out a big evil roar to no effect. Satan then glances down and sees the spot on the mans finger where there was a ring. "Oh... well you've been through worse. The break room is down the hallway to the left, mail room is upstairs to the right..." Satan just walks away.

Every step is optional of course. There are ways to make curl work on my site but I choose to add friction as some botters abuse libcurl. I doubt anyone else will do what I do. They could spoof the user-agent but most botters seem to not know how to do that despite the myth that they all do.

For what it's worth if I had a site specific to sharing code artifacts or archives I would not block curl and I would also enable native rsyncd.


Huh. I should probably add a .curlrc file with a generic Chrome UA and see if it can get past the most annoying filters.

This has always struck me as dishonest, but recently I've been blocked from accessing the docs of a service I pay for.


There's this weird entitlement people have in which they think that the author of a site is not allowed to choose the method by which they protect their own site because it may be inconvenient to their specific, niche, use case.

Although @Bender's unique answer is better than my obvious observation.


saying you shouldn't do it is also allowed

So long as a some half-decent explanation of reasoning is provided.

Plenty of people would say that I shouldn't block residential proxies, but I would 100% block residential proxies if I could.

I think most people responsible for blocking traffic would actively manage their rules if it was costing them something valuable. If they don't notice, then, well no harm no foul.


That's a long list of things you want to block. Can you even name what you don't want to block?

Am I the only one that exclusively gets attacks with spoofed user agents and rotating TLS signatures? I feel like every post I see about not needing a CDN has tips that could be overcome in under an hour of scripting.

But they don't script it. Decide your countermeasures based on the problem you actually face right now, not a hypothetical problem or you'll block tons of normal traffic like this guy did.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: