4 ms·
For the curious: jpg's are interpreted from the beginning, zip's from the end, so "cat image.jpg archive.zip > doublefile" will make you one of these 'magic' fi
by michaelfairley 17y ago
For the curious: jpg's are interpreted from the beginning, zip's from the end, so "cat image.jpg archive.zip > doublefile" will make you one of these 'magic' files.
- deleted 17y ago[deleted]
- alextp 17y agoIf you're in linux you can just type that into a shell and it will work. What it does (and you can emulate in other OSs) is concatenate the bytes of the jpeg file with the bytes of the zip file and save them as one huge blob, which will be readable as either of those.
- jayliew 17y agoInteresting .. looks like *nix 'file' command reads from start to end, so it detects it as JPG. [09:55:38] jliew@ssdstrdev1:~/malcode $ file some.jpg some.jpg: JPEG image data, JFIF standard 1.01 [09:55:45] jliew@ssdstrdev1:~/malcode $ file some.zip some.zip: Zip archive data, at least v2.0 to extract [09:55:47] jliew@ssdstrdev1:~/malcode $ cat some.jpg some.zip > concat [09:57:14] jliew@ssdstrdev1:~/malcode $ file concat concat: JPEG image data, JFIF standard 1.01 [09:57:21] jliew@ssdstrdev1:~/malcode $ whatis file file (1) - determine file type
- NikkiA 17y ago'file' doesn't really read in any specific direction, it just uses a set of rules defined in /etc/magic or /usr/share/file/magic.* (there are compiled binary forms too, now) The rules can specify any offset for a magic file identifier, or set of identifiers. What determines what file will report, in cases like this, is really more a case of which order the rules are checked in.
- ramchip 17y agoEmbedding rar files in images is an old 4chan tradition. Under windows: copy /b in.jpg + in.rar out.jpg