Warning: file_put_contents(/datas/wwwroot/jiajiahui/core/caches/caches_template/2/default/show.php): failed to open stream: Permission denied in /datas/wwwroot/jiajiahui/core/libraries/classes/template_cache.class.php on line 55

Warning: chmod(): Operation not permitted in /datas/wwwroot/jiajiahui/core/libraries/classes/template_cache.class.php on line 56
iCMS后台do_query函数存在SQL注入漏洞 - 源码之家

iCMS后台do_query函数存在SQL注入漏洞

目录

该漏洞CNVD-ID: CNVD-2019-08479
漏洞提交CNVD后,待CNVD公示才发出本文。
测试环境:
程序版本:v7.0.14
Windows + firefox + burpsuite + apache2 + PHP5.6.27(phpStudy集成环境)
iCMS官网:https://www.icmsdev.com/

一、漏洞分析

/app/database/database.admincp.php模块
218行、223行、225行都存在同样的漏洞。
iCMS后台do_query函数存在SQL注入漏洞{$where}子句这里比较有意思,传入的必须是一个SQL的where语句,如POST参数: where=where id=1 , URL编码后是: where=where+id%3d1 。
如果只是传入POST参数如: where=1 或者 where=id%3d1 都是不行的。

二、漏洞测试

1、程序安装: http://localhost/install/index.php
2、登录管理后台
3、选择数据库管理
iCMS后台do_query函数存在SQL注入漏洞4、选择数据替换并填入相应的值
iCMS后台do_query函数存在SQL注入漏洞5、burpsuite拦截
iCMS后台do_query函数存在SQL注入漏洞6、将burpsuite拦截的内容复制到文本文件
iCMS后台do_query函数存在SQL注入漏洞7、用sqlmap来跑
Sqlmap命令:
python sqlmap.py -r d:\sqli.txt --dbms mysql --data “where=where+id%3d1” -p where –dbs
iCMS后台do_query函数存在SQL注入漏洞iCMS后台do_query函数存在SQL注入漏洞
由于盲注,大概需要二十来分钟出结果。