We will be designing a Perl program to extract metadata in which we will be using a new Perl module,
Image::ExifTool. We will also be using the
LWP::UserAgent Perl module to convert GPS coordinates into detailed location information using Google's GPS API. Let's jump right in and analyze the code in sections. After this, we will run the code listed next using a few files found on our client target's web server:
#!/usr/bin/perl -w use strict; use Image::ExifTool qw(:Public); use LWP::UserAgent; my $usage = "Usage: ./mdextract <file name>"; my $file = shift or die $usage; my $exifTool = new Image::ExifTool; my $info = $exifTool->ImageInfo($file); my $group = ""; # which group to get data from my $gpsCheck = ""; # should we resolve ...