{"id":721,"date":"2014-07-24T03:26:17","date_gmt":"2014-07-24T03:26:17","guid":{"rendered":"http:\/\/ixyzero.com\/blog\/?p=721"},"modified":"2014-07-24T03:26:17","modified_gmt":"2014-07-24T03:26:17","slug":"tsrc%e6%8c%91%e6%88%98%e8%b5%9b%ef%bc%9aphp%e5%9c%ba%e6%99%af%e4%b8%adgetshell%e9%98%b2%e5%be%a1%e6%80%9d%e8%b7%af%e5%88%86%e4%ba%ab","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/721.html","title":{"rendered":"TSRC\u6311\u6218\u8d5b\uff1aPHP\u573a\u666f\u4e2dgetshell\u9632\u5fa1\u601d\u8def\u5206\u4eab"},"content":{"rendered":"<h1 style=\"color: #333333;\">1\u00a0\u00a0\u00a0\u00a0\u80cc\u666f\u6982\u8ff0<\/h1>\n<p style=\"color: #333333;\">WEB\u5e94\u7528\u6f0f\u6d1e\u5bfc\u81f4\u7684\u5165\u4fb5\u65f6\u6709\u53d1\u751f\uff0c\u626b\u63cf\u5668\u548cWAF\u5e76\u4e0d\u80fd\u89e3\u51b3\u6240\u6709\u7684\u95ee\u9898\uff0c\u4e8e\u662f\u5c1d\u8bd5\u5728\u4e3b\u673a\u4fa7\u9488\u5bf9PHP\u73af\u5883\u505a\u4e86\u4e00\u4e2a\u9632\u5fa1\u65b9\u6848\u3002\u5f88\u8363\u5e78\u7684\u9080\u8bf7\u5230TSRC\u90e8\u5206\u767d\u5e3d\u5b50\u505a\u4e86\u4e00\u6b21\u5bf9\u6297\u6f14\u4e60\uff0c\u672c\u6587\u4e3b\u8981\u5206\u4eab\u4e00\u4e0b\u9632\u5fa1\u601d\u8def\u3002<\/p>\n<p style=\"color: #333333;\">\u9632\u5fa1\u65b9\u6848\u4e3b\u8981\u60f3\u89e3\u51b3\u7684\u95ee\u9898\u662fgetshell\u3001\u4e3b\u673a\u654f\u611f\u6587\u4ef6\u6cc4\u6f0f\u7b49\u95ee\u9898\u3002\u4e8e\u662f\u4e4e\u51fa\u4e86\u4e0b\u9762\u8fd9\u6837\u4e00\u4e2a\u9898\u76ee\uff1a\u90e8\u7f72\u4e86\u9632\u5fa1\u65b9\u6848\u7684Nginx + PHP \u7684WEB\u73af\u5883\uff0c\u63d0\u4f9b\u4e00\u4e2a\u4e0a\u4f20\u5165\u53e3\uff0c\u53ef\u4e0a\u4f20\u4efb\u610f\u6587\u4ef6\u3002\u627e\u5230WEB\u76ee\u5f55\u4e0b\u7684\u4e00\u4e2aflag\u6587\u4ef6\u8bfb\u53d6\u5230\u5185\u5bb9\u5373\u7b97\u7a81\u7834\u3002<\/p>\n<h1 style=\"color: #333333;\">2\u00a0\u00a0\u00a0\u00a0PHP\u6269\u5c55<\/h1>\n<p style=\"color: #333333;\">\u9632\u5fa1\u65b9\u6848\u4f7f\u7528\u4e86PHP\u6269\u5c55\u6765\u5b8c\u6210\u963b\u65ad\u3002PHP\u5185\u6838\u652f\u6301C\/C++\u5f00\u53d1\u4e00\u4e9b\u6269\u5c55\u529f\u80fd\uff0c\u5e76\u4e14\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6846\u67b6 &#8211; ext_skel\u5e2e\u52a9\u751f\u6210\u57fa\u672c\u7684\u4ee3\u7801\u7b80\u5316\u5f00\u53d1\uff0c\u7531\u4e8ePHP\u6269\u5c55\u5e76\u4e0d\u6d89\u53ca\u5e95\u5c42\u7684\u8d44\u6e90\u7ba1\u7406\uff0c\u6240\u4ee5\u7f16\u5199\u4e00\u4e2aPHP\u6269\u5c55\u548c\u7f16\u5199\u4e00\u4e2aC\u5e94\u7528\u7a0b\u5e8f\u662f\u4e00\u6837\u7684\u3002\u4e0b\u56fe\u5c55\u793a\u4e86PHP\u6269\u5c55\u6240\u5904\u7684\u7ed3\u6784\u5c42\u6b21\uff0c\u6269\u5c55\u4f4d\u4e8ePHP\u5185\u6838ZEND \u548c PHP\u5e94\u7528\u5c42\u4ee3\u7801\u4e4b\u95f4\uff0c\u90a3\u4e48<span style=\"color: rgb(255, 0, 0);\">\u5229\u7528PHP\u6269\u5c55\u53ef\u4ee5<\/span>\uff1a<\/p>\n<p style=\"color: #333333;\">1) \u76d1\u63a7PHP\u5e94\u7528\u5c42\u4ee3\u7801\u7684\u6267\u884c\u7ec6\u8282\uff0c\u5305\u62ec\u6267\u884cCGI\u3001\u51fd\u6570\u540d\u3001\u53c2\u6570\u7b49\uff1b<\/p>\n<p style=\"color: #333333;\">2) \u8c03\u7528PHP\u5185\u6838ZEND\u63d0\u4f9b\u7684API\u63a5\u53e3\uff0c\u5305\u62ec\u7981\u7528\u7c7b\u3001\u4fee\u6539\u914d\u7f6e\u9009\u9879\u7b49\u3002<\/p>\n<p style=\"color: #333333;\"><a href=\"http:\/\/ixyzero.com\/blog\/wp-content\/uploads\/2014\/07\/php_arch.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-722\" src=\"http:\/\/ixyzero.com\/blog\/wp-content\/uploads\/2014\/07\/php_arch-300x140.png\" alt=\"php_arch\" width=\"300\" height=\"140\" \/><\/a><\/p>\n<p style=\"color: #333333;\">\u56fe1\u00a0PHP\u8bed\u8a00\u7684\u7ed3\u6784<\/p>\n<h1 style=\"color: #333333;\">3 \u00a0 \u00a0\u76f8\u5173\u77e5\u8bc6<\/h1>\n<h2 style=\"color: #333333;\">3.1\u00a0\u00a0HOOKPHP\u4ee3\u7801<\/h2>\n<p style=\"color: #333333;\">PHP\u662f\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u4ee3\u7801\u88ab\u7ffb\u8bd1\u4e3a\u4e2d\u95f4\u5b57\u8282\u7801\u7531ZEND\u5f15\u64ce\u89e3\u6790\u6267\u884c\u3002PHP\u628a\u4e2d\u95f4\u5b57\u8282\u7801\u79f0\u4e4b\u4e3aOPCODE\uff0c\u6bcf\u4e2aOPCODE\u5bf9\u5e94ZEND\u5e95\u5c42\u7684\u4e00\u4e2a\u5904\u7406\u51fd\u6570\uff0cZEND\u5f15\u64ce\u6700\u7ec8\u6267\u884c\u8fd9\u4e2a\u5904\u7406\u51fd\u6570\u3002\u5b9e\u73b0HOOK\u529f\u80fd\u53ea\u9700\u8981\u6539\u53d8HOOK OPCODE\u5bf9\u5e94\u7684\u5904\u7406\u51fd\u6570\u5373\u53ef\uff0c\u800cZEND\u9884\u5148\u5c31\u63d0\u4f9b\u4e86\u4e00\u4e2a\u73b0\u6210\u7684\u63a5\u53e3\uff1azend_set_user_opcode_handler\u3002\u9632\u5fa1\u65b9\u6848\u53ea\u9700\u8981HOOK\u4ee5\u4e0b\u4e09\u4e2aOPCODE\uff1a<\/p>\n<p style=\"color: #333333;\">ZEND_INCLUDE_OR_EVAL\u00a0\u2014 eval\u3001require\u7b49<\/p>\n<p style=\"color: #333333;\">ZEND_DO_FCALL\u00a0\u2014 \u51fd\u6570\u6267\u884csystem\u7b49<\/p>\n<p style=\"color: #333333;\">ZEND_DO_FCALL_BY_NAME\u00a0\u2014 \u53d8\u91cf\u51fd\u6570\u6267\u884c $func = \u201csystem\u201d;$func();<\/p>\n<p style=\"color: #333333;\">\u4e3e\u4f8b\uff1a<\/p>\n<p style=\"color: #333333;\">ZEND_DO_FCALL\u8fd9\u4e2aOPCODE\u5bf9\u5e94\u7684\u529f\u80fd\u662f\u51fd\u6570\u8c03\u7528\uff0c\u5982\u679c\u9700\u8981HOOK\u6240\u6709\u7684\u51fd\u6570\u8c03\u7528\uff1a<\/p>\n<p style=\"color: #333333;\">1) \u00a0\u5728\u6a21\u5757\u521d\u59cb\u5316\u51fd\u6570\u4e2d\u4f7f\u7528zend_set_user_opcode_handler\u4fee\u6539ZEND_DO_FCALL\u65b0\u7684\u5904\u7406\u51fd\u6570\u4e3amysub\uff1a<\/p>\n<p style=\"color: #333333;\">PHP_MINIT_FUNCTION(phpips){<\/p>\n<p style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 zend_set_user_opcode_handler(ZEND_DO_FCALL,\u00a0 mysub);<\/p>\n<p style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return SUCCESS;<\/p>\n<p style=\"color: #333333;\">}<\/p>\n<p style=\"color: #333333;\">2) \u00a0\u5728\u81ea\u5b9a\u4e49\u51fd\u6570\u4e2d\u5b9e\u73b0\u81ea\u5df1\u9700\u8981\u7684\u529f\u80fd\u5e76\u8fd4\u56de\u539f\u6765\u7684\u5904\u7406\u51fd\u6570\uff1a<\/p>\n<p style=\"color: #333333;\">void mysub(){<\/p>\n<p style=\"color: #333333;\">\u81ea\u5b9a\u4e49\u529f\u80fd;<\/p>\n<p style=\"color: #333333;\">return ZEND_USER_OPCODE_DISPATCH;<\/p>\n<p style=\"color: #333333;\">}<\/p>\n<h2 style=\"color: #333333;\">3.2\u00a0\u00a0ZEND\u63a5\u53e3<\/h2>\n<p style=\"color: #333333;\">HOOK\u4e4b\u5916\u8fd8\u9700\u8981\u83b7\u53d6\u4e00\u4e9b\u57fa\u672c\u4fe1\u606f\u6216\u529f\u80fd\uff0c\u6bd4\u5982\uff1a<\/p>\n<p style=\"color: #333333;\">1)\u00a0\u00a0\u00a0\u00a0\u00a0\u83b7\u53d6\u6267\u884c\u7684PHP\u811a\u672c\u540d\uff0c\u53ef\u8c03\u7528ZEND\u7684\u63a5\u53e3zend_get_executed_filename\uff1a<\/p>\n<p style=\"color: #333333;\">char *cgi_name = (char*)zend_get_executed_filename(TSRMLS_C);<\/p>\n<p style=\"color: #333333;\">2)\u00a0\u00a0\u00a0\u00a0\u00a0\u7981\u7528\u4e00\u4e9b\u7c7b\u5e93\uff0c\u53ef\u4f7f\u7528zend_disable_class\u63a5\u53e3\uff1b<\/p>\n<p style=\"color: #333333;\">ZEND\u63d0\u4f9b\u4e86\u5f88\u591a\u4e30\u5bcc\u7684\u63a5\u53e3\uff0c\u53ef\u6839\u636e\u9700\u6c42\u9009\u62e9\u8c03\u7528\u3002<\/p>\n<h2 style=\"color: #333333;\">3.3\u00a0\u00a0\u6570\u636e\u7ed3\u6784<\/h2>\n<p style=\"color: #333333;\">PHP\u662f\u5f31\u7c7b\u578b\u8bed\u8a00\uff0c\u5176\u4e0a\u5c42\u5e76\u4e0d\u533a\u5206\u53d8\u91cf\u7c7b\u578b\uff0c\u53d8\u91cf\u5e95\u5c42\u5bf9\u5e94\u7684\u662f\u4e00\u4e2aunion\u7ed3\u6784\u4f53\uff0c\u4ee5php-5.3.6\u7248\u672c\u4e3e\u4f8b\uff0c\u7ed3\u6784\u4f53\u5728Zend\/zend.h\u6587\u4ef6\u4e2d\u5b9a\u4e49\uff1b\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p style=\"color: #333333;\">typedef union _zvalue_value {<\/p>\n<p style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 long lval;\u00a0 \u00a0\u00a0\/* longvalue *\/<\/p>\n<p style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 double dval;\u00a0\u00a0\/* double value *\/<\/p>\n<p style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 struct {<\/p>\n<p style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0char *val;<\/p>\n<p style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int len;<\/p>\n<p style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 } str;<\/p>\n<p style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HashTable *ht;\u00a0\u00a0\/* hash table value*\/<\/p>\n<p style=\"color: #333333;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 zend_object_value obj;<\/p>\n<p style=\"color: #333333;\">} zvalue_value;<\/p>\n<p style=\"color: #333333;\">PHP\u662f\u5728\u5e95\u5c42\u533a\u5206\u5f00\u4e86\u53d8\u91cf\u7c7b\u578b\uff1b\u5728union\u7ed3\u6784\u4f53\u4e2d\u6709\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u7ed3\u6784\u4f53HashTable\uff0cPHP\u4e2d\u7684\u6570\u7ec4\u7ed3\u6784\u5c31\u662f\u5229\u7528HashTable\u8fd9\u4e2a\u7ed3\u6784\u4f53\u5b9e\u73b0\uff0c\u5982\u679c\u53d8\u91cf\u662f\u4e2a\u6570\u7ec4\uff0c\u83b7\u53d6\u53d8\u91cf\u5185\u5bb9\u9700\u8981\u904d\u5386\u8fd9\u5757HashTable\uff0c\u6570\u636e\u7ed3\u6784\u8fd9\u5757\u4e0d\u505a\u592a\u591a\u4ecb\u7ecd\u3002ZEND\u5e95\u5c42\u7528zval\u8fd9\u4e2a\u7ed3\u6784\u4f53\u5b58\u50a8\u53d8\u91cf\uff0c\u540c\u65f6ZEND\u63d0\u4f9b\u4e86\u51e0\u4e2a\u5b8f\u53ef\u4ee5\u65b9\u4fbf\u7684\u8f6c\u6362zval\u5230\u5177\u4f53\u7684\u6570\u636e\u7c7b\u578b\uff0c\u6bd4\u5982\u628azval\u7c7b\u578b\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32 &#8211; zval el; Z_STRVAL_P(el)\uff0c\u5e38\u7528\u7684\u8fd8\u6709\uff1a<\/p>\n<p style=\"color: #333333;\">Z_LVAL_P\u3001Z_DVAL_P\u3001Z_ARRVAL_P\u7b49\uff0c\u4ee5\u4e0a\u5b8f\u5217\u8868\u5728 Zend\/zend_operators.h\u6709\u5b9a\u4e49\u3002<\/p>\n<h1 style=\"color: #333333;\">4\u00a0\u00a0\u00a0\u00a0\u89c4\u5219\u7b56\u7565<\/h1>\n<h2 style=\"color: #333333;\">4.1\u00a0\u00a0\u57fa\u672c\u601d\u8def<\/h2>\n<p style=\"color: #333333;\">\u6211\u4eec\u9700\u8981\u89e3\u51b3\u7684\u95ee\u9898\u662fgetshell\u3001\u4e3b\u673a\u654f\u611f\u6587\u4ef6\u6cc4\u6f0f\u7b49\u95ee\u9898\u3002\u5982\u679c\u9650\u5236\u4f4fPHP\u811a\u672c\u6267\u884c\u547d\u4ee4 \u548c \u7ffb\u9605\u6587\u4ef6\u7684\u529f\u80fd\uff0c\u5c31\u8fbe\u5230\u4e86\u76ee\u7684\u3002\u540c\u65f6\uff0c\u7531\u4e8e\u8bfb\u53d6\u6587\u4ef6\u7684\u63a5\u53e3\u975e\u5e38\u591a\uff0c\u4f7f\u7528\u573a\u666f\u4e5f\u8f83\u591a\uff0c\u56e0\u6b64\u91c7\u53d6\u7981\u7528\u6253\u5f00\u76ee\u5f55\u63a5\u53e3\u6765\u4fa7\u9762\u8fbe\u5230\u7981\u6b62\u7ffb\u9605\u6587\u4ef6\u7684\u76ee\u7684\uff0c\u4e0d\u80fd\u904d\u5386\u76ee\u5f55\u4fbf\u65e0\u6cd5\u5f97\u5230\u6587\u4ef6\u540d\uff0c\u53ef\u4ee5\u6709\u6548\u7684\u8fbe\u5230\u76ee\u6807\u3002\u6545\u6700\u7ec8\u5f62\u6210\u7684\u6700\u7ec8\u7b56\u7565\u5982\u4e0b\uff1a<\/p>\n<p style=\"color: #333333;\">1) \u7981\u7528\u6389\u6267\u884c\u547d\u4ee4\u7684\u63a5\u53e3<\/p>\n<p style=\"color: #333333;\">2) \u7981\u7528\u6389\u6253\u5f00\u76ee\u5f55\u7684\u63a5\u53e3<\/p>\n<p style=\"color: #333333;\">\u7981\u7528\u51fd\u6570\u6709\u4e00\u4e9b\u9700\u8981\u6ce8\u610f\u7684\u95ee\u9898\uff1a<\/p>\n<p style=\"color: #333333;\">1) PHP\u63a5\u53e3\u8fd8\u662f\u6bd4\u8f83\u7e41\u591a\u590d\u6742\u7684\uff0c\u9664\u4e86system\u3001exec\u3001opendir\u3001scandir\u5e38\u7528\u51fd\u6570\u4e4b\u5916\uff0c\u4e00\u4e9b\u751f\u50fb\u51fd\u6570\u6bd4\u5982glob\u7b49\u51fd\u6570\u90fd\u8981\u8003\u8651\u5168\u9762\uff0c\u53e6\u5916\u8fd8\u6709\u4e00\u4e9b\u56de\u8c03\u51fd\u6570\u3001\u53cd\u5c04\u7c7b\uff08PS\uff1a\u90e8\u5206\u8003\u8651\u4e0d\u5168\u88abblackeye\u548c\u96ea\u4eba\u7ed5\u8fc7\uff09<\/p>\n<p style=\"color: #333333;\">2) PHP SPL\u63d0\u4f9b\u7684\u4e00\u4e9b\u7c7b\u5e93\u6709\u6587\u4ef6\u7ba1\u7406\u7684\u529f\u80fd\uff0c\u4e5f\u9700\u8981\u7981\u6b62\uff0c\u6bd4\u5982DirectoryIterator\uff08\u4e0d\u8fc7\u597d\u50cf\u6ca1\u6709\u767d\u5e3d\u5b50\u4f7f\u7528\u8fc7SPL\uff09<\/p>\n<h2 style=\"color: #333333;\">4.2\u00a0\u00a0\u5bf9\u6297\u53d8\u5f62<\/h2>\n<p style=\"color: #333333;\">PHP\u4f7f\u7528assert\u6216preg_replace \/e\u6267\u884c\u4ee3\u7801\uff0c\u8c03\u7528zend_get_executed_filename\u83b7\u53d6\u7684PHP\u811a\u672c\u540d\u4e2d\u4f1a\u5e26\u6709\u8fa8\u522b\u6807\u8bc6\uff0cassert\u5bf9\u5e94\u7684\u662fassert code\uff0cpreg_replace\u5bf9\u5e94\u7684\u662fregexp code\uff1b\u5f53\u53d1\u73b0\u8fd9\u4e9b\u7279\u6b8a\u7684\u811a\u672c\u6267\u884c\u4e86system\u7b494.1\u4e2d\u63d0\u9ad8\u7684\u9ad8\u5371\u51fd\u6570\u76f4\u63a5\u963b\u65ad\u3002\u4ee5\u4e0b\u56fe\u7684nonalphanumeric -webshell\u4e3e\u4f8b\uff1a<\/p>\n<p style=\"color: #333333;\">\u53d8\u5f62webshell\u89e3\u6790\u540e\u7684\u5f62\u5f0f\u548c$_GET[1]($_GET[2])\u7c7b\u4f3c\uff0c\u6bd4\u5982\u4f20\u51651=assert&amp;2=system(whoami)\u6267\u884c\u4ee3\u7801\uff0cPHP\u6269\u5c55\u5c42\u76d1\u63a7\u5230system\u51fd\u6570\u6267\u884c\uff0c\u5e76\u4e14\u53d1\u73b0PHP\u811a\u672c\u540d\u5e26regexp code\u6807\u8bc6\uff0c\u6e05\u6670\u7684\u77e5\u9053\u662fpreg_replace\u7684\u4ee3\u7801\u6267\u884c\u4e86\u8c03\u7528\u4e86system\uff0c\u963b\u65adsystem\u3002Assert\u51fd\u6570\u540c\u7406\u3002\u603b\u7ed3\uff1a\u6269\u5c55\u5e76\u4e0d\u5173\u6ce8\u5728\u9759\u6001\u5c42\u5982\u4f55\u7f16\u7801\u8fd0\u7b97\u6216\u52a0\u5bc6\uff0c\u6269\u5c55\u53ea\u76d1\u63a7\u6700\u540e\u7684\u884c\u4e3a\uff0c\u6240\u4ee5\u53ef\u4ee5\u5f88\u597d\u7684\u89e3\u51b3\u76ee\u524d\u7684\u53d8\u5f62\u96be\u9898\u3002<\/p>\n<p style=\"color: #333333;\"><a href=\"http:\/\/ixyzero.com\/blog\/wp-content\/uploads\/2014\/07\/nonalphanumeric.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-723\" src=\"http:\/\/ixyzero.com\/blog\/wp-content\/uploads\/2014\/07\/nonalphanumeric-300x100.png\" alt=\"nonalphanumeric\" width=\"300\" height=\"100\" \/><\/a><\/p>\n<p style=\"color: #333333;\">\u56fe2 nonalphanumeric &#8211; webshell<\/p>\n<h2 style=\"color: #333333;\">4.3\u00a0\u00a0\u51cf\u5c11\u8bef\u6740<\/h2>\n<p style=\"color: #333333;\">\u6709\u65f6\u6b63\u5e38\u7684PHP\u811a\u672c\u4e5f\u9700\u8981\u7528\u5230\u547d\u4ee4\u6267\u884c\u7684\u529f\u80fd\uff0c\u5982\u4f55\u4fdd\u8bc1\u5176\u6b63\u5e38\u8fd0\u884c\uff0c\u4e0d\u88ab\u6211\u4eec\u7684\u9632\u5fa1\u7b56\u7565\u963b\u65ad\u5462\uff1f\u8fd9\u91cc\u63d0\u4f9b\u4e09\u79cd\u601d\u8def\uff1a<\/p>\n<p style=\"color: #333333;\">1) \u5199\u5165\u6743\u9650\u548c\u6267\u884c\u547d\u4ee4\u6743\u9650\u4e92\u65a5<\/p>\n<p style=\"color: #333333;\">\u8003\u8651\u5230\u5165\u4fb5\u8005\u5229\u7528\u4e0a\u4f20\u6f0f\u6d1e\u6216\u8005\u5176\u4ed60DAY getshell\u5f97\u5230\u7684\u6587\u4ef6\u5927\u591a\u4f1a\u6709W\u5199\u6743\u9650\uff0c\u9632\u5fa1\u65b9\u5f80\u5f80\u5e0c\u671b\u963b\u6b62\u8fd9\u90e8\u5206\u6587\u4ef6\u62e5\u6709\u8fc7\u9ad8\u7684\u6743\u9650\u3002<\/p>\n<p style=\"color: #333333;\">\u90a3\u4e48\uff0c\u6211\u4eec\u53ef\u4ee5\u53bb\u9664\u6b63\u5e38PHP\u811a\u672c\u7684\u53ef\u5199\u6743\u9650\uff0c\u7136\u540e\u53ea\u5bf9\u6709\u5199\u6743\u9650\u7684PHP\u811a\u672c\u5b9e\u65bd\u547d\u4ee4\u6267\u884c\u7b49\u9632\u5fa1\u7b56\u7565\u7684\u963b\u65ad\u903b\u8f91\u3002\u8fd9\u6837\u5373\u4e0d\u4f1a\u5f71\u54cd\u5230\u4e1a\u52a1\u7684\u4f7f\u7528\uff0c\u53c8\u8fbe\u5230\u4e86\u9884\u8bbe\u573a\u666f\u7684\u9632\u62a4\u76ee\u6807\u3002\u4e0d\u8fc7\u8fd9\u6837\u7684\u601d\u8def\uff0c\u9700\u8981\u7981\u7528chmod\u7b49\u53ef\u4ee5\u4fee\u6539\u6587\u4ef6\u6743\u9650\u7684\u51fd\u6570\u3002<\/p>\n<p style=\"color: #333333;\">2) \u4f7f\u7528\u767d\u540d\u5355\u903b\u8f91<\/p>\n<p style=\"color: #333333;\">\u7c97\u66b4\u4e00\u70b9\u7684\u53ef\u4ee5\u7528\u6587\u4ef6\u540d\u767d\u540d\u5355\uff0c\u4e5f\u5c31\u662f\u4e1a\u52a1\u62a5\u5907\u8fc7\u7684\u6587\u4ef6\u4e0d\u53d7\u963b\u65ad\uff0c\u5176\u5b83\u4e0d\u8ba4\u8bc6\u7684\u6587\u4ef6\u4e00\u5f8b\u7981\u6b62\u3002\u4f18\u96c5\u4e00\u70b9\u7684\u53ef\u4ee5\u5bf9\u51fd\u6570\u53c2\u6570\u505a\u767d\u540d\u5355\uff0c\u6bd4\u5982\u63d0\u53d6\u6b63\u5e38PHP\u811a\u672c\u6267\u884c\u547d\u4ee4\u7684\u53c2\u6570\u6216\u8005\u4ee3\u7801\u7279\u5f81\uff0c\u5bf9\u5176\u8fdb\u884c\u653e\u884c\uff0c\u4e0d\u8ba4\u8bc6\u7684\u7279\u5f81\u4e00\u5f8b\u963b\u65ad\u3002<\/p>\n<p style=\"color: #333333;\">3) \u4f7f\u7528\u9ed1\u540d\u5355\u903b\u8f91<\/p>\n<p style=\"color: #333333;\">\u8bbe\u5b9a\u4e00\u4e9b\u5df2\u77e5\u6076\u610f\u811a\u672c\u7684\u9ed1\u7279\u5f81\u53c2\u6570\uff0c\u7c7b\u4f3c\u4e8e\u6740\u6bd2\u8f6f\u4ef6\u65e9\u671f\u7684\u7279\u5f81\u7801\u601d\u8def\u3002<\/p>\n<p style=\"color: #333333;\">\u4e0a\u8ff0\u601d\u8def\u5728\u4f01\u4e1a\u63a8\u5e7f\u65f6\uff0c\u9700\u8981\u548c\u4e1a\u52a1\u6709\u8db3\u591f\u5145\u5206\u7684\u914d\u5408\uff0c\u4e5f\u90fd\u6709\u4e0d\u5b8c\u7f8e\u7684\u5730\u65b9\uff0c\u5982\u679c\u5927\u5bb6\u6709\u66f4\u591a\u65b9\u6848\u6216\u8005\u601d\u8def\uff0c\u6b22\u8fce\u4e0e\u6211\u5171\u540c\u63a2\u8ba8\u3002<\/p>\n<h1 style=\"color: #333333;\">5\u00a0\u00a0\u00a0\u00a0\u672a\u6765<\/h1>\n<p style=\"color: #333333;\">\u5229\u7528PHP\u6269\u5c55\u53ef\u4ee5\u505a\u7684\u4e8b\u60c5\u8fd8\u662f\u6bd4\u8f83\u591a\uff0c\u6bd4\u5982\u5728\u6f0f\u6d1e\u68c0\u6d4b\u65b9\u9762\u3001\u5bf9\u6570\u636e\u5e93\u51fd\u6570\u53c2\u6570\u8fc7\u6ee4\u3001\u963b\u65adSQL\u6ce8\u5165\u3001\u963b\u65ad\u5b58\u50a8\u578bXSS\u7b49\u573a\u666f\u90fd\u6709\u975e\u5e38\u5927\u7684\u60f3\u8c61\u7a7a\u95f4\u3002\u751a\u81f3\u5728\u4ee3\u7801\u5ba1\u8ba1\u8fd9\u5757\u4e5f\u53ef\u4ee5\u8003\u8651\uff0c\u56fd\u5185\u6709\u4e2a\u5927\u725b\u5df2\u7ecf\u6709\u6bd4\u8f83\u6210\u719f\u7684\u5f00\u6e90\u4ea7\u54c1\uff0cTAINT \uff08\u4f5c\u8005\uff1alaruence\uff09\uff0c\u5927\u5bb6\u53ef\u80fd\u90fd\u5df2\u7ecf\u6bd4\u8f83\u719f\u6089\u4e86\uff0c\u5c31\u6682\u65f6\u4e0d\u505a\u8d58\u8ff0\u4e86\u3002<\/p>\n<p style=\"color: #333333;\">\u884c\u6587\u6bd4\u8f83\u4ed3\u4fc3\uff0c\u6709\u4e0d\u8db3\u7684\u5730\u65b9\u8bf7\u8c05\u89e3\uff0c\u6709\u4efb\u610f\u7591\u95ee\u6216\u5efa\u8bae\u6b22\u8fce\u8054\u7cfbpandas(\u5c0f\u6bdb\u9a74)\u5207\u78cb\u4ea4\u6d41\u3002<\/p>\n<p style=\"color: #333333;\">\u539f\u6587\u5730\u5740\uff1a<a href=\"http:\/\/security.tencent.com\/index.php\/blog\/msg\/57\" target=\"_blank\">http:\/\/security.tencent.com\/index.php\/blog\/msg\/57<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u00a0\u00a0\u00a0\u00a0\u80cc\u666f\u6982\u8ff0 WEB\u5e94\u7528\u6f0f\u6d1e\u5bfc\u81f4\u7684\u5165\u4fb5\u65f6\u6709\u53d1\u751f\uff0c\u626b\u63cf\u5668\u548cWAF\u5e76\u4e0d\u80fd\u89e3\u51b3\u6240\u6709\u7684\u95ee\u9898\uff0c\u4e8e\u662f\u5c1d\u8bd5\u5728\u4e3b\u673a\u4fa7\u9488\u5bf9 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,25],"tags":[48,37],"class_list":["post-721","post","type-post","status-publish","format-standard","hentry","category-knowledgebase-2","category-security","tag-php","tag-security"],"views":3463,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=721"}],"version-history":[{"count":0,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/721\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}