If you think that's cool, look at Daeken's Magister: http://demoseen.com/windowpane/magister.png.html A PNG that's interpreted as HTML and loads itself as compressed JavaScript!
Note: Chrome or Firefox with WebGL required. I also wrote an article on how I got this down to 1kb, http://daeken.com/superpacking-js-demos , and just released a new demo based on the same techniques (747 bytes): http://demoseen.com/windowpane/nufl0wer.png.html
A file that's both an acceptable HTML page and a JPEG (view source on it)
31–40 of 133 posts
Re: A file that's both an acceptable HTML page and a JPEG (view source on it)
#32Looks more like a chipmunk to me.
Re: A file that's both an acceptable HTML page and a JPEG (view source on it)
#33Re: A file that's both an acceptable HTML page and a JPEG (view source on it)
#34I don’t have GraphicsMagick installed on this machine, else I would try this: $ gm convert http://lcamtuf.coredump.cx/squirrel/ -comment '' x.jpg …and… $ gm identify -format '%c' http://lcamtuf.coredump.cx/squirrel/
Re: A file that's both an acceptable HTML page and a JPEG (view source on it)
#35Any practical use for this or just for fun?
Re: A file that's both an acceptable HTML page and a JPEG (view source on it)
#36Earlier quoted context omitted.
Another one is Matraka: http://www.p01.org/releases/MATRAKA/matraka.png.html
Matraka is seriously worth a watch. All 2d canvas, and it actually has music in a 1k. What's funny is that p01 is the reason I got into web demo development, and he's actually using the png technique I came up with. Makes me proud to be a hacker. Edit: It also won a much-deserved first place in the DemoJS 1k compo.
EDIT: Oh, okay. It's not a valid PNG. That would have been all sorts of incredible. Still great, though.
Re: A file that's both an acceptable HTML page and a JPEG (view source on it)
#37If you think that's cool, look at Daeken's Magister: http://demoseen.com/windowpane/magister.png.html A PNG that's interpreted as HTML and loads itself as compressed JavaScript!
Re: A file that's both an acceptable HTML page and a JPEG (view source on it)
#38Can someone explain what is going on here?
The file has been created in such a way that the web browser is ignoring the non-html parts of the document, while the image renderer is ignoring the parts that make up the html page. The first part probably isn't too hard, since most web browsers go to great lengths to render non-standard html in a sensible way, I'm not too sure about the second part. I'm guessing the jpeg spec has some variable length space in some…
Re: A file that's both an acceptable HTML page and a JPEG (view source on it)
#39Perhaps I don't know enough about how this works, but couldn't you use this to inject runnable javascript in to a page? If this is possible it's pretty scary as it would allow you to upload a hidden payload in to an otherwise innocent looking image.
I was able to add javascript code in there and it executed properly, but the browser won't parse the jpg as html unless I give it a .html filename extension. I don't see how this could be easily exploitable.
I think a similar exploit was used recently with .svg images - they can contain javascript (being XML) which will be executed by the browser. Not sure about the details however.