{"id":83,"date":"2021-05-27T22:41:36","date_gmt":"2021-05-27T14:41:36","guid":{"rendered":"http:\/\/121.5.220.128\/wordpress\/?p=83"},"modified":"2021-11-15T10:32:49","modified_gmt":"2021-11-15T02:32:49","slug":"%e6%96%87%e4%bb%b6%e4%b8%8a%e4%bc%a0","status":"publish","type":"post","link":"http:\/\/101.34.19.194\/?p=83","title":{"rendered":"\u6587\u4ef6\u4e0a\u4f20"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u6587\u4ef6\u4e0a\u4f20\u9a8c\u8bc1<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u6587\u4ef6\u5934\u9a8c\u8bc1<\/h4>\n\n\n\n<p><strong>jpg<\/strong>\u683c\u5f0f\u56fe\u7247\uff0c\u6587\u4ef6\u5934\u4e3a<strong>JFIF<\/strong><\/p>\n\n\n\n<p><strong>gif<\/strong>\u683c\u5f0f\u7684\u56fe\u7247\uff0c\u6587\u4ef6\u5934\u4e3a<strong>GIF89a<\/strong><\/p>\n\n\n\n<p><strong>png<\/strong>\u683c\u5f0f\u7684\u56fe\u7247\uff0c\u6587\u4ef6\u5934\u4e3a<strong>PNG<\/strong><\/p>\n\n\n\n<p>\u7ed5\u8fc7\uff1a\u4fee\u6539\u6587\u4ef6\u5934\uff0c\u4f2a\u9020\u6587\u4ef6\u5c5e\u6027<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u6587\u4ef6\u7c7b\u578b\u9a8c\u8bc1<\/h4>\n\n\n\n<p>\u6293\u5305\u4e2d\u7684\u53d1\u9001\u5305\u91cc\u7684<\/p>\n\n\n\n<figure class=\"wp-block-image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/gitee.com\/Hermitaria\/blogimage\/raw\/master\/20201203214625.PNG'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/gitee.com\/Hermitaria\/blogimage\/raw\/master\/20201203214625.PNG\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\u6355\u83b7\"\/><\/div><\/figure>\n\n\n\n<p>Content-Type<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>\u56fe\u7247\u683c\u5f0f\uff1aimage\/jpeg<\/p><p>\u811a\u672c\u683c\u5f0f\uff1aapplication\/octet-stream<\/p><\/blockquote>\n\n\n\n<p>\u542b\u6709\u4e0a\u4f20\u6587\u4ef6\u5c5e\u6027<\/p>\n\n\n\n<p>\u7ed5\u8fc7\uff1a\u4fee\u6539\u6587\u4ef6\u7c7b\u578b\uff0c\u4f2a\u9020\u6587\u4ef6\u7c7b\u578b\uff0cMIME\u7ed5\u8fc7<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u6587\u4ef6\u540e\u7f00\u9a8c\u8bc1<\/h4>\n\n\n\n<p>\u7ed5\u8fc7\uff1a\u589e\u52a0\u591a\u91cd\u540e\u7f00\uff0c\u4f2a\u9020\u6587\u4ef6\u540e\u7f00\uff0c\u547d\u540d\u7ed5\u8fc7<\/p>\n\n\n\n<p>\u5e38\u7528\u7ed5\u8fc7\u540e\u7f00\u540d<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">php,php3,php4,php5,phtml.pht<\/pre>\n\n\n\n<p><strong>\u5927\u5c0f\u5199\u7ed5\u8fc7<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>windows \u7cfb\u7edf\u4f1a\u5ffd\u7565\u5927\u5c0f\u5199\u3002 \u800cLinux\u7cfb\u7edf\u9ed8\u8ba4\u5bf9\u5927\u5c0f\u5199\u654f\u611f\uff0c\u5982\u5ffd\u7565\u5219\u9700\u8981\u7279\u6b8a\u914d\u7f6e<\/p><\/blockquote>\n\n\n\n<p><strong>\u53cc\u5199\u7ed5\u8fc7<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>waf \u5e38\u7528\u624b\u6bb5<\/p><p>\u670d\u52a1\u7aef\u903b\u8f91\u5bf9\u4e0d\u5408\u6cd5\u7684\u540e\u7f00\u540d\u8fdb\u884c\u4e86\u66ff\u6362\u4e3a\u7a7a<\/p><p>\u90a3\u6211\u4eec\u53ef\u4ee5\u6269\u5145\u4e0b\u601d\u8def<\/p><p>\u4f8b\u5982\u540e\u7aef\u9650\u5236\u4e86php\uff0c\u5982\u679c\u53d1\u73b0\u6211\u4eec\u4e0a\u4f20\u7684\u6587\u4ef6\u540d\u540e\u7f00\u4e3aphp \u5c31\u66ff\u6362\u4e3a\u7a7a<\/p><p>a.php -&gt; .php -&gt; a a.pphphp -&gt;php -&gt; a.php<\/p><\/blockquote>\n\n\n\n<p><strong>::$DATA<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>\u5728\u540e\u7f00\u52a0 ::$DATA Windows\u7279\u6027\uff0c\u4e0d\u4f1a\u89e3\u6790<\/p><\/blockquote>\n\n\n\n<p><strong>\u70b9\u7ed5\u8fc7<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>Windows\u4e0bxx.jpg[\u7a7a\u683c] \u6216\u8005xx.jpg.\u8fd9\u4e24\u7c7b\u6587\u4ef6\u90fd\u662f\u4e0d\u5141\u8bb8\u5b58\u5728\u7684\uff0c \u82e5\u8fd9\u6837\u547d\u540d\uff0cwindows\u4f1a\u9ed8\u8ba4\u53bb\u9664\u7a7a\u683c\u6216\u70b9<\/p><\/blockquote>\n\n\n\n<p><strong>\u7a7a\u683c\u7ed5\u8fc7<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>Windows\u4e0bxx.jpg[\u7a7a\u683c] \u6216\u8005xx.jpg.\u8fd9\u4e24\u7c7b\u6587\u4ef6\u90fd\u662f\u4e0d\u5141\u8bb8\u5b58\u5728\u7684\uff0c \u82e5\u8fd9\u6837\u547d\u540d\uff0cwindows\u4f1a\u9ed8\u8ba4\u53bb\u9664\u7a7a\u683c\u6216\u70b9<\/p><\/blockquote>\n\n\n\n<p><strong>\u70b9\u7a7a\u683c\u70b9\u7ed5\u8fc7<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>Windows\u4e0bxx.jpg[\u7a7a\u683c] \u6216\u8005xx.jpg.\u8fd9\u4e24\u7c7b\u6587\u4ef6\u90fd\u662f\u4e0d\u5141\u8bb8\u5b58\u5728\u7684\uff0c \u82e5\u8fd9\u6837\u547d\u540d\uff0cwindows\u4f1a\u9ed8\u8ba4\u53bb\u9664\u7a7a\u683c\u6216\u70b9<\/p><\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">\u670d\u52a1\u5668\u4e0a\u4f20\u6f0f\u6d1e<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u670d\u52a1\u7aef\u9a8c\u8bc1<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>1:MIME\u7c7b\u578b\u68c0\u6d4b\u7ed5\u8fc7<\/strong><\/h5>\n\n\n\n<p><strong>\u68c0\u6d4b\u539f\u7406<\/strong> \u5f53\u7528\u6237\u4e0a\u4f20\u6587\u4ef6\u5230\u670d\u52a1\u5668\u7aef\u7684\u65f6\u5019\uff0c\u670d\u52a1\u5668\u7aef\u7684\u7a0b\u5e8f\u4f1a\u83b7\u53d6\u4e0a\u4f20\u6587\u4ef6\u7684MIME\u7c7b\u578b\uff0c\u7136\u540e\u7528\u8fd9\u4e2a\u83b7\u53d6\u5230\u7684\u7c7b\u578b\u6765\u548c\u671f\u671b\u7684MIME\u7c7b\u578b\u8fdb\u884c\u5339\u914d\uff0c\u5982\u679c\u5339\u914d\u4e0d\u4e0a\u5219\u8bf4\u660e\u4e0a\u4f20\u7684\u6587\u4ef6\u4e0d\u5408\u6cd5\u3002\u670d\u52a1\u7aef\u68c0\u6d4bMIME\u7c7b\u578b\u7684\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">if (($_FILES['upload_file']['type'] == 'image\/jpeg') || ($_FILES['upload_file']['type'] == 'image\/png') || ($_FILES['upload_file']['type'] == 'image\/gif')){<br>\u200b<br> ...\/\/\u5224\u65ad\u8fc7\u540e\u5bf9\u6587\u4ef6\u5904\u7406\u7684\u8fdb\u4e00\u6b65\u64cd\u4f5c<br>}<\/pre>\n\n\n\n<p><strong>\u7ed5\u8fc7\u65b9\u6cd5<\/strong><\/p>\n\n\n\n<p>\u56e0\u4e3a\u670d\u52a1\u7aef\u68c0\u6d4b\u7684\u662f\u6587\u4ef6\u7684MIME\u7c7b\u578b\uff0c\u800c\u5bf9\u8fd9\u4e2aMIME\u7c7b\u578b\u7684\u7684\u503c\u7684\u83b7\u53d6\u662f\u901a\u8fc7HTTP\u8bf7\u6c42\u5b57\u6bb5\u91cc\u7684Content-Type\u5b57\u6bb5 \uff0c\u6240\u4ee5\u7ed5\u8fc7\u7684\u65b9\u6cd5\u5c31\u662f\u901a\u8fc7\u4fee\u6539Content-Type\u7684\u503c\uff0c\u6bd4\u5982\u4fee\u6539\u4e3aimage\/jpeg\uff1bimage\/png\uff1bimage\/gif\u7b49\u7b49\u5141\u8bb8\u4e0a\u4f20\u7c7b\u578b\u5bf9\u5e94\u7684MIME\u503c<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>2:\u9ed1\u540d\u5355\u7ed5\u8fc7<\/strong><\/h5>\n\n\n\n<p><strong>\u68c0\u6d4b\u539f\u7406<\/strong><\/p>\n\n\n\n<p>\u6587\u4ef6\u7c7b\u578b\u6839\u636e\u9ed1\u540d\u5355\u6765\u68c0\u6d4b\u7684\u539f\u7406\u5c31\u662f\uff1a\u670d\u52a1\u5668\u7a0b\u5e8f\u6839\u636e\u4e00\u4efd\u6587\u4ef6\u540e\u7f00\u540d\u7684\u540d\u5355\u6765\u5224\u65ad\u662f\u5426\u5141\u8bb8\u5f53\u524d\u6587\u4ef6\u4e0a\u4f20\u5230\u670d\u52a1\u5668\uff0c\u53ea\u8981\u4e0a\u4f20\u7684\u6587\u4ef6\u7684\u7c7b\u578b\u80fd\u591f\u548c\u8fd9\u4e2a\u9ed1\u540d\u5355\u91cc\u9762\u7684\u7c7b\u578b\u5339\u914d\uff0c\u90a3\u4e48\u5c31\u7981\u6b62\u8be5\u6587\u4ef6\u4e0a\u4f20<\/p>\n\n\n\n<p><strong>\u7ed5\u8fc7\u65b9\u6cd5<\/strong><\/p>\n\n\n\n<p>\\1. \u6587\u4ef6\u540d\u5927\u5c0f\u5199\u7ed5\u8fc7 \u7528\u50cfAsP\uff0c pHp\u4e4b\u7c7b\u7684\u6587\u4ef6\u540d\u7ed5\u8fc7\u9ed1\u540d\u5355\u68c0\u6d4b<\/p>\n\n\n\n<p>\\2.\u540d\u5355\u5217\u8868\u7ed5\u8fc7<\/p>\n\n\n\n<p>\u7528\u9ed1\u540d\u5355\u91cc\u6ca1\u6709\u7684\u540d\u5355\u8fdb\u884c\u653b\u51fb\uff0c\u6bd4\u5982\u9ed1\u540d\u5355\u91cc\u6ca1\u6709asa\u6216cer\u4e4b\u7c7b \\3. \u7279\u6b8a\u6587\u4ef6\u540d\u7ed5\u8fc7 \u6bd4\u5982\u53d1\u9001\u7684 http\u5305\u91cc\u628a\u6587\u4ef6\u540d\u6539\u6210 test.asp. \u6216 test.asp_(\u4e0b\u5212\u7ebf\u4e3a\u7a7a\u683c)\uff0c\u8fd9\u79cd\u547d\u540d\u65b9\u5f0f \u5728windows\u7cfb\u7edf\u91cc\u662f\u4e0d\u88ab\u5141\u8bb8\u7684\uff0c\u6240\u4ee5\u9700\u8981\u5728 burp\u4e4b\u7c7b\u91cc\u8fdb\u884c\u4fee\u6539\uff0c\u7136\u540e\u7ed5\u8fc7\u9a8c\u8bc1\u540e\uff0c\u4f1a \u88abwindows\u7cfb\u7edf\u81ea\u52a8\u53bb\u6389\u540e\u9762\u7684\u70b9\u548c\u7a7a\u683c\uff0c\u4f46\u8981\u6ce8\u610fUnix\/Linux\u7cfb\u7edf\u6ca1\u6709\u8fd9\u4e2a\u7279\u6027\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">3.%00\u622a\u65ad\u4e0a\u4f20<\/h5>\n\n\n\n<p>\u524d\u63d0\uff1a\u9700\u8981<strong>magic_quotes_gpc=off<\/strong>\u3001<strong>php\u7248\u672c<\/strong>\u8981\u5c0f\u4e8e<strong>5.3.4<\/strong>\uff0c5.3.4\u53ca\u4ee5\u4e0a\u5df2\u7ecf\u4fee\u590d\u8be5\u95ee\u9898<\/p>\n\n\n\n<p>%00\u4e3a\u622a\u65ad\u7b26<\/p>\n\n\n\n<p>\u7ed5\u8fc7\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<p><strong>GET\u65b9\u6cd5<\/strong>\uff1a\u6293\u5305\u65f6\u5148\u4e0a\u4f20xx.jpg\uff0c\u518d\u4f7f\u7528bp\u622a\u65ad<\/p>\n\n\n\n<figure class=\"wp-block-image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/101.34.19.194\/wp-content\/uploads\/2021\/06\/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210616090019-1024x800.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/101.34.19.194\/wp-content\/uploads\/2021\/06\/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210616090019-1024x800.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"img\"\/><\/div><\/figure>\n\n\n\n<p>\u7531\u4e8eroot.php\u88ab\u622a\u65ad\uff0c\u6240\u4ee5\u76f4\u63a5\u8bbf\u95eeroot.php\u5c31\u53ef\u4ee5\u4e86<\/p>\n\n\n\n<figure class=\"wp-block-image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/101.34.19.194\/wp-content\/uploads\/2021\/06\/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210616090200.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/101.34.19.194\/wp-content\/uploads\/2021\/06\/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210616090200.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"img\"\/><\/div><\/figure>\n\n\n\n<p><strong>POST\u65b9\u6cd5<\/strong>\uff1a%00\u8fdb\u884curl decode\uff0c\u8f6c\u6362\u4e3a\u7a7a\u5b57\u7b26\uff0c\u8fdb\u884c\u622a\u65ad\uff08GET\u53ef\u4ee5url\u81ea\u52a8\u8f6c\u7801\u7684\uff0c\u4f46POST\u4e0d\u4f1a\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/101.34.19.194\/wp-content\/uploads\/2021\/06\/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210616090749.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/101.34.19.194\/wp-content\/uploads\/2021\/06\/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210616090749.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"img\"\/><\/div><\/figure>\n\n\n\n<p>\u4e5f\u53ef\u4ee5\u5728hex\u5904\u8fdb\u884c\u8fdb\u884c\u4fee\u6539<\/p>\n\n\n\n<p>\u5728root.php\u540e\u52a0\u4e00\u4e2a\u5b57\u7b26 +<\/p>\n\n\n\n<p>+\u5bf9\u5e94\u7684hex\u4e3a2b<\/p>\n\n\n\n<p>\u5c062b\u6539\u621000\u5c31\u8fdb\u884c\u622a\u65ad<\/p>\n\n\n\n<figure class=\"wp-block-image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/101.34.19.194\/wp-content\/uploads\/2021\/06\/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210616091202.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/101.34.19.194\/wp-content\/uploads\/2021\/06\/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210616091202.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"img\"\/><\/div><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">JS\u672c\u5730\u9a8c\u8bc1<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">\u5224\u65adJS\u672c\u5730\u9a8c\u8bc1\u65b9\u6cd5<\/h5>\n\n\n\n<h6 class=\"wp-block-heading\">\u6e90\u4ee3\u7801<\/h6>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php<br>02  \/**<br>03 &nbsp; * Created by \u72ec\u81ea\u7b49\u5f85<br>04 &nbsp; * Date: 14-1-22<br>05 &nbsp; * Time: \u4e0b\u53487:19<br>06 &nbsp; * Name: upload1.php<br>07 &nbsp; * \u72ec\u81ea\u7b49\u5f85\u535a\u5ba2\uff1ahttp:\/\/www.waitalone.cn\/<br>08 &nbsp; *\/<br>09  \/\/\u6587\u4ef6\u4e0a\u4f20\u6f0f\u6d1e\u6f14\u793a\u811a\u672c\u4e4bjs\u9a8c\u8bc1<br>10  $uploaddir = 'uploads\/';<br>11  if (isset($_POST&#91;'submit'])) {<br>12 &nbsp; &nbsp;  if (file_exists($uploaddir)) {<br>13 &nbsp; &nbsp; &nbsp; &nbsp;  if (move_uploaded_file($_FILES&#91;'upfile']&#91;'tmp_name'], $uploaddir . '\/' . $_FILES&#91;'upfile']&#91;'name'])) {<br>14 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo '\u6587\u4ef6\u4e0a\u4f20\u6210\u529f\uff0c\u4fdd\u5b58\u4e8e\uff1a' . $uploaddir . $_FILES&#91;'upfile']&#91;'name'] . \"n\";<br>15 &nbsp; &nbsp; &nbsp; &nbsp;  }<br>16 &nbsp; &nbsp;  } else {<br>17 &nbsp; &nbsp; &nbsp; &nbsp;  exit($uploaddir . '\u6587\u4ef6\u5939\u4e0d\u5b58\u5728,\u8bf7\u624b\u5de5\u521b\u5efa\uff01');<br>18 &nbsp; &nbsp;  }<br>19 &nbsp; &nbsp;  \/\/print_r($_FILES);<br>20  }<br>21  ?&gt;<br>22  &lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\"<br>23 &nbsp; &nbsp;  \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\"&gt;<br>24  &lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"&gt;<br>25  &lt;head&gt;<br>26 &nbsp; &nbsp;  &lt;meta http-equiv=\"Content-Type\" content=\"text\/html;charset=gbk\"\/&gt;<br>27 &nbsp; &nbsp;  &lt;meta http-equiv=\"content-language\" content=\"zh-CN\"\/&gt;<br>28 &nbsp; &nbsp;  &lt;title&gt;\u6587\u4ef6\u4e0a\u4f20\u6f0f\u6d1e\u6f14\u793a\u811a\u672c--JS\u9a8c\u8bc1\u5b9e\u4f8b&lt;\/title&gt;<br>29 &nbsp; &nbsp;  &lt;script type=\"text\/javascript\"&gt;<br>30 &nbsp; &nbsp; &nbsp; &nbsp;  function checkFile() {<br>31 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  var file = document.getElementsByName('upfile')&#91;0].value;<br>32 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if (file == null || file == \"\") {<br>33 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  alert(\"\u4f60\u8fd8\u6ca1\u6709\u9009\u62e9\u4efb\u4f55\u6587\u4ef6\uff0c\u4e0d\u80fd\u4e0a\u4f20!\");<br>34 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  return false;<br>35 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br>36 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \/\/\u5b9a\u4e49\u5141\u8bb8\u4e0a\u4f20\u7684\u6587\u4ef6\u7c7b\u578b<br>37 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  var allow_ext = \".jpg|.jpeg|.png|.gif|.bmp|\";<br>38 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \/\/\u63d0\u53d6\u4e0a\u4f20\u6587\u4ef6\u7684\u7c7b\u578b<br>39 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  var ext_name = file.substring(file.lastIndexOf(\".\"));<br>40 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \/\/alert(ext_name);<br>41 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \/\/alert(ext_name + \"|\");<br>42 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \/\/\u5224\u65ad\u4e0a\u4f20\u6587\u4ef6\u7c7b\u578b\u662f\u5426\u5141\u8bb8\u4e0a\u4f20<br>43 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if (allow_ext.indexOf(ext_name + \"|\") == -1) {<br>44 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  var errMsg = \"\u8be5\u6587\u4ef6\u4e0d\u5141\u8bb8\u4e0a\u4f20\uff0c\u8bf7\u4e0a\u4f20\" + allow_ext + \"\u7c7b\u578b\u7684\u6587\u4ef6,\u5f53\u524d\u6587\u4ef6\u7c7b\u578b\u4e3a\uff1a\" + ext_name;<br>45 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  alert(errMsg);<br>46 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  return false;<br>47 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br>48 &nbsp; &nbsp; &nbsp; &nbsp;  }<br>49 &nbsp; &nbsp;  &lt;\/script&gt;<br>50  &lt;body&gt;<br>51  &lt;h3&gt;\u6587\u4ef6\u4e0a\u4f20\u6f0f\u6d1e\u6f14\u793a\u811a\u672c--JS\u9a8c\u8bc1\u5b9e\u4f8b&lt;\/h3&gt;<br>52 &nbsp;<br>53  &lt;form action=\"\" method=\"post\" enctype=\"multipart\/form-data\" name=\"upload\" onsubmit=\"return checkFile()\"&gt;<br>54 &nbsp; &nbsp;  &lt;input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"204800\"\/&gt;<br>55 &nbsp; &nbsp;  \u8bf7\u9009\u62e9\u8981\u4e0a\u4f20\u7684\u6587\u4ef6\uff1a&lt;input type=\"file\" name=\"upfile\"\/&gt;<br>56 &nbsp; &nbsp;  &lt;input type=\"submit\" name=\"submit\" value=\"\u4e0a\u4f20\"\/&gt;<br>57  &lt;\/form&gt;<br>58  &lt;\/body&gt;<br>59  &lt;\/html&gt;<br>\u200b<\/code><\/pre>\n\n\n\n<h6 class=\"wp-block-heading\">\u89c2\u5bdf\u53cd\u9988\u901f\u5ea6<\/h6>\n\n\n\n<p>\u4e00\u70b9\u51fb\u4e0a\u4f20\uff0c\u82e5\u7acb\u5373\u5f39\u7a97\uff0c\u57fa\u672c\u4e3a\u672c\u5730\u9a8c\u8bc1<\/p>\n\n\n\n<p>\u82e5\u9700\u8981\u4e00\u5b9a\u65f6\u95f4\uff0c\u53ef\u80fd\u4e3a\u670d\u52a1\u7aef\u9a8c\u8bc1<\/p>\n\n\n\n<p>\u56e0\u4e3a\u672c\u5730\u5230\u672c\u5730\u901f\u5ea6\u6bd4\u672c\u5730\u5230\u670d\u52a1\u7aef\u8981\u5feb<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u7ed5\u8fc7\u65b9\u6cd5<\/h5>\n\n\n\n<h6 class=\"wp-block-heading\">1.\u5220\u9664\u5bf9js\u9a8c\u8bc1\u811a\u672c\u7684\u8c03\u7528<\/h6>\n\n\n\n<p>\u590d\u5236\u7f51\u9875\u6e90\u4ee3\u7801<\/p>\n\n\n\n<p>\u521b\u5efahtml\u6587\u4ef6<\/p>\n\n\n\n<p>\u590d\u5236\u6e90\u4ee3\u7801\u5230html\u6587\u4ef6<\/p>\n\n\n\n<p>\u5220\u9664\u8fd9\u4e00\u6bb5\u4ee3\u7801<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>29 &nbsp; &nbsp;  &lt;script type=\"text\/javascript\"&gt;<br>30 &nbsp; &nbsp; &nbsp; &nbsp;  function checkFile() {<br>31 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  var file = document.getElementsByName('upfile')&#91;0].value;<br>32 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if (file == null || file == \"\") {<br>33 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  alert(\"\u4f60\u8fd8\u6ca1\u6709\u9009\u62e9\u4efb\u4f55\u6587\u4ef6\uff0c\u4e0d\u80fd\u4e0a\u4f20!\");<br>34 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  return false;<br>35 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br>36 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \/\/\u5b9a\u4e49\u5141\u8bb8\u4e0a\u4f20\u7684\u6587\u4ef6\u7c7b\u578b<br>37 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  var allow_ext = \".jpg|.jpeg|.png|.gif|.bmp|\";<br>38 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \/\/\u63d0\u53d6\u4e0a\u4f20\u6587\u4ef6\u7684\u7c7b\u578b<br>39 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  var ext_name = file.substring(file.lastIndexOf(\".\"));<br>40 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \/\/alert(ext_name);<br>41 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \/\/alert(ext_name + \"|\");<br>42 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \/\/\u5224\u65ad\u4e0a\u4f20\u6587\u4ef6\u7c7b\u578b\u662f\u5426\u5141\u8bb8\u4e0a\u4f20<br>43 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if (allow_ext.indexOf(ext_name + \"|\") == -1) {<br>44 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  var errMsg = \"\u8be5\u6587\u4ef6\u4e0d\u5141\u8bb8\u4e0a\u4f20\uff0c\u8bf7\u4e0a\u4f20\" + allow_ext + \"\u7c7b\u578b\u7684\u6587\u4ef6,\u5f53\u524d\u6587\u4ef6\u7c7b\u578b\u4e3a\uff1a\" + ext_name;<br>45 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  alert(errMsg);<br>46 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  return false;<br>47 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br>48 &nbsp; &nbsp; &nbsp; &nbsp;  }<br>49 &nbsp; &nbsp;  &lt;\/script&gt;<\/code><\/pre>\n\n\n\n<p>\u518d\u5230\u672b\u5c3e\u7684<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">form action=\"\"<\/pre>\n\n\n\n<p>\u586b\u5165URL\u6307\u5411\u5730\u5740<\/p>\n\n\n\n<p>\u518d\u6253\u5f00\u6587\u4ef6\u8fdb\u884c\u4e0a\u4f20<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">2.\u6293\u5305\u540e\u6539\u7c7b\u578b<\/h6>\n\n\n\n<p>\u5229\u7528burpsuite\u6293\u5305\uff0c\u4fee\u6539\u6587\u4ef6\u7c7b\u578b\u8fdb\u884c\u7ed5\u8fc7-\u9996\u5148\u5c06\u6211\u4eec\u60f3\u8981\u4e0a\u4f20\u7684\u6076\u610f\u811a\u672c\u7684\u540e\u7f00\u66f4\u6539\u4e3a\u7b26\u5408\u8981\u6c42\u7684\u6587\u4ef6\u7c7b\u578b\u540e\u7f00\u5982\uff1awebshell.php -&gt; webshell.jpg-\u5f53\u70b9\u51fb\u4e0a\u4f20\u7684\u65f6\u5019\u4f7f\u7528burp\u8fdb\u884c\u6293\u5305\uff0c\u5c06\u540d\u5b57\u7684\u540e\u7f00\u6539\u56de.php\uff0c\u4ee5\u4fbf\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\u80fd\u591f\u6b63\u786e\u89e3\u6790<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">web\u5e94\u7528\u7a0b\u5e8f\u89e3\u6790\u7ed5\u8fc7<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>1. Apache\u89e3\u6790\u6f0f\u6d1e<\/strong><\/h5>\n\n\n\n<p>\u89e3\u6790\uff1atest.php.(\u4efb\u610f\u4e0d\u5c5e\u4e8e\u9ed1\u540d\u5355\u4e14\u4e5f\u4e0d\u5c5e\u4e8eApache\u89e3\u6790\u767d\u540d\u5355\u7684\u540d\u79f0)\uff0c\u6bd4\u5982test.php.lala\uff08\u52a0\u7a7a\u683c\u4e5f\u53ef\u4ee5\uff09 \u63cf\u8ff0\uff1a\u4e00\u4e2a\u6587\u4ef6\u540d\u4e3atest.x1.x2.x3\u7684\u6587\u4ef6\uff0capache\u4f1a\u4ecex3\u7684\u4f4d\u7f6e\u5f00\u59cb\u5c1d\u8bd5\u89e3\u6790\uff0c\u5982\u679cx3\u4e0d\u5c5e\u4e8eapache\u80fd\u591f\u89e3\u6790\u7684\u6269\u5c55\u540d\uff0c\u90a3\u4e48apache\u4f1a\u5c1d\u8bd5\u53bb\u89e3\u6790x2\uff0c\u76f4\u5230\u80fd\u591f\u89e3\u6790\u5230\u80fd\u591f\u89e3\u6790\u7684\u4e3a\u6b62\uff0c\u5426\u5219\u5c31\u4f1a\u62a5\u9519<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>2. IIS\u89e3\u6790\u6f0f\u6d1e<\/strong><\/h5>\n\n\n\n<p>\u89e3\u6790 \uff1atest.asp\/(\u4efb\u610f\u6587\u4ef6\u540d)|test.asp\uff1b(\u4efb\u610f\u6587\u4ef6\u540d) | (\u4efb\u610f\u6587\u4ef6\u540d)\/(\u4efb\u610f\u6587\u4ef6\u540d).php<\/p>\n\n\n\n<p>\u63cf\u8ff0\uff1aIIS6.0\u5728\u89e3\u6790asp\u683c\u5f0f\u7684\u65f6\u5019\u6709\u4e24\u4e2a\u89e3\u6790\u6f0f\u6d1e\uff0c\u4e00\u4e2a\u662f\u5982\u679c\u76ee\u5f55\u540d\u5305\u542b&#8221;.asp&#8221;\u5b57\u7b26\u4e32\uff0c \u90a3\u4e48\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u6240\u6709\u7684\u6587\u4ef6\u90fd\u4f1a\u6309\u7167asp\u53bb\u89e3\u6790\uff0c\u53e6\u4e00\u4e2a\u662f\u53ea\u8981\u6587\u4ef6\u540d\u4e2d\u542b\u6709&#8221;.asp;&#8221;\u4f1a\u4f18\u5148\u6309asp\u6765\u89e3\u6790<\/p>\n\n\n\n<p>IIS7.0\/7.5\u662f\u5bf9php\u89e3\u6790\u65f6\u6709\u4e00\u4e2a\u7c7b\u4f3c\u4e8eNginx\u7684\u89e3\u6790\u6f0f\u6d1e\uff0c\u5bf9\u4efb\u610f\u6587\u4ef6\u540d\u53ea\u8981\u5728URL\u540e\u9762\u8ffd\u52a0\u4e0a\u5b57\u7b26\u4e32&#8221;\/\u4efb\u610f\u6587\u4ef6\u540d.php&#8221;\u5c31\u4f1a\u6309\u7167php\u7684\u65b9\u5f0f\u53bb\u89e3\u6790\uff1b<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">.htaccess\u6587\u4ef6\u653b\u51fb<\/h4>\n\n\n\n<p>.htaccess\u6587\u4ef6\u662fApache\u670d\u52a1\u5668\u4e2d\u7684\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\uff0c\u5b83\u8d1f\u8d23\u76f8\u5173\u76ee\u5f55\u4e0b\u7684\u7f51\u9875\u914d\u7f6e.\u901a\u8fc7htaccess\u6587\u4ef6\uff0c\u53ef\u4ee5\u5b9e\u73b0:\u7f51\u9875301\u91cd\u5b9a\u5411\u3001\u81ea\u5b9a\u4e49404\u9875\u9762\u3001\u6539\u53d8\u6587\u4ef6\u6269\u5c55\u540d\u3001\u5141\u8bb8\/\u963b\u6b62\u7279\u5b9a\u7684\u7528\u6237\u6216\u8005\u76ee\u5f55\u7684\u8bbf\u95ee\u3001\u7981\u6b62\u76ee\u5f55\u5217\u8868\u3001\u914d\u7f6e\u9ed8\u8ba4\u6587\u6863\u7b49\u529f\u80fd\u3002<\/p>\n\n\n\n<p>\u914d\u5408\u540d\u5355\u5217\u8868\u7ed5\u8fc7\uff0c\u4e0a\u4f20\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7684.htaccess\uff0c\u5c31\u53ef\u4ee5\u8f7b\u677e\u7ed5\u8fc7\u5404\u79cd\u68c0\u6d4b<\/p>\n\n\n\n<p>\u5efa\u4e00\u4e2a.htaccess \u6587\u4ef6\uff0c\u91cc\u9762\u7684\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;FilesMatch \"pino\"&gt;<br>SetHandler application\/x-httpd-php<br>&lt;\/FilesMatch&gt;<\/code><\/pre>\n\n\n\n<p>\u5b83\u5c06\u8be5\u76ee\u5f55\u4e0b\u5339\u914d\u7684pino\u6587\u4ef6\u89e3\u6790\u4e3aphp\u6267\u884c<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u65f6\u5019\u5c31\u4e0a\u4f20\u4e00\u4e2a\u6587\u4ef6\u540d\u5b57\u662fpino\uff0c\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u4e0a\u4f20\u4e00\u4e2a\u6587\u4ef6\u540d\u5b57\u53eb\u505apino\u7684\u6587\u4ef6\uff0c\u4e0d\u8981\u540e\u7f00\u540d\uff0c\u7136\u540e\u91cc\u9762\u662f\u4e00\u53e5\u8bdd\u6728\u9a6c\uff0c\u7528\u83dc\u5200\u8fde\u63a5\uff0c\u53ef\u4ee5\u6210\u529f<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">.user.ini\u6587\u4ef6\u653b\u51fb<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>\u81ea PHP 5.3.0 \u8d77\uff0cPHP \u652f\u6301\u57fa\u4e8e\u6bcf\u4e2a\u76ee\u5f55\u7684 INI \u6587\u4ef6\u914d\u7f6e\u3002\u6b64\u7c7b\u6587\u4ef6 <em>\u4ec5<\/em>\u88ab CGI\uff0fFastCGI SAPI \u5904\u7406\u3002\u6b64\u529f\u80fd\u4f7f\u5f97 PECL \u7684 htscanner \u6269\u5c55\u4f5c\u5e9f\u3002\u5982\u679c\u4f60\u7684 PHP \u4ee5\u6a21\u5757\u5316\u8fd0\u884c\u5728 Apache \u91cc\uff0c\u5219\u7528 .htaccess \u6587\u4ef6\u6709\u540c\u6837\u6548\u679c\u3002<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>\u9664\u4e86\u4e3b php.ini \u4e4b\u5916\uff0cPHP \u8fd8\u4f1a\u5728\u6bcf\u4e2a\u76ee\u5f55\u4e0b\u626b\u63cf INI \u6587\u4ef6\uff0c\u4ece\u88ab\u6267\u884c\u7684 PHP \u6587\u4ef6\u6240\u5728\u76ee\u5f55\u5f00\u59cb\u4e00\u76f4\u4e0a\u5347\u5230 web \u6839\u76ee\u5f55\uff08<code>$_SERVER['DOCUMENT_ROOT']<\/code> \u6240\u6307\u5b9a\u7684\uff09\u3002\u5982\u679c\u88ab\u6267\u884c\u7684 PHP \u6587\u4ef6\u5728 web \u6839\u76ee\u5f55\u4e4b\u5916\uff0c\u5219\u53ea\u626b\u63cf\u8be5\u76ee\u5f55\u3002<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>\u8fd9\u91cc\u5c31\u5f88\u6e05\u695a\u4e86\uff0c<code>.user.ini<\/code>\u5b9e\u9645\u4e0a\u5c31\u662f\u4e00\u4e2a\u53ef\u4ee5\u7531\u7528\u6237\u201c\u81ea\u5b9a\u4e49\u201d\u7684php.ini\uff0c\u6211\u4eec\u80fd\u591f\u81ea\u5b9a\u4e49\u7684\u8bbe\u7f6e\u662f\u6a21\u5f0f\u4e3a\u201cPHP_INI_PERDIR \u3001 PHP_INI_USER\u201d\u7684\u8bbe\u7f6e\u3002<\/p><\/blockquote>\n\n\n\n<p>\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\uff0c\u81ea\u52a8\u5305\u542b\u5728\u8981\u6267\u884c\u7684\u6587\u4ef6\u524d\uff0c\u7c7b\u4f3c\u4e8e\u5728\u6587\u4ef6\u524d\u8c03\u7528\u4e86require()\u51fd\u6570\u3002\u800cauto_append_file\u7c7b\u4f3c\uff0c\u53ea\u662f\u5728\u6587\u4ef6\u540e\u9762\u5305\u542b\u3002 \u4f7f\u7528\u65b9\u6cd5\u5f88\u7b80\u5355\uff0c\u76f4\u63a5\u5199\u5728.user.ini\u4e2d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">auto_prepend_file=1.png<\/pre>\n\n\n\n<p>1.png\u662f\u8981\u5305\u542b\u7684\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\uff0c\u6211\u4eec\u53ef\u4ee5\u501f\u52a9.user.ini\u8f7b\u677e\u8ba9\u6240\u6709php\u6587\u4ef6\u90fd\u201c\u81ea\u52a8\u201d\u5305\u542b\u67d0\u4e2a\u6587\u4ef6\uff0c\u800c\u8fd9\u4e2a\u6587\u4ef6\u53ef\u4ee5\u662f\u4e00\u4e2a\u6b63\u5e38php\u6587\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u5305\u542b\u4e00\u53e5\u8bdd\u7684webshell\u3002<\/p>\n\n\n\n<p>\u4e0a\u4f20\u6210\u529f\u540e\uff0c\u8fc7\u6bb5\u65f6\u95f4\uff08\u5927\u69825\u5206\u949f\uff09\uff0c\u8bbf\u95ee\u4e0a\u4f20\u76ee\u5f55\u4e0b\u7684php\u6587\u4ef6\uff0c\u50cf<strong>index.php<\/strong>,\u5c31\u4f1a\u5305\u542b\u7684\u6587\u4ef6\u5f53php\u6587\u4ef6\u6267\u884c\uff0c\u5982\u679c\u4e0a\u4f20cat flag\u7684\u51fd\u6570\uff0c\u5219\u8bbf\u95eeindex.php\u5c31\u51fa\u73b0flag\uff1b\u5982\u679c\u4e0a\u4f20\u4e00\u53e5\u8bdd\u6728\u9a6c\uff0c\u5219\u5c06index.php\u6240\u5728\u4f4d\u7f6e\u5f53\u5730\u5740\u586b\u5165\u83dc\u5200\u6216\u8681\u5251<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">ZIP\u4e0a\u4f20\u5b9e\u73b0\u76ee\u5f55\u7a7f\u8d8a<\/h4>\n\n\n\n<p>\u5728\u6587\u4ef6\u4e0a\u4f20\u4e2d\uff0c\u6709\u4e9b\u4e0a\u4f20\u652f\u6301ZIP\u538b\u7f29\u5305\u6587\u4ef6\uff0c\u6216\u5c06\u4e0d\u662f\u538b\u7f29\u5305\u683c\u5f0f\u7684\u6587\u4ef6\u8fdb\u884c\u538b\u7f29\u518d\u4e0a\u4f20\uff0c\u540e\u7aef\u518d\u8fdb\u884c\u89e3\u538b\u3002<\/p>\n\n\n\n<p>\u5f88\u591a\u7a0b\u5e8f\u4f1a\u5728\u89e3\u538b\u5b8c\u540e\u68c0\u6d4b\u76ee\u5f55\u4e0b\u662f\u5426\u5b58\u5728\u811a\u672c\u6587\u4ef6\uff0c\u6709\u5219\u8fdb\u884c\u5220\u9664\uff08readdir\u51fd\u6570\u83b7\u53d6\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>foreach($archive-&gt;listContent() as $value){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $filename = $value&#91;\"filename\"];<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if(preg_match('\/\\.php$\/', $filename)){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit(\"\u538b\u7f29\u5305\u5185\u4e0d\u5141\u8bb8\u542b\u6709php\u6587\u4ef6!\");<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<\/code><\/pre>\n\n\n\n<p>\u4f8b\u5982\u8fd9\u6bb5\u4ee3\u7801\u7528\u6b63\u5219\u5339\u914d\u8fc7\u6ee4php\u540e\u7f00\u7684\u6587\u4ef6<\/p>\n\n\n\n<p><strong>\u5b9e\u73b0\u7ed5\u8fc7<\/strong><\/p>\n\n\n\n<p>1\u3001\u89e3\u538b\u4ea7\u751f\u5f02\u5e38\u5b9e\u73b0\u7ed5\u8fc7<\/p>\n\n\n\n<p>\u6709\u4e9b\u7a0b\u5e8f\u4f1a\u5728\u89e3\u538b\u5931\u8d25\u540e\u7acb\u5373\u9000\u51fa\u7a0b\u5e8f<\/p>\n\n\n\n<p>\u8fd9\u65f6\u53ef\u4ee5\u6784\u9020\u89e3\u538b\u5230\u4e00\u534a\u5931\u8d25\u7684ZIP\u5305\uff0c\u7528010Editor\u4fee\u6539ZIP\u5305\uff0c\u5728xxx.php\u540e\u5185\u5bb9\u4fee\u6539\u4e3a0xff\uff0c\u4fdd\u5b58\u4e0a\u4f20<\/p>\n\n\n\n<p>2\u3001\u89e3\u538b\u7279\u6b8a\u6587\u4ef6\u5b9e\u73b0\u7ed5\u8fc7<\/p>\n\n\n\n<p>\u6709\u4e9b\u4ee3\u7801\u5728\u89e3\u538b\u5931\u8d25\u540e\u4f1a\u5220\u9664\u6587\u4ef6<\/p>\n\n\n\n<p>\u5219\u4e0a\u8ff0\u65b9\u6cd5\u4e0d\u53ef\u884c<\/p>\n\n\n\n<p>\u5982\u679c\u5728\u89e3\u538b\u6587\u4ef6\u65f6\u89e3\u538b\u51fa\u6587\u4ef6\u540d\u542b\u6709\u201c..\/\u201d\u5b57\u7b26\u5b9e\u73b0\u76ee\u5f55\u7a7f\u8d8a\u8df3\u51fa\u4e0a\u4f20\u76ee\u5f55\uff0c\u5219\u4e0d\u4f1a\u88abcheck_dir\u5220\u9664<\/p>\n\n\n\n<p>\u7528010Editor\u6253\u5f00\u542b\u6709php\u6587\u4ef6\u7684\u538b\u7f29\u5305<\/p>\n\n\n\n<p>\u627e\u5230\u542b\u6709\u6587\u4ef6\u540d\u7684\u90a3\u884c\u8fdb\u884c\u4fee\u6539<\/p>\n\n\n\n<figure class=\"wp-block-image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/gitee.com\/Hermitaria\/blogimage\/raw\/master\/20210327010931.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/gitee.com\/Hermitaria\/blogimage\/raw\/master\/20210327010931.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20210327010924363\"\/><\/div><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/gitee.com\/Hermitaria\/blogimage\/raw\/master\/20210327011143.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/gitee.com\/Hermitaria\/blogimage\/raw\/master\/20210327011143.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20210327011143744\"\/><\/div><\/figure>\n\n\n\n<p>..\/\u5b9e\u73b0\u8df3\u8dc3\u4e0a\u7ea7\uff0c.php\u540e\u7684\u540e\u7f00\u540d\u5229\u7528Apache\u89e3\u6790\u6f0f\u6d1e\uff0c\u5339\u914d\u5230\u4e0d\u5b58\u5728\u7684\u540e\u7f00\u540d\u7ee7\u7eed\u5411\u5de6\u5339\u914d\uff0c\u76f4\u5230\u53ef\u4ee5\u89e3\u6790\u4e3a\u6b62\uff0c\u6700\u7ec8\u8df3\u8dc3\u5230\u6839\u76ee\u5f55\u4e0b\uff0c\u76f4\u63a5\u8bbf\u95ee\u53ef\u4ee5\u5f97\u5230flag<\/p>\n\n\n\n<p>3\u3001\u5236\u4f5c\u8f6f\u8fde\u63a5<\/p>\n\n\n\n<p>\u5f53apache\u4e0d\u80fd\u89e3\u6790php\u65f6\uff0c\u53ef\u4ee5\u5236\u4f5c\u8f6f\u8fde\u63a5\u8fdb\u884c\u94fe\u63a5\u5230flag\u6216\u8bfb\u53d6\u6839\u76ee\u5f55<\/p>\n\n\n\n<p>\u9898\u76ee\u63d0\u793a\u5728\u78c1\u76d8\u6839\u76ee\u5f55\u653e\u4e86\u540d\u4e3aflag\u7684\u6587\u4ef6<\/p>\n\n\n\n<p>\u56e0\u6b64\u5c06\u8f6f\u8fde\u63a5\u94fe\u63a5\u5230\u6839\u76ee\u5f55\u7684flag\uff0c\u540d\u4e3aa<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ln -s \/flag a<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u4e0d\u6e05\u695aflag\u5728\u54ea\uff0c\u53ef\u4ee5\u5148\u8bfb\u53d6\u6839\u76ee\u5f55<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ln -s \/ a<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u5c06\u8f6f\u8fde\u63a5a\u6253\u5305\u6210b.zip<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>zip --symlinks b.zip a<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u81ea\u52a8\u89e3\u538b\uff0c\u70b9\u51fba\u5c31\u53ef\u4e0b\u8f7dflag<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u4ef6\u4e0a\u4f20\u9a8c\u8bc1 \u6587\u4ef6\u5934\u9a8c\u8bc1 jpg\u683c\u5f0f\u56fe\u7247\uff0c\u6587\u4ef6\u5934\u4e3aJFIF gif\u683c\u5f0f\u7684\u56fe\u7247\uff0c\u6587\u4ef6\u5934\u4e3aGIF89a png\u683c\u5f0f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[10],"_links":{"self":[{"href":"http:\/\/101.34.19.194\/index.php?rest_route=\/wp\/v2\/posts\/83"}],"collection":[{"href":"http:\/\/101.34.19.194\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/101.34.19.194\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/101.34.19.194\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/101.34.19.194\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=83"}],"version-history":[{"count":8,"href":"http:\/\/101.34.19.194\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions"}],"predecessor-version":[{"id":311,"href":"http:\/\/101.34.19.194\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions\/311"}],"wp:attachment":[{"href":"http:\/\/101.34.19.194\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/101.34.19.194\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/101.34.19.194\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}