Add ThinkPHP2.1_RCE

This commit is contained in:
tardc 2020-04-14 11:48:32 +08:00
parent 2c975828b2
commit 60af9e899d
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# ThinkPHP 2.1 远程代码执行
ThinkPHP 诞生于 2006 年,是一个国产开源的 PHP 开发框架,其借鉴了 Struts 框架的 Action 对象,同时也使用面向对象的开发结构和 MVC 模式。ThinkPHP 可在 Windows 和 Linux 等操作系统运行,支持 MySql、Sqlite 和 PostgreSQL 等多种数据库以及 PDO 扩展,是一款跨平台,跨版本以及简单易用的 PHP 框架。
ThinkPHP 2.1 版本中,使用 `preg_replace``/e` 模式匹配路由:
```php
$res = preg_replace('@(\w+)'.$depr.'([^'.$depr.'\/]+)@e', '$var[\'\\1\']="\\2";', implode($depr,$paths));
```
这是个非常危险的参数,如果用了这个参数,`preg_replace` 的第二个参数就会被当做 PHP 代码执行。
影响版本ThinkPHP 2.1
FOFA 查询规则app="ThinkPHP"
# Demo
![](thinkphp_2.1.gif)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB