Remix.run Logo
▲ Bender 2 days ago

Don't give up. Blocking, redirecting and tarpitting bots can be turned into a fun game or puzzle of sorts. The bots evolve and so the game must evolve. I slow the residential bots down just a little and the obvious bots to somewhere between 32 and 96 bytes per second. I thought most would abort but many do not. They hang around for the slow dribble.

Here's just one example. It's kindof rude, especially for legit people behind corporate firewalls but such people should not be on my site anyway. Adjust as needed. It's just a silly example.

    if ($server_protocol = HTTP/2.0) { set $limit_rate 384k; set $ok 1; }
    if ($http3 != "") { set $ok 1; } # no rate limit for quic
    if ($ok != 1) { set $limit_rate 32; limit_rate_after 128; set $trace "${trace}not-h2h3 "; add_header Content-Type text/html;return 200 '<!DOCTYPE html><html><head><title>Welcome to nginx!</title><style>body{width:35em;margin:0 auto;font-family:Tahoma,Verdana,Arial,sans-serif;}</style></head><body><h1>Welcome to nginx!</h1><p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p></body></html>'; }
People not behind fascist firewalls and not on proxies will be able to use QUIC (via alt-svc header and dns) for full speed. Most real VPN's should be able to use QUIC.

This is just one silly example. One can use nginx geo in combination with FireHOL and other spammer IP repositories (consolidating with iprange) to also slow or tarpit or give dummy HTML and keep them on your edge servers and away from the origin or app servers or whatever.

▲viraptor 2 days ago | parent | next [-]

That's a good one. Also in general, return 200 with invalid content to them or 404. Don't explicitly block with 403 or they will try different networks/clients/approaches to avoid that.

▲Bender 2 days ago | parent [-]

or they will try different networks/clients/approaches

Absolutely. Most of the bots are simple but a few of them were created and actively maintained by clever people that are here on HN. I like to think it's a playful arms race. They are the red team and I am the wrinkled blue team.

▲pavel_lishin 2 days ago | parent | prev [-]

I'm glad this is fun for people, but I think I would rather play Monopoly with money under free parking instead.

I have noticed among my tech friends that one spectrum you can put us on is "sysadmin vs. not" - some people love tinkering with home labs, setting up systems, being able to reboot things from their watches, etc. And some people, like me, would strongly prefer not to be on-call for their hobby.

Hell, my personal server has been down for at least a week now because I started upgrading Ubuntu (that was very, very far behind), and one upgrade caused it to lose network connectivity, and I just haven't bothered to even start troubleshooting. If I had to guess, I'll probably be arsed to get it up sometime in December, though 2027 isn't out of the question.

▲Bender 2 days ago | parent [-]

Agreed it's not for everyone. As a side note, reboot your Ubuntu node and capture

    uname -a;dmesg -T; lspci -vv; lsmod; ip link; systemctl; nmcli;

 to a thumb drive and paste it into an LLM if you are not feeling like debugging such things.  I used to call that lazy but I was corrected and now call it efficient.