Created
July 18, 2009 22:07
-
-
Save dap/149704 to your computer and use it in GitHub Desktop.
Store PHP code in a GIF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# write_gif.pl - Store PHP code inside of a GIF | |
# Darian Anthony Patrick <[email protected]> | |
# | |
# Demonstration of masquerading PHP code inside | |
# of a file identifiable as GIF format | |
use perl5i; | |
use IO::All; | |
#Create "GIF image data, version 89a" magic patterns | |
my $pat = "GIF89a"; | |
# Output magic patterns followed by PHP code | |
io('/tmp/this_contains_php.gif')->print( | |
$pat, | |
'<?php echo "\nThis output is from PHP code stored inside of a \"GIF\".\n"; ?>' | |
); | |
say 'Completed "GIF" creation.'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment