Wednesday, November 10, 2010

Paranoid Penguin - Information hidden inside of EXIF tagged images

So, this blog actually came about because of the newest 200th edition of @LinuxJournal. The article from LJ had something to do with what you use linux for. Option #51 was "Delete all the GPS location date from Images". Well, I saw that and got to thinking about how many people don't realize that GPS (among other information) is stored inside of an EXIF tagged image (JPEG, TIFF). Alas! a blog post on the very subject was born.

About EXIF


EXIF (exchangeable image file format) was created as a camera specification in 1998 and used by various camera manufactures (and now camera phones) to ‘tag’ image information including, but not limited to: Date and Time stamps, Camera settings, thumbnails, Descriptions and now GPS information. During my testing of EXIF data, I found that images taken with a camera had the following information by default:
* Camera Settings (Exposure, lens used, ISO, Make/Model, Sometimes the SN of the Camera and/or Lens, and Manufacturers information.
Images taken with a Camera phone usually had the above information, but included the phones make/model, Software version and GPS ‘tag’ of the image itself.

Concerns


What I believe is that some users of camera phone’s (as reflected by some example data that I had collected from images for this blog) have no clue just what is stored on their images when they upload that ‘awesome image of my new big screen TV at home’. So as to the title of this blog, paranoid penguin; I will be talking about just how much data is stored on those twitpic/facebook/lmnop image’s that people store. I think a main concern about these images is not only the Make/Model/SW Version of the phone being tagged in EXIF image’s (can you say phone exploits?) but also people that have inadvertently enabled GPS tagging of their images without realizing it. I’m pretty sure the guy who took an image of all his pot, didn’t want a GPS location tagged to his picture he uploaded!

Real-World Examples of Data Collected


As I stated earlier, I began this blog; curious about just how much information people inadvertently put out when they submit images. Because of this, I picked one of the most used image sharing sites for twitter, twitpic. I figured that people snap images of all sorts of strange stuff, and ‘tweet’ it to the world. For this test, I selected 9 random topics to search for; so that I wasn’t limiting myself to ‘latest images’. From those 9 random topics, I picked 10 random images for a total of 90 images. Below, is a table of information that I found relevant to this post.

Totals:
Total Images = 90
Total EXIF Images = 36
GPS Enabled Images = 14
Phones = 28
Camera’s = 8

Percentages:

% of Images w/ EXIF Data = 40%
% of GPS EXIF Images = 50%
% of Phones = 77%
% of Camera’s = 23%

So, in a nutshell, almost half of the images uploaded to twitpic had useful EXIF data, and out of those; HALF, yes HALF of those images had GPS information on it. And like I said earlier; I’m pretty sure the author didn’t really want to broadcast to the world where they took that picture within 15meters (GPS). This can only be explained by the lack of knowledge when it comes to enabling/disabling GPS tagging of images.

Software to read EXIF Data

There is actually an excellent set of software that read’s EXIF (among other image tagged) data. I have used this application for many years to not only strip data that I didn’t want published, but also to read Date/Time stamps of images where I had taken a picture and couldn’t remember when I took it (family photo album). This tool is ExifTool, created by Phil Harvey. You can find information, and download the utility from here: http://www.sno.phy.queensu.ca/~phil/exiftool/

*If you just want to read EXIF data from firefox, there is an excellent plugin called ‘Exif Viewer’. Simple to use, just right-click on an image and view EXIF tag.

Okay, so lets get to installing-configuring this beast, if you don’t have a package manager of your choice (fedora seems to be: perl-Image-ExifTool, debian shows the package as libimage-exiftool-perl). Then you need to go to http://www.sno.phy.queensu.ca/~phil/exiftool/ and download, perl make, make install the package. Once you have successfully installed the exiftool utility; navigate to your favorite directory of photos.

Viewing Image data


Now, because exiftool’s help file is miles long, there are all sorts of different way’s to view whatever you want to with this utility. And because there are different ways to view this data, I will just tell you what I use to view the most data; you can read the help file later and tailor it to your specific needs.

1. From the directory of your photos execute the following:
exiftool -a -u -g1 filename.extension

What the switches do is the following:
-a = allow duplicate tag names in output
-u = extract unknown tags
-g1 = Organize output by tag group
And there you have it, once you execute the exiftool application, you should see all sorts of information from your photo (provided it’s a .jpg or .tiff image, and there is EXIF data to view).


Deleting EXIF Data


So what about all that pesky GPS data? Now that you have gone through all your photos and realized that some of those images that you took, probably shouldn’t have been tagged with GPS data; now what? Well, that’s where exiftool comes in with a simple one-liner, you can remove your GPS tagged data from both images or directories with the following command:
exiftool -geotag= file-or-directory-name
or
exiftool -a -gps:all -file-or-directory-name

-geotag will remove the Geotagged information (as some cellphones put it into a geotag container) but -a -gps:all will remove all GPS information. By running exiftool -a -u -g1 filename.extension after executing your gps removal switch, you can verify that the data has been removed successfully.

Tada! that’s it, now your images have been successfully purged of GPS tagging. But what about other stuff? What if you don’t want someone to know just what kind of phone you are using? After all, we can’t be too paranoid when it comes to paranoid penguins and security.
exiftool -Make= -Model= file-or-directory-name

Are you starting to see a pattern here? By adding a - to the beginning of what you want to delete and/or modify, you change the exif information. For instance, if you wanted to change the make and model (thus further confusing people, no other real purpose); you would do the following:
exiftool -Make=Ford -Model=Mustang file-or-directory-name

And now your image was taken with a Ford Mustang. As you can see, it’s pretty easy to modify and remove information in an EXIF tagged image.

Modify GPS Tagged image


Not only can we delete sensitive information from an image, but we can also modify it. What purpose does this serve? I honestly see no reason to modify GPS data in an EXIF image, other than for giggles. In the past, I have modified information tagged in EXIF format such as date/time stamping (sometimes copying over images from my old blackberry would re-stamp the image, thus screwing with my online family photo album); and other information that I felt was incorrect.

But what if you really want to mess around? How about this one?
exiftool -exif:gpslatitude=”-62.383333” filename.jpg
exiftool -exif:gpslongitude="-58.45" filename.jpg


With this little change, your summer vacation photos appear to have been taken on the northern peninsula in Antarctica. There are all sorts of things you can do with modifying GPS data. Now with being paranoid aside, you can actually use this to later on ‘tag’ your images from vacation, so that you can add valid GPS information to your pictures.

Conclusion

So, as you can see; there is all sorts of information tagged in jpg/tiff photos that you put up on the internet. Some people are aware, and embrace the ability to geotag every image that they take; and yet some people probably had no clue that their images were being tagged with ‘sensitive’ information when they uploaded their latest images to various social media sites.

No comments:

Post a Comment