PHP - preg_replace()

Read flag.php.

 

 

 / E Mode: replace the contents of the string code to perform as

Official documentation on modifier / e is deprecated:

 https://www.php.net/manual/zh/reference.pcre.pattern.modifiers.php#reference.pcre.pattern.modifiers.eval

  If this modifier is deprecated, preg_replace () is performed for a reference string after the replacement, the replacement string will be replaced after evaluation performed as php code (eval function mode), and using as the result of execution actual participation replacement string. Single double quotation marks, backslash (\) and NULL characters are escaped to the reference time after the replacement with a backslash.
  For example:

   

  While the strings are replaced, which also performs the function strtoupper

It should therefore pass php instruction read flag.php

Three parameters are:
  $ pattern: pattern to search for, can be a string or an array of strings.
  $ replacement: a string or array of strings replaced.
  $ subject: To search the target string or array of strings replaced.
I began to try to use the system command function

   

 

 Or read directly with file_get_contents

  

Guess you like

Origin www.cnblogs.com/abbin-blog/p/12161610.html