作者:alibaba
ctl.template.php :
function saveContent(){
if(strtolower(substr($_POST['file'],-4,4))=='.php') $_POST['file']='index.html';//只验证最后4位数
$this->begin('index.php?ctl=system/template&act=edit&p[0]='.$_POST['theme']);
$o = $this->system->loadModel('system/template');
$template=array(
'tpl_name'=>$_POST['file_name'],
'tpl_file'=>$_POST['file'],
'tpl_theme'=>$_POST['theme'],
'tpl_type'=>$_POST['type']
);
利用方法:
构造一个上传页面, 提交文件后缀为 .php5(linux) 或在 .php 后面加上一个空格(windows)就能绕过验证
这里附上4.8.4 及 4.8.5 两个不同版本的上传页面:
484-485.zip
成功上传后生成一句话后门 - http://站点/home/cache/t00ls-1.php5