Update README.md

This commit is contained in:
tardc 2020-04-22 19:04:42 +08:00
parent cdd2f87416
commit 49dbcc77b7
4 changed files with 43 additions and 11 deletions

View File

@ -1,18 +1,18 @@
# ThinkPHP 2.1 远程代码执行 # ThinkPHP 2.1 Remote Code Execution Vulnerability
ThinkPHP 诞生于 2006 年,是一个国产开源的 PHP 开发框架,其借鉴了 Struts 框架的 Action 对象,同时也使用面向对象的开发结构和 MVC 模式。ThinkPHP 可在 Windows 和 Linux 等操作系统运行,支持 MySql、Sqlite 和 PostgreSQL 等多种数据库以及 PDO 扩展,是一款跨平台,跨版本以及简单易用的 PHP 框架。 ThinkPHP was born in 2006, is a open source PHP development framework, which draws on the Action object of the Struts framework, and also uses the object-oriented development structure and MVC model. ThinkPHP can run on operating systems such as Windows and Linux. It supports multiple databases such as MySql, Sqlite, and PostgreSQL, and PDO extensions. It is a cross-platform, cross-version, and easy-to-use PHP framework.
ThinkPHP 2.1 版本中,使用 `preg_replace``/e` 模式匹配路由: In ThinkPHP version 2.1, `/e` pattern of `preg_replace` is used to match routes:
```php ```php
$res = preg_replace('@(\w+)'.$depr.'([^'.$depr.'\/]+)@e', '$var[\'\\1\']="\\2";', implode($depr,$paths)); $res = preg_replace('@(\w+)'.$depr.'([^'.$depr.'\/]+)@e', '$var[\'\\1\']="\\2";', implode($depr,$paths));
``` ```
这是个非常危险的参数,如果用了这个参数,`preg_replace` 的第二个参数就会被当做 PHP 代码执行。 This is a very dangerous parameter. If this parameter is used, the second parameter of `preg_replace` will be executed as PHP code.
**影响版本**ThinkPHP 2.1 **Affected version**: ThinkPHP 2.1
**[FOFA](https://fofa.so/result?qbase64=YXBwPSJUaGlua1BIUCI%3D) 查询规则**app="ThinkPHP" **[FOFA](https://fofa.so/result?qbase64=YXBwPSJUaGlua1BIUCI%3D) query rule**: app="ThinkPHP"
# Demo # Demo

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](https://fofa.so/result?qbase64=YXBwPSJUaGlua1BIUCI%3D) 查询规则**app="ThinkPHP"
# Demo
![](thinkphp_2.1.gif)

View File

@ -1,12 +1,12 @@
# ThinkPHP 5.x 远程代码执行漏洞 # ThinkPHP 5.x Remote Code Execution Vulnerability
ThinkPHP 诞生于 2006 年,是一个国产开源的 PHP 开发框架,其借鉴了 Struts 框架的 Action 对象,同时也使用面向对象的开发结构和 MVC 模式。ThinkPHP 可在 Windows 和 Linux 等操作系统运行,支持 MySQL、Sqlite 和 PostgreSQL 等多种数据库以及 PDO 扩展,是一款跨平台、跨版本以及简单易用的 PHP 框架。 ThinkPHP was born in 2006, is a open source PHP development framework, which draws on the Action object of the Struts framework, and also uses the object-oriented development structure and MVC model. ThinkPHP can run on operating systems such as Windows and Linux. It supports multiple databases such as MySql, Sqlite, and PostgreSQL, and PDO extensions. It is a cross-platform, cross-version, and easy-to-use PHP framework.
在 ThinkPHP 5 中,由于框架对控制器名没有进行足够的检测,会导致在没有开启强制路由的情况下的远程代码执行漏洞。 In ThinkPHP 5, because the framework does not perform sufficient detection on the controller name, it will lead to remote code execution without enabling mandatory routing.
**影响版本**ThinkPHP 5.x **Affected version**: ThinkPHP 5.x
**[FOFA](https://fofa.so/result?qbase64=YXBwPSJUaGlua1BIUCI%3D) 查询规则**app="ThinkPHP" **[FOFA](https://fofa.so/result?qbase64=YXBwPSJUaGlua1BIUCI%3D) query rule**: app="ThinkPHP"
# Demo # Demo

View File

@ -0,0 +1,13 @@
# ThinkPHP 5.x 远程代码执行漏洞
ThinkPHP 诞生于 2006 年,是一个国产开源的 PHP 开发框架,其借鉴了 Struts 框架的 Action 对象,同时也使用面向对象的开发结构和 MVC 模式。ThinkPHP 可在 Windows 和 Linux 等操作系统运行,支持 MySQL、Sqlite 和 PostgreSQL 等多种数据库以及 PDO 扩展,是一款跨平台、跨版本以及简单易用的 PHP 框架。
在 ThinkPHP 5 中,由于框架对控制器名没有进行足够的检测,会导致在没有开启强制路由的情况下的远程代码执行漏洞。
**影响版本**ThinkPHP 5.x
**[FOFA](https://fofa.so/result?qbase64=YXBwPSJUaGlua1BIUCI%3D) 查询规则**app="ThinkPHP"
# Demo
![](thinkphp_5.gif)