Computer forensics - as analyzed, Edit, or delete metadata with ExifTool

The files that we store, create, and manage on a daily basis from our devices hidden inside data that most users are unaware; Today we will learn how to find them, edit them, or delete them with the tool ExifTool.

These are called metadata, and they are used to manage files within the system among other things, an example would be the hour and the minute of the last edition, the model of the camera that took a photograph, the geographic location from where it was taken the image using coordinates GPS, or to know that software has used the user for its creation or editing.

metadato_pagina

Has been given more than one case in which the metadata they have played tricks, for example the case of the defacer that hung a photo of the neckline of his girlfriend in the front page of the web hacking, without removing the coordinates GPS the image he had taken with his “brand new” IPhone; or the presumed editing by the fiscal anti corruption of the defense strategy of the infanta in the Noos case in their favor.

This article is not intended for that kind of people, but for those who live in oppressive regimes, whether these Westerners or not; but I'm not going to be responsible for the misuse that can be given, because I strongly believe in free information.

Now that I've already explained very up are the metadata, and some examples of cases that could harm us; whether you're a corrupt politician, a drug dealer or an activist pursued by your Government, These are the packages that you install on your system to proceed to examine, Edit, or delete the metadata of your files.

#Instalamos los paquetes necesarios.
usuario@maquina:~$ sudo apt-get install libimage-exiftool-perl exiftool

As an example we will use documents and files of different formats, to become familiar with the different types of files and the metadata it contain.

FormatosArchivos

For this test I have used the first PDF that appeared in the associated google results to the website of the social security, and some pictures of the blog.

As always do in this series of tutorials on Computer forensics, I will explain the options of ExifTool that I have used for this practice.

-EXIF:Tag =”ValorMetadato” route -> Creates or changes the value of a metadata, or several of them if we chained that order.

-all = path -> Deletes all the contents of the directory metadata, or files that you indicate as route; We can also chain this order.

We can access the application manual to see all your options and the long list of available formats.

usuario@maquina:~$ man exiftool

I've grouped all these files in a directory named “Analyze“, and to extract the metadata give you directly to ExifTool as a reference this directory, to carry out its task recursively.

usuario@maquina:~$ exiftool /home/usuario/Escritorio/Analizar

======== /home/usuario/Escritorio/Analizar/rele.jpg
ExifTool Version Number : 9.46
File Name : rele.jpg
Directory : /home/usuario/Escritorio/Analizar
File Size : 46 kB
File Modification Date/Time : 2014:10:11 11:27:26+02:00
File Access Date/Time : 2015:01:29 15:09:51+01:00
File Inode Change Date/Time : 2015:01:29 15:09:54+01:00
File Permissions : rw-rw-r--
File Type : JPEG
MIME Type : image/jpeg
JFIF Version : 1.01
Resolution Unit : None
X Resolution : 1
Y Resolution : 1
Image Width : 500
Image Height : 500
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 500x500

======== /home/usuario/Escritorio/Analizar/images.jpg
ExifTool Version Number : 9.46
File Name : images.jpg
Directory : /home/usuario/Escritorio/Analizar
File Size : 3.5 kB
File Modification Date/Time : 2015:01:17 03:55:00+01:00
File Access Date/Time : 2015:01:28 12:37:48+01:00
File Inode Change Date/Time : 2015:01:28 12:17:08+01:00
File Permissions : rw-r-----
File Type : JPEG
MIME Type : image/jpeg
JFIF Version : 1.01
Resolution Unit : None
X Resolution : 1
Y Resolution : 1
Image Width : 176
Image Height : 175
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 176x175

======== /home/usuario/Escritorio/Analizar/07e716f.jpg
ExifTool Version Number : 9.46
File Name : 07e716f.jpg
Directory : /home/usuario/Escritorio/Analizar
File Size : 8.8 kB
File Modification Date/Time : 2015:01:16 03:06:07+01:00
File Access Date/Time : 2015:01:28 19:09:55+01:00
File Inode Change Date/Time : 2015:01:29 15:09:25+01:00
File Permissions : rw-rw-r--
File Type : JPEG
MIME Type : image/jpeg
JFIF Version : 1.02
Resolution Unit : None
X Resolution : 1
Y Resolution : 1
Image Width : 200
Image Height : 200
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 200x200

======== /home/usuario/Escritorio/Analizar/51873.pdf
ExifTool Version Number : 9.46
File Name : 51873.pdf
Directory : /home/usuario/Escritorio/Analizar
File Size : 1560 kB
File Modification Date/Time : 2015:01:28 12:17:51+01:00
File Access Date/Time : 2015:01:28 12:18:13+01:00
File Inode Change Date/Time : 2015:01:28 12:18:03+01:00
File Permissions : rw-r-----
File Type : PDF
MIME Type : application/pdf
PDF Version : 1.6
Linearized : Yes
Tagged PDF : Yes
XMP Toolkit : 3.1-701
Modify Date : 2007:06:13 12:32:30+02:00
Create Date : 2007:06:13 12:32:30+02:00
Metadata Date : 2007:06:13 12:32:30+02:00
Creator Tool : Acrobat PDFMaker 7.0 para Word
Format : application/pdf
Title : Microsoft Word - Portadilla.doc
Creator : silueta
Document ID : uuid:97297a7a-7be0-4442-9be3-312d61af12ca
Instance ID : uuid:0f43e865-863e-495e-8f6a-412686987385
Producer : Acrobat Distiller 7.0 (Windows)
Page Count : 121
Author : silueta

 1 directories scanned
 4 image files read

Let's How to add a label with its corresponding metadata to a document; We must bear in mind that No we can invent labels, they should be which allows ExifTool.

#Ejemplo de error por etiqueta inexistente.
usuario@maquina:~$ exiftool -exif:Propietario="Peatonet" /home/usuario/Escritorio/Analizar/images.jpg

Warning: Tag 'Propietario' does not exist
Nothing to do.

#Modificamos el valor del metadato referente a la etiqueta "Copyright".
usuario@maquina:~$ exiftool -exif:Copyright="www.peatonet.com" /home/usuario/Escritorio/Analizar/images.jpg

 1 image files updated

#Modificamos el valor del metadato referente a las etiquetas "gpslatitude", "gpslongitude", y "gpslatituderef, para cambiarlo por las coordenadas de la CIA en google maps.
usuario@maquina:~$ exiftool -exif:gpslatitude="38.951206600" /home/usuario/Escritorio/Analizar/images.jpg -exif:gpslatituderef=S -exif:gpslongitude="-77.151290800"

1 image files updated

We now proceed to extract image metadata to verify that the changes we have made have been applied; to change a metadata We would do it the same way we used to create it, and the new overwrites the old.

usuario@maquina:~$ exiftool /home/usuario/Escritorio/Analizar/images.jpg

ExifTool Version Number : 9.46
File Name : images.jpg
Directory : /home/usuario//Escritorio/Analizar
File Size : 3.7 kB
File Modification Date/Time : 2015:01:30 14:19:27+01:00
File Access Date/Time : 2015:01:30 14:19:27+01:00
File Inode Change Date/Time : 2015:01:30 14:19:27+01:00
File Permissions : rw-r-----
File Type : JPEG
MIME Type : image/jpeg
Exif Byte Order : Big-endian (Motorola, MM)
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Y Cb Cr Positioning : Centered
Copyright : www.peatonet.com
GPS Version ID : 2.3.0.0
GPS Latitude Ref : South
GPS Longitude : 77 deg 9' 4.65"
Image Width : 176
Image Height : 175
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
GPS Latitude : 38 deg 57' 4.34" S
Image Size : 176x175
GPS Position : 38 deg 57' 4.34" S, 77 deg 9' 4.65"

Finally learn to delete all the metadata of a file is the format that is; as in the first example that we learned to extract them, We are going to do it pointing to the directory recursivelyAnalyze“.

usuario@maquina:~$ exiftool -all= /home/usuario/Escritorio/Analizar/

 1 directories scanned
 4 image files updated

To conclude, we will review the changes have been applied correctly; When editing, modify, or delete a metadata, If it is not possible to delete the tag you assigned a value by default, in the case of the time it would be the current.

usuario@maquina:~$ exiftool /home/usuario/Escritorio/Analizar/

======== /home/usuario/Escritorio/Analizar/rele.jpg
ExifTool Version Number : 9.46
File Name : rele.jpg
Directory : /home/usuario/Escritorio/Analizar
File Size : 46 kB
File Modification Date/Time : 2015:01:29 15:18:24+01:00
File Access Date/Time : 2015:01:29 15:18:27+01:00
File Inode Change Date/Time : 2015:01:29 15:18:24+01:00
File Permissions : rw-rw-r--
File Type : JPEG
MIME Type : image/jpeg
Image Width : 500
Image Height : 500
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 500x500

======== /home/usuario/Escritorio/Analizar/images.jpg
ExifTool Version Number : 9.46
File Name : images.jpg
Directory : /home/usuario/Escritorio/Analizar
File Size : 3.5 kB
File Modification Date/Time : 2015:01:29 15:18:24+01:00
File Access Date/Time : 2015:01:29 15:18:27+01:00
File Inode Change Date/Time : 2015:01:29 15:18:24+01:00
File Permissions : rw-r-----
File Type : JPEG
MIME Type : image/jpeg
Image Width : 176
Image Height : 175
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 176x175

======== /home/usuario/Escritorio/Analizar/07e716f.jpg
ExifTool Version Number : 9.46
File Name : 07e716f.jpg
Directory : /home/usuario/Escritorio/Analizar
File Size : 8.8 kB
File Modification Date/Time : 2015:01:29 15:18:24+01:00
File Access Date/Time : 2015:01:29 15:18:27+01:00
File Inode Change Date/Time : 2015:01:29 15:18:24+01:00
File Permissions : rw-rw-r--
File Type : JPEG
MIME Type : image/jpeg
Image Width : 200
Image Height : 200
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 200x200

======== /home/usuario/Escritorio/Analizar/51873.pdf
ExifTool Version Number : 9.46
File Name : 51873.pdf
Directory : /home/usuario/Escritorio/Analizar
File Size : 1560 kB
File Modification Date/Time : 2015:01:29 15:18:24+01:00
File Access Date/Time : 2015:01:29 15:18:27+01:00
File Inode Change Date/Time : 2015:01:29 15:18:24+01:00
File Permissions : rw-r-----
File Type : PDF
MIME Type : application/pdf
PDF Version : 1.6
Linearized : No
Tagged PDF : Yes
Page Count : 121

 1 directories scanned
 4 image files read

After cleaning a file is the format that is, ExifTool you will create next to this other file called “nombrearchivo_original” What contains the metadata that we have eliminated; If we want to effectively remove that file We can make it through Wipe as we saw in the previous entry about Computer forensics.

If you like you can follow me on Twitter, Facebook, Google +, LinkedIn, or share it with the buttons under this publication, If you have any questions or suggestions please do not hesitate to comment.

Help us to reach more readers Share on LinkedInShare on FacebookTweet about this on TwitterShare on Google+Email this to someone

Leave a Reply