this post was submitted on 29 Apr 2025
559 points (97.5% liked)

Technology

69600 readers
4514 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
 

The one-liner:

dd if=/dev/zero bs=1G count=10 | gzip -c > 10GB.gz

This is brilliant.

top 50 comments
sorted by: hot top controversial new old
[–] Treczoks@lemmy.world 20 points 2 days ago

Have you ever heard of sparse files, and how Linux and Windows deal with zips of it? You'll love this.

[–] dwt@feddit.org 72 points 3 days ago (3 children)

Sadly about the only thing that reliably helps against malicious crawlers is Anubis

https://anubis.techaro.lol/

[–] spicehoarder@lemm.ee 3 points 1 day ago (1 children)

I don't really like this approach, not just because I was flagged as a bot, but because I don't really like captchas. I swear I'm not a bot guys!

[–] dwt@feddit.org 1 points 1 day ago

That’s the reason I say ‚sadly‘. It’s definitely not good. But since everything else fails, this is what currently remains.

[–] alehel@lemmy.zip 28 points 3 days ago (7 children)

That URL is telling me "Invalid response". Am I a bot?

[–] doorknob88@lemmy.world 91 points 3 days ago

I’m sorry you had to find out this way.

load more comments (6 replies)
load more comments (1 replies)
[–] Bishma@discuss.tchncs.de 102 points 3 days ago (1 children)

When I was serving high volume sites (that were targeted by scrapers) I had a collection of files in CDN that contained nothing but the word "no" over and over. Scrapers who barely hit our detection thresholds saw all their requests go to the 50M version. Super aggressive scrapers got the 10G version. And the scripts that just wouldn't stop got the 50G version.

It didn't move the needle on budget, but hopefully it cost them.

[–] sugar_in_your_tea@sh.itjust.works 31 points 3 days ago (1 children)

How do you tell scrapers from regular traffic?

[–] Bishma@discuss.tchncs.de 62 points 3 days ago (4 children)

Most often because they don't download any of the css of external js files from the pages they scrape. But there are a lot of other patterns you can detect once you have their traffic logs loaded in a time series database. I used an ELK stack back in the day.

load more comments (4 replies)
[–] palordrolap@fedia.io 113 points 3 days ago (4 children)

The article writer kind of complains that they're having to serve a 10MB file, which is the result of the gzip compression. If that's a problem, they could switch to bzip2. It's available pretty much everywhere that gzip is available and it packs the 10GB down to 7506 bytes.

That's not a typo. bzip2 is way better with highly redundant data.

[–] Xanza@lemm.ee 3 points 1 day ago* (last edited 1 day ago) (2 children)

zstd is a significantly better option than anything else available unless you need something specific for a specific reason: https://github.com/facebook/zstd?tab=readme-ov-file#benchmarks

LZ4 is likely better than zstd, but it doesn't have wide usability yet.

load more comments (2 replies)
[–] just_another_person@lemmy.world 95 points 3 days ago* (last edited 3 days ago) (2 children)

I believe he's returning a gzip HTTP response stream, not just a file payload that the requester then downloads and decompresses.

Bzip isn't used in HTTP compression.

[–] bss03@infosec.pub 3 points 1 day ago

For scrapers that not just implementing HTTP, but are trying to extract zip files, you can possibly drive them insane with zip quines: https://github.com/ruvmello/zip-quine-generator or otherwise compressed files that contain themselves at some level of nesting, possibly with other data so that they recursively expand to an unbounded ("infinite") size.

[–] sugar_in_your_tea@sh.itjust.works 30 points 3 days ago* (last edited 3 days ago)

Brotli is an option, and it's comparable to Bzip. Brotli works in most browsers, so hopefully these bots would support it.

I just tested it, and a 10G file full of zeroes is only 8.3K compressed. That's pretty good, though a little bigger than BZip.

[–] sugar_in_your_tea@sh.itjust.works 27 points 3 days ago (3 children)

Brotli gets it to 8.3K, and is supported in most browsers, so there's a chance scrapers also support it.

load more comments (3 replies)
load more comments (1 replies)
[–] fmstrat@lemmy.nowsci.com 37 points 3 days ago (3 children)

I've been thinking about making an nginx plugin that randomizes words on a page to poison AI scrapers.

[–] owsei@programming.dev 16 points 2 days ago (1 children)

There are "AI mazes" that do that.

I remember reading and article about this but haven't found it yet

[–] corsicanguppy@lemmy.ca 3 points 1 day ago* (last edited 1 day ago)

The one below, named Anubis, is the one I heard about. Come back to the thread and check the link.

[–] delusion@lemmy.myserv.one 13 points 2 days ago (1 children)
[–] fmstrat@lemmy.nowsci.com 5 points 2 days ago

That is a very interesting git repo. Is this just a web view into the actual git folder?

[–] some_guy@lemmy.sdf.org 5 points 2 days ago

If you have the time, I think it's a great idea.

[–] moopet@sh.itjust.works 35 points 3 days ago (2 children)

I'd be amazed if this works, since these sorts of tricks have been around since dinosaurs ruled the Earth, and most bots will use pretty modern zip libraries which will just return "nope" or throw an exception, which will be treated exactly the same way any corrupt file is - for example a site saying it's serving a zip file but the contents are a generic 404 html file, which is not uncommon.

Also, be careful because you could destroy your own device? What the hell? No. Unless you're using dd backwards and as root, you can't do anything bad, and even then it's the drive contents you overwrite, not the device you "destroy".

[–] namingthingsiseasy@programming.dev 10 points 2 days ago (1 children)

On the other hand, there are lots of bots scraping Wikipedia even though it's easy to download the entire website as a single archive.

So they're not really that smart....

[–] Lucien@mander.xyz 5 points 2 days ago

Yeah, this article came across as if written by a complete beginner. They mention having their WordPress hacked, but failed to admit it was because they didn't upgrade the install.

[–] lemmylommy@lemmy.world 71 points 3 days ago (6 children)

Before I tell you how to create a zip bomb, I do have to warn you that you can potentially crash and destroy your own device.

LOL. Destroy your device, kill the cat, what else?

[–] archonet@lemy.lol 46 points 3 days ago

destroy your device by... having to reboot it. the horror! The pain! The financial loss of downtime!

load more comments (5 replies)
[–] arc@lemm.ee 26 points 3 days ago (6 children)

Probably only works for dumb bots and I'm guessing the big ones are resilient to this sort of thing.

Judging from recent stories the big threat is bots scraping for AIs and I wonder if there is a way to poison content so any AI ingesting it becomes dumber. e.g. text which is nonsensical or filled with counter information, trap phrases that reveal any AIs that ingested it, garbage pictures that purport to show something they don't etc.

[–] frezik@midwest.social 35 points 3 days ago (1 children)

When it comes to attacks on the Internet, doing simple things to get rid of the stupid bots means kicking 90% of attacks out. No, it won't work against a determined foe, but it does something useful.

Same goes for setting SSH to a random port. Logs are so much cleaner after doing that.

[–] airgapped@piefed.social 14 points 2 days ago (1 children)

Setting a random SSH port and limiting it to 3/min saw failed login attempts fall by 99% and jailed IPs fall to 0.

[–] WFloyd@lemmy.world 4 points 1 day ago

I've found great success using a hardened ssh config with a limited set of supported Cyphers/MACs/KexAlgorithms. Nothing ever gets far enough to even trigger fail2ban. Then of course it's key only login from there.

load more comments (3 replies)
[–] mbirth@lemmy.ml 38 points 3 days ago

And if you want some customisation, e.g. some repeating string over and over, you can use something like this:

yes "b0M" | tr -d '\n' | head -c 10G | gzip -c > 10GB.gz

yes repeats the given string (followed by a line feed) indefinitely - originally meant to type "yes" + ENTER into prompts. tr then removes the line breaks again and head makes sure to only take 10GB and not have it run indefinitely.

If you want to be really fancy, you can even add some HTML header and footer to some files like header and footer and then run it like this:

yes "b0M" | tr -d '\n' | head -c 10G | cat header - footer | gzip -c > 10GB.gz
[–] tal@lemmy.today 32 points 3 days ago (3 children)

Anyone who writes a spider that's going to inspect all the content out there is already going to have to have dealt with this, along with about a bazillion other kinds of oddball or bad data.

[–] catloaf@lemm.ee 26 points 3 days ago (1 children)

Competent ones, yes. Most developers aren't competent, scraper writers even less so.

load more comments (1 replies)
load more comments (2 replies)
[–] aesthelete@lemmy.world 25 points 3 days ago* (last edited 3 days ago) (1 children)

This reminds me of shitty FTP sites with ratios when I was on dial-up. I used to push them files full of null characters with filenames that looked like actual content. The modem would compress the upload as it transmitted it which allowed me to upload the junk files at several times the rate of a normal file.

load more comments (1 replies)
[–] cy_narrator@discuss.tchncs.de 29 points 3 days ago (2 children)

First off, be very careful with bs=1G as it may overload the RAM. You will want to set count accordingly

load more comments (2 replies)
[–] deaddigger@lemm.ee 22 points 3 days ago (15 children)

At least in germany having one of these on your system is illegal

load more comments (15 replies)
load more comments
view more: next ›