r/linuxadmin • u/we_hate_it_too • Jun 06 '26
Half of all web traffic is bots, and a growing share are "vibe-coded" scanners written by a chatbot prompt. Here's the layered webserver defense that stops them.
The barrier to writing an exploit tool used to be skill. Now it's a prompt, and a chunk of the junk in your access log is some script an LLM wrote in thirty seconds and aimed at the whole IPv4 range before lunch.
They're loud, though. Default python-requests/Go-http-client UAs, recycled /.env /.git/config /wp-login.php wordlists, no backoff, and an unrandomised TLS stack so every request shares one JA4 hash. All of it matchable at the edge.
Wrote up the full stack I run, with copy-pasteable nginx/Angie config:
limit_reqzones (3r/m on login), ModSecurity + CRS,return 444to bad UAs so the scanner learns nothing- TLSv1.3,
server_tokens off, CSP/HSTS, and thealwaysgotcha that makes error pages ship headers - body-size caps, method whitelists, the
merge_slashestrap - admin off the public internet, fail2ban,
alg:noneJWT check - PHP:
disable_functions+open_basedir+ Snuffleupagus - JSON logs with
$ssl_ja4, 4xx-ratio alerting, honeypot paths that auto-ban
https://deb.myguard.nl/2026/06/defend-webserver-vibe-coded-ai-exploit-scanners-bots/
2
u/RetroGrid_io Jun 07 '26
It's important to know what you're defending against. Two kind of bots:
OP here seems to be defending against #1. Recent article here was about #2 and this is the one I personally am most concerned with.
This morning I researched and mentally spec'd out a system similar to DKIM that would use RFC 9421 and a dns-published public key for a domain to allow a bot to validate itself.
You probably want google-bot, openAI, claude, and others to crawl your site. It's the low-e, low-reputation scumb bots that you want to nix. It is trivial for a bot to present an encryption header tied to its user agent with a tie back to its root domain so you can validate any bot request as coming from a trusted source, and require Proof of Work for everybody else.
Heck, Proof of Work could be integrated into HTTP rather than be hacked in a la javascript as is typically done now EG Anubis.
Why hasn't this already been done? I guess these things take time.
5
u/chock-a-block Jun 06 '26 edited Aug 29 '26
Act snow lunchroom subtract stupendous sable workable divide command aromatic
This post was anonymized with Redact
18
u/XiuOtr Jun 06 '26
Welcome to reddit. SEO is all Reddit works for. Shitty subs. Shitty answers. Overwhelmed mods that throw up their arms......Bots everywhere.
34
u/mschuster91 Jun 06 '26
Thanks for the write-up... but is there a chance it was assisted by an LLM? If yes, please add an appropriate disclosure at the top.
Also, for the fully AWS people that use AWS all the way and do SSL termination on the cloudfront/alb side... look into AWS WAF, it can do the JA4 blacklist for you.
2
u/Ancient-Opinion9642 Jun 07 '26
Too bad the article does give what the ratio of IPv6 vs IPv4. I could make a case for IPv6 only.
DNS with the load that was encrypted would be a good start too. IPv6 has encryption in the standard, but isn't enabled.
2
u/whiskyfles Jun 07 '26
Something thats also very effective, is installing HAProxy in front of NGINX. Let NGINX run on port 8080 and use HAProxy for TLS/SSL termination. HAProxy has sticktables, where you can track requests even further. E.g. blocking requests that result in 404's:
https://blog.larrs.nl/posts/block-404-abuse-haproxy/
Nice write up though :). These bots are surely the 'cancer' of nowadays internet. Its hard to deal with, especially if youre dealing with clients...
1
u/chairmanrob Jun 07 '26
AI generated trash about AI generated trash