Re:Ask HN: "Creative" ways to handle abusive http traffic?
by mFixman on Saturday May 26, 2018 @10:43AM
(#17162294)
Unless you have 100% precision in finding bad actors, this may end up zip-bombing some poor unlucky human.
Re:Ask HN: "Creative" ways to handle abusive http traffic?
by timwis on Saturday May 26, 2018 @10:16AM
(#17162134)
Interesting read. But I'm wondering: how do you _create_ a zip bomb? Do you first need to create a petabyte file? Or can you compute it or something?
Re:Ask HN: "Creative" ways to handle abusive http traffic?
by sprocket on Saturday May 26, 2018 @10:35AM
(#17162254)
I believe you can do it off the command line relatively efficiently by piping output straight into gzip.
ie) perl -e "print '0' for (1..1000000000)" | gzip > zipbomb.gz
This will create a ~ 1MB file that will expand into something 1000 times its size.
Re:Ask HN: "Creative" ways to handle abusive http traffic?
by majewsky on Saturday May 26, 2018 @11:17AM
(#17162478)
Would probably be much more efficient to use /dev/zero:
dd if=/dev/zero of=/dev/stdout bs=1M count=1024 | gzip > zipbomb.gz
However, you're restricted to NUL bytes there. However, you can vastly improve your original Perl script by writing more chars at a time: perl -e "my \$x = ('0' x 1000000); print \$x for (1..1000)" | gzip > zipbomb.gz
That runs about as fast as the dd variant on my system, and about 10 times faster than your original formulation.
Re:Ask HN: "Creative" ways to handle abusive http traffic?
by setr on Saturday May 26, 2018 @07:15PM
(#17164691)
yes 0 | head -n 1000000000 | gzip > zipbomb.gz
?
Re:Ask HN: "Creative" ways to handle abusive http traffic?
by edwhitesell on Saturday May 26, 2018 @10:26AM
(#17162196)
There is an example available on the page linked to there.
https://news.ycombinator.com/item?id=14707674