File Headers

We have often seen different file formats with various extensions of their own. But, did you know that without knowing the file extension you could know what file it is by simply looking inside the file.

This technique of looking into file and knowing the extension is very useful for security researchers or forensic investigators looking for hidden information in files.

File Header is one of the ways to find what type of we are looking at. A File Header is the metadata of the file which is used to identify type of encryption used i.e. file format or extension.

The technique of finding hidden file extensions is given below–

Firstly take the file,

I have a file called picture.jpg

wordpress8

-> Try to open the file normally by using different applications like media player, VLC, photos (win10), etc.

wordpress9

-> It doesn’t support this file format. That means the file is not an image which can be opened by the application.

-> Now rename the file extension to .txt, irrespective of the file format it is in.

-> After renaming the file open the .txt file with notepad. It will be something like this,

wordpress10

-> Now notice the first letters here it is PK. This is known as the file header of the file. From this header we can file what type of file it is. For finding the file type visit this list of headers File_Signatures. From that we got to know that PK means zip file.

wordpress11

-> So now rename the file to .zip and you will get the file opened.

wordpress 11

This is the way to open unknown file types easily. For more info read about file signatures in Wikipedia.

Leave a comment