Ja vou exeplicar ...
Veja o seguinte teste ...
Crie um arquivo texto com qualquer texto.
pegue um arquivo zip ( qualquer arquivo )
No linux faça .. cat w1.zip >> texto.txt
No Windows .. type w1.zip >> texto.txt
O arquivo Zip será adicionado ao fim do arquivo texto.
Temos assim um arquivo de texto seguido de um arquivo ZIP.
Agora vamos testar o arquivo ...
root@siftworkstation:/tmp$ file texto.txt
a: data
root@siftworkstation:/tmp$ exiftool texto.txt
ExifTool Version Number : 9.60
File Name : texto.txt
Directory : .
File Size : 3.7 MB
File Modification Date/Time : 2014:08:26 12:21:42+00:00
File Access Date/Time : 2014:08:26 12:21:58+00:00
File Inode Change Date/Time : 2014:08:26 12:21:42+00:00
File Permissions : rw-r--r--
Error : Unknown file type
root@siftworkstation:/tmp$ ./trid texto.txt
TrID/32 - File Identifier v2.11 - (C) 2003-11 By M.Pontello
Definitions found: 5368
Analyzing...
Collecting data from file: texto.txt
Unknown!
Porem se voce tentar descompactar esse arquivo ...
root@siftworkstation:/tmp# unzip texto.txt
Archive: texto.txt
warning [texto.txt]: 98 extra bytes at beginning or within zipfile
(attempting to process anyway)
inflating: licence.txt
inflating: readme.txt
inflating: Arquivo.com
inflating: Arquivo.exe
O ZIP foi capaz de reconhecer que existia alguma coisa estranha no começo do arquivo e desconpacta-lo sem problemas.
Com PDF a situação é identica. Dependendo da "tag" adicionada ao começo do arquivo, as ferramentas acima não conseguem identificar o tipo correto e tudo falha.
Nesse caso 3 ferramentas que poderiam identificar os arquivos falharam...
Minha pergunta: Onde estamos falhando ? Estamos vendo só o obvio e esquecendo do resto ?
Alguem conhece alguma outra ferramenta de "deep inspection" de tipo de arquivo ?