Introduction


Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;” />
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>Due to the way different file types are read it is possible to have a single file that acts differently depending on how it is read. For example images are read from the header down whereas ZIP files are read from the footer up.

Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;” />
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>All image files should work, but some are more unpredictable that others. GIFs seem to be the most reliable so this tutorial will be using them in the examples (plus who doesn’t love looping GIFs of The Simpsons).

How to create one


Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;” />
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>Firstly get hold of an image you want to hide the data in (example image.gif), then gather all your files you want to hide and put them in a ZIP (example secret.zip).

Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;” />
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>Our chosen image:

Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;margin:0;outline:0;padding:0;text-align:center;vertical-align:baseline;”>up_8ed8c952fb9661d67dee049771538f2b.jpg


Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;” />
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>Windows 7:
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>Shift+right click in the folder containing the files will open command prompt in that directory
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>Windows:
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>Open command prompt (start->run cmd), then use cd to get to the folder where the files are stored.
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>Linux:
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>You know what to do, open terminal and move to directory containing files.

Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;” />
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>We now need to merge these files together, but we want to use a binary merge to keep the two files intact. With Windows copy command this uses the /B switch.

Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;” />
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>WindowsUbuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>

Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;margin:10px 0;outline:0;padding:0;text-align:justify;vertical-align:baseline;”>

Code:
copy /B image.gif+secret.zip newfile.gif

Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>LinuxUbuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>

Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;margin:10px 0;outline:0;padding:0;text-align:justify;vertical-align:baseline;”>

Code:
cat image.gif secret.zip > newfile.gif


Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;” />
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>You should now have gained a new file called newfile.gif. This should look identical to the image you started with when opened with an image viewer, but with a secret payload hidden within. Here is the example image containing a ZIP:

Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;margin:0;outline:0;padding:0;text-align:center;vertical-align:baseline;”>up_f718f0449e97fa67de97cf8bd1b833d4.jpg


Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;” />
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>The two simplest ways to get your data back out of these files is to either change the extension from .gif to .zip or to open your chosen ZIP program and open newfile.gif within that. You should now be presented with your original files.

Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;” />
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>This is clearly not a secure way to store your data but as a quick and dirt solution to hide files it works well enough. If you are storing text documents in the ZIP then the contents of them will still be visible in a HEX editor looking at newfile.gif. There are much better steganography tools that use encryption keys to securely store your data within other files.

Further reading


Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;” />
Ubuntu, ‘Helvetica Neue’, Arial, Helvetica, Verdana, sans-serif;font-size:12px;line-height:16.1875px;text-align:justify;”>This same technique can be adapted to upload executable code inside images such as PHP images and Graphics Interchange Format Java Archives (G
IFAR).

What Do You Think on This ? Say Here