Zip Bomb
en.wikipedia.org
en.wikipedia.org
A days later the mail server stops working and the sysadmin turns up at my desk. Turns out the anti-virus scanner had been unzipping and scanning repeatedly. It eventually filled up the entire disk and bad things happened.
I can only imagine what would have happened. Can you share more details about that.
Also, wonder how the mail servers these days are equipped to handle such attachments. Can someone throw light on that? Is it just plain simple to detect these files?
Compression quines and bombs are a great way to screw up automated systems. Possessing or transmitting them can easily cause a denial of service.
From Wikipedia: A quine is a computer program which takes no input and produces a copy of its own source code as its only output. http://en.wikipedia.org/wiki/Quine_(computing)
Or are those scanners just rejecting files that are too large or deep?
Some malware is remarkably unsophisticated and relied on users installing it and giving it permissions to run.
I hope they're not silently rejecting files.
(The Grugq sells high value 0days and is a respected member of the hacking community) http://www.csoonline.com/article/216370/where-is-hacking-now...
I've worked with a leading commercial scanner that failed to respect the max depth parameter even when set. It would scan for days before we killed it.
The school IT manager (who, incidentally, apart from this once I was always on good terms with) was rather annoyed at me the next day, for the nightly backup had fallen over the previous night and he had found the problem. You see, what to me was H:\ was \\galaxy\users$\chrism, which on that server was D:\users\chrism. So that 256-or-so character path became longer than 256 characters on the server and the backup software hadn't been written carefully enough to cope with what was a perfectly valid NTFS path, but not a valid path for the normal Win32 API function calls.
How was I to know it would do that?
[1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa36...
[1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa36...
EPS, an interpreted language, was designed to let financial analysts run economic projections. It contained various kinds of arrays.
One day, the systems programmers announced a new feature, first released to the test mainframe: a new structure, called containers IIRC, with the twist being that any cell in a container could itself consist of a container.
You know where this is going:
For I = 1 to 100
ContX[1] = ContX
EndFOR
10 seconds later, EPS on the test mainframe had crashed. Coincidence? Hmmmmmm.So far, my cover was my inquiring mind. But then I ran the loop again, with the same results.
A minute later, there was Massachusetts on the phone, in the person of my friend Kevin, lead EPS developer: "Hey, the answer is 47. What the hell are you doing?"
I was outraged. Basically, the IT manager preferred to use punishment as his means of security, rather than actually doing his job.
Tossing a brick through a window doesn't mean that the window should have been thicker.
There is nobody to blame for this, actually. Neither could the kid have known that this was bad (and the child-like curiosity is hardly something worth a punishment,) nor could the sysadmin really do anything to prevent it, except hang up a memo: please don't do that.
Though, in that case, you'd have some kids doing that over and over again out of a very different kind of curiosity.
It was "simple" way to hide files, by making their names very long indeed.
Rule: "You can have at most 50 sub-directories."
coder-action:
#define MAX_SUB_DIRECTORY_NUM 50
hacker-action: main(int argc, char *argv[]) {
int i;
for (i = 0; i < atoi(argv[1]); i++) {
create_subdir( ... );
}
}
Plus experiments.The difference is that the coder is just doing their job so they note the limitation and move on, the hacker is curious and trys to test to see if its a hard limit, a soft limit, a big problem, a little problem.
It's very confusing when you're not expecting it--you can dig into the folder and delete all the subdirectories of it that don't have overlong paths just fine, but there'll be one series of empty directories left over that just refuse to go away. Then you flatten them out from their nested configuration, and suddenly the problem goes away.
Unless you validate the image dimensions as well as the file size it may cause problems, for instance when GD is used to try to resize it exhausted the memory limit.
15,000 x 15,000: http://i.imgur.com/WzCyE.png
50,000 x 50,000: http://i.imgur.com/kgmHu.png
Both FF and Chrome refuse to open the second one. IE does something weird. Both Opera and Safari figure out the size correctly, but don't display the image.
When I opened it the first time, or everytime I press Ctrl+Shift+R it works, but it shows the URL, and a litte icon in the upper left corner: http://i.imgur.com/B7jFE.png
If I press F5 or Ctrl+R it doesnt work, just as you said.
I got slightly better results even by doing this with a JPG image, probably because it's based on 8x8 blocks. I used the colour red, but I don't think that matters much.
Correction, looking back to my results, it seems the PNG was smaller after all: png32512.png.gz is 36,077 bytes (a 32000x32000 JPG gzips to about 41k). I forget how I came to the 32512x32512 limit, maybe it was by trial & error, the largest size a browser still opens (probably tested on Firefox and Opera, didn't use Chrome at the time).
I also asked some friends with powerful (lots of memory) computers to try out a webpage that would load this image many times, with unique GET parameters to prevent caching, but apart from loads of harddisk access and maxing the CPU for a bit until they closed the tab, nothing crashy happened (and of course I did inform them what could happen and told them to save any work).
Reliably crashing a browser on a sufficiently high-end (say, gaming) PC, I haven't been able to do it since at least 5 years or so. I might have done better if I'd own a high-end computer myself, of course :) I remember it used to be as easy as making a webpage with 200 full-page DIV layers stacked at 1% opacity :-P
(http://www.maximumcompression.com/compression_fun.php)
It includes a 115 byte rar file that expands to 5 Mb. (That 115 bytes can be squashed down further; one compressor gets it to 39 bytes.); a file that compresses with one software but ends up bigger with another software; etc.
some say that file compression is linked to AI - good general purpose compression relies on being able to predict the text and create table; if you can predict something you understand it.
The Hutter prize tests this against the 100 Mb of enwiki8. Best attempt so far is a bit less than 16 Mb.
(http://prize.hutter1.net/) I remember zip bombs from early 90s BBSing. I also remember ANSI bombs.
The current record is 15,949,688 bytes.
lol ^ 10,000,000,000 is an insane amount larger. :)
This has a 115 byte RAR file that expands to 5 Mb. You can probably experiment to get a file just small enough for QR code, with huge output.
(Note that using obscure compressor gives a 24 byte file that expends to 5 Mb.)
/tmp $ mkdir -p a/b/c
/tmp $ mkdir -p a/d/e
/tmp $ cd a/b/c
/tmp/a/b/c $ ln -s /tmp/a/d .
/tmp/a/b/c $ cd ../../
/tmp/a $ ls */*
b/c:
d
d/e:
/tmp/a $ rm -rf b
/tmp/a $ ls
d
It would be pretty stupid for it to.But examples like this happen in many forms, heck windows on some file types/sizes doing thumbnails has done wonderous things like exponentialy growing the swap file to a ever impending churned slowdown.
Even computers have mental farts.
This may have something to do with Russ Cox's blog post on recursive zip-archives "Zip Files All The Way Down" in Go: http://research.swtch.com/zip
Baseless speculation mode: There is a possibility that the recursive zip file was part of the Go test cases for the gzip package at some point. If it lingers in the mercurial commit history, it may still trigger hits from your AV software.
C:\Go\src\pkg\regexp\testdata\re2-exhaustive.txt.bz2 385KB in size though opening shows a .txt file that is 58MB in size. Basicily Avast being picky and a non-positive. Probably so crompessed that it hit whatever limit on decompressing per file in avast and avast then things its a compression bomb. Opens and extracts fine, though hardly fun reading.
Make a billion-pixel PNG image that compresses very well, upload several copies simultaneously to a LAMP server running on an average Linode, and watch it run out of memory while trying to create thumbnails with GD.
But I don't think you'd bring the site down.
http://www.aerasec.de/security/advisories/decompression-bomb...
in this typically thinly referenced Wikipedia article looks to be several years old. What is the current state of the art? Some of the comments already posted as I post this comment talk about the situation "years ago" and at least one comment suggests that this is largely a solved problem, currently. How many wild vulnerabilities like this are there, really?
(I ask questions like this about most "facts" reported in Wikipedia articles, because I am a Wikipedian myself, and I have become painfully aware of how often the "the free encyclopedia that anyone can edit" becomes "the encyclopedia in which every fact is just made up.") From a neutral point of view, is this really much of a problem in day-by-day computer use and online network use?
I'm not aware of any data formats for which that is the case, but from a theoretical standpoint, eval(s) is a perfectly cromulent decompression algorithm. This fact is essentially the starting point for Kolmogorov complexity.
"Reasonably-sized" is actually an interesting problem in itself. If your decompresser is sufficiently advanced, you could embed a busy-beaver function, which terminates but grows faster than any computable function. I have no idea whether such functions could be expressed with less-than-Turing-complete data formats.
$ truncate -s 17TB hugefile.dat
...which is just as pointless. $ time dd if=/dev/zero of=10MB.dat bs=1M count=10
real 0m0.213s
$ time dd if=/dev/urandom of=10MB.dat bs=1M count=10
real 0m8.873s $ dd if=/dev/zero of=/dev/null bs=1M count=100
104857600 bytes (105 MB) copied, 0.0237114 s, 4.4 GB/s
$ dd if=/dev/urandom of=/dev/null bs=1M count=100
104857600 bytes (105 MB) copied, 21.501 s, 4.9 MB/s
Also dammit Ubuntu with your Gibis.Old =/= everyone knows about it.
Your new account has rapidly got a bunch of down votes. HN likes constructive thoughtful comments. Aggressive comments, even if correct, will likely get down votes.
"Old as fuck" is going to be down voted to oblivion, and risks the account being hell-banned.
"This is very old. I'm surprised HN readers are not already aware of it" may get down votes (it doesn't add anything to the conversation) but will probably be tolerated.
"This is very old. Here are some similar things / here's the theory behind it / here's an example of more modern versions / etc" will probably get a few up votes.
HN probably benefits more from people visiting the New tab and up voting good stories (and flagging the spam) than from people posting comments like "Old as fuck" on items they don't like.
Welcome to HN! (Though I suspect with a username like Trool that yours is a throwaway account.)
If you knew about this.. you could have just ignored it and not waste your time commenting on it. Let it be useful for the n00bs (i.e. me).
So is algebra, and yet, every year millions of people learn it for the first time.