O'Reilly logo

Penetration Testing with Perl by Swizec Teller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Metadata extractor

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required