{"id":337,"date":"2017-12-03T00:18:19","date_gmt":"2017-12-02T16:18:19","guid":{"rendered":"http:\/\/120.76.142.240\/?p=337"},"modified":"2017-12-03T00:18:19","modified_gmt":"2017-12-02T16:18:19","slug":"discuz%e4%bb%bb%e6%84%8f%e6%96%87%e4%bb%b6%e5%88%a0%e9%99%a4%e6%bc%8f%e6%b4%9e%e5%a4%8d%e7%8e%b0","status":"publish","type":"post","link":"http:\/\/ssynas.top\/?p=337","title":{"rendered":"discuz\u4efb\u610f\u6587\u4ef6\u5220\u9664\u6f0f\u6d1e\u590d\u73b0"},"content":{"rendered":"<p>\u597d\u957f\u65f6\u95f4\u6ca1\u66f4\u65b0\u4e86,\u6700\u8fd1\u6bd4\u8f83\u61d2\u3002<\/p>\n<h1><strong>0x00 \u6982\u8ff0<\/strong><\/h1>\n<p><strong>Discuz!X<\/strong><strong>\u793e\u533a\u8f6f\u4ef6\uff0c\u662f\u4e00\u4e2a\u91c7\u7528<\/strong><strong> PHP <\/strong><strong>\u548c<\/strong><strong> MySQL <\/strong><strong>\u7b49\u5176\u4ed6\u591a\u79cd\u6570\u636e\u5e93\u6784\u5efa\u7684\u6027\u80fd\u4f18\u5f02\u3001\u529f\u80fd\u5168\u9762\u3001\u5b89\u5168\u7a33\u5b9a\u7684\u793e\u533a\u8bba\u575b\u5e73\u53f0\u3002\u4f46\u662f\u4efb\u4f55\u4ee3\u7801\u90fd\u4f1a\u56e0\u4e3a\u4e0d\u53ef\u907f\u514d\u7684\u539f\u56e0\u800c\u5b58\u5728\u7740\u5b89\u5168\u95ee\u9898\u3002\u8fd9\u6b21\u7684\u4efb\u610f\u6587\u4ef6\u5220\u9664\u4e00\u662f\u56e0\u4e3a\u540e\u53f0\u53d8\u91cf\u6ca1\u6709\u5bf9\u524d\u7aef\u4f20\u56de\u7684\u6570\u636e\u505a\u6821\u9a8c\uff0c\u7406\u8bba\u4e0a\u4e0b\u62c9\u6846\u53ea\u80fd\u4f20\u56de\u6846\u4e2d\u7684\u6570\u636e\uff08\u9009\u62e9\u6846\u540c\u7406\uff09\uff0c\u4f20\u6765\u4ec0\u4e48\u5c31\u662f\u4ec0\u4e48\u3002\u5982\u679c\u4e0d\u662f\uff0c\u90a3\u4e48\u80af\u5b9a\u662f\u88ab\u4eba\u6539\u8fc7\uff0c\u76f4\u63a5\u6254\u6389\u8fd9\u4e2a\u5305\u5e76\u8bb0\u5f55<\/strong><strong>IP<\/strong><strong>\uff1b\u4e8c\u662f\u56e0\u4e3a<\/strong><strong>Discuz<\/strong><strong>\u7684\u529f\u80fd\u5f88\u5168\uff0c\u6709\u5220\u9664\u6587\u4ef6\u7684\u529f\u80fd\uff0c\u4f46\u662f\u6743\u9650\u7ba1\u7406\u7684\u4e0d\u597d\u3002\u5220\u9664\u6587\u4ef6\u8fd9\u79cd\u654f\u611f\u7684\u64cd\u4f5c\u5e94\u8be5\u505a\u4e00\u4e9b\u9650\u5236\u3002\u8fd9\u91cc\u6070\u597d\u5220\u9664\u6587\u4ef6\u7684\u4ee3\u7801\u91cc\u9762\u5305\u542b\u7740\u53ef\u4ee5\u88ab\u4fee\u6539\u7684\u6570\u636e\uff0c\u4e8e\u662f\u6f0f\u6d1e\u5c31\u4ea7\u751f\u4e86\u3002<\/strong><\/p>\n<h1><strong>0x01 \u6f0f\u6d1e\u590d\u73b0<\/strong><\/h1>\n<p><strong>\u73af\u5883\uff1a<\/strong><strong>win10+phpstudy<\/strong><strong>\uff08<\/strong><strong>php5.6<\/strong><strong>\uff09<\/strong><strong>+discuz3.2<\/strong><strong>\uff08<\/strong><strong>2.8-3.3<\/strong><strong>\u90fd\u53ef\u4ee5\uff09<\/strong><\/p>\n<p><strong>0x00<\/strong><strong>\u3001\u521b\u5efa\u4e00\u4e2a\u6d4b\u8bd5\u6587\u4ef6<\/strong><strong>text.txt<\/strong><strong>\u5230\u7f51\u7ad9\u6839\u76ee\u5f55\u4e0b<\/strong><\/p>\n<p><strong>0x01<\/strong><strong>\u3001\u627e\u5230<\/strong><strong>formhash<\/strong><strong>\u7684\u503c<\/strong><\/p>\n<p><strong>0x02<\/strong><strong>\u3001\u4fee\u6539\u67d0\u4e00\u8868\u5355\u7684\u503c\u4e3a\u6d4b\u8bd5\u6587\u4ef6\u7684\u76f8\u5bf9\u4f4d\u7f6e<\/strong><strong>..\/..\/..\/text.txt<\/strong><\/p>\n<p><strong>0x03<\/strong><strong>\u3001\u4e0a\u4f20\u56fe\u7247\u5230\u4e0a\u8ff0\u8868\u5355\u7684\u53d8\u91cf\u4e2d\uff08\u76f4\u63a5<\/strong><strong>POST<\/strong><strong>\u6216\u8005\u81ea\u5df1\u6784\u9020\u8868\u5355\uff09<\/strong><\/p>\n<p><strong>0x04<\/strong><strong>\u3001\u5220\u9664\u6210\u529f<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-339\" src=\"http:\/\/120.76.142.240\/wp-content\/uploads\/2017\/12\/1.png\" alt=\"\" width=\"1428\" height=\"799\" \/><\/p>\n<p>\u8fdb\u5165\u81ea\u5df1\u7684\u4e2a\u4eba\u8d44\u6599\u9875\u9762\uff0c\u627e\u5230\u51fa\u751f\u5730<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-340\" src=\"http:\/\/120.76.142.240\/wp-content\/uploads\/2017\/12\/2.png\" alt=\"\" width=\"657\" height=\"342\" \/><\/p>\n<p>\u7528burp\u6293\u5305\u76f4\u63a5\u6539\u4e3a..\/..\/..\/text.txt<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-341\" src=\"http:\/\/120.76.142.240\/wp-content\/uploads\/2017\/12\/3.png\" alt=\"\" width=\"706\" height=\"366\" \/><\/p>\n<p><strong>\u627e\u5230<\/strong><strong>formhash<\/strong><strong>\u7684\u503c<\/strong><\/p>\n<p><strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-343\" src=\"http:\/\/120.76.142.240\/wp-content\/uploads\/2017\/12\/5.png\" alt=\"\" width=\"1889\" height=\"873\" \/><\/strong><\/p>\n<p><strong>\u6784\u9020\u4e0a\u4f20\u6587\u4ef6\u7684\u8868\u5355\uff0c\u4e0a\u4f20\u56fe\u7247<\/strong><\/p>\n<ul>\n<li><strong>&lt;form action=&#8221;http:\/\/localhost\/upload\/home.php?mod=spacecp&amp;ac=profile&amp;op=base&#8221; method=&#8221;POST&#8221; enctype=&#8221;multipart\/form-data&#8221;&gt;<\/strong><\/li>\n<li><strong>&lt;input type=&#8221;file&#8221; name=&#8221;birthprovince&#8221; id=&#8221;file&#8221; \/&gt;<\/strong><\/li>\n<li><strong>&lt;input type=&#8221;text&#8221; name=&#8221;formhash&#8221; value=&#8221;c2e379bc&#8221;\/&gt;&lt;\/p&gt;<\/strong><\/li>\n<li><strong>&lt;input type=&#8221;text&#8221; name=&#8221;profilesubmit&#8221; value=&#8221;1&#8243;\/&gt;&lt;\/p&gt;<\/strong><\/li>\n<li><strong>&lt;input type=&#8221;submit&#8221; value=&#8221;Submit&#8221; \/&gt;<\/strong><\/li>\n<li><strong>&lt;\/from&gt;<\/strong><\/li>\n<\/ul>\n<p><strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-348\" src=\"http:\/\/120.76.142.240\/wp-content\/uploads\/2017\/12\/y.png\" alt=\"\" width=\"1894\" height=\"1264\" \/><\/strong><\/p>\n<p><strong>\u4e0a\u4f20\u4efb\u610f\u56fe\u7247\u6587\u4ef6<\/strong><\/p>\n<p><strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-344\" src=\"http:\/\/120.76.142.240\/wp-content\/uploads\/2017\/12\/234.png\" alt=\"\" width=\"1485\" height=\"279\" \/><\/strong><\/p>\n<p><strong>\u67e5\u770b\u7f51\u7ad9\u76ee\u5f55\uff0ctext.txt\u5df2\u7ecf\u6210\u529f\u5220\u9664<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-351\" src=\"http:\/\/120.76.142.240\/wp-content\/uploads\/2017\/12\/1-2.png\" alt=\"\" width=\"1572\" height=\"1273\" \/><\/p>\n<h1><strong>0x02 \u6f0f\u6d1e\u539f\u7406<\/strong><\/h1>\n<p><strong>\u5148\u770b\u7684\u5b98\u65b9\u8865\u4e01\uff1a\u4e4b\u95f4\u5220\u9664\u4e86\u6240\u6709\u7684<\/strong><strong>unlike<\/strong><strong>\u8bed\u53e5<\/strong><\/p>\n<p><strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-350\" src=\"http:\/\/120.76.142.240\/wp-content\/uploads\/2017\/12\/2-1.png\" alt=\"\" width=\"1787\" height=\"899\" \/><\/strong><\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"519\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u5012\u7740\u770b\uff0c<\/strong><strong>unlike<\/strong><strong>\u7528\u6765\u5220\u9664\u6587\u4ef6\uff1a<\/strong><\/p>\n<ul>\n<li><strong>@unlink(getglobal(&#8216;setting\/attachdir&#8217;).&#8217;.\/profile\/&#8217;.$verifyinfo[&#8216;field&#8217;][$key]);<\/strong><\/li>\n<\/ul>\n<ul>\n<li><strong>\u6240\u4ee5\u662f\u5411\u4e0a\u4e09\u7ea7\u76ee\u5f55<\/strong><strong>..\/..\/..\/<\/strong><\/li>\n<li><strong>\u5411\u4e0a\u770b\uff0c\u6709\u4e00\u6bb5\u5224\u65ad\u6587\u4ef6\u662f\u5426\u4e0a\u4f20\u6210\u529f\u7684\u4ee3\u7801<\/strong><\/li>\n<\/ul>\n<table>\n<tbody>\n<tr>\n<td width=\"0\"><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td width=\"519\">\n<table width=\"100%\">\n<tbody>\n<tr>\n<td><strong>if<\/strong>($_FILES) {<br \/>\n$upload = <strong>new <\/strong>discuz_upload();<br \/>\n<strong>foreach<\/strong>($_FILES <strong>as <\/strong>$key =&gt; $file) {<br \/>\n<strong>if<\/strong>(!<strong>isset<\/strong>($_G[\u2018cache\u2019][\u2018profilesetting\u2019][$key])) {<br \/>\n<strong>continue<\/strong>;<br \/>\n}<br \/>\n\/*\u8fd9\u91cc\u662f\u4e00\u4e9b\u68c0\u67e5\u6587\u4ef6\u662f\u5426\u4e0a\u4f20\u6210\u529f\u7684\u4ee3\u7801\uff0c\u5982\u679c\u4e0d\u6210\u529f\u4f1a\u505a\u76f8\u5e94\u7684\u53cd\u5e94*\/<br \/>\n@unlink(getglobal(&#8216;setting\/attachdir&#8217;).&#8217;.\/profile\/&#8217;.$space[$key]);<br \/>\n$setarr[$key] = $attach[&#8216;attachment&#8217;];<br \/>\n}<br \/>\n}<br \/>\n}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul>\n<li><strong>\u770b\u5230<\/strong><strong>space<\/strong><strong>\u8fd9\u4e2a\u53d8\u91cf<\/strong><\/li>\n<li><strong>\u770b\u770b<\/strong><strong>space_merge<\/strong><strong>\u8fd9\u4e2a\u51fd\u6570\uff0c\u662f\u7528\u6765\u8bbe\u7f6e\u4e2a\u4eba\u4fe1\u606f\u7684<\/strong><\/li>\n<li><strong>\u4e8e\u662f\u5728\u5176\u4e2d\u5c31\u627e\u5230\u4e00\u4e2a\u53d8\u91cf\uff0c\u8ba9\u5176\u53d8\u6210\u6587\u4ef6\u8def\u5f84\uff0c\u4e0a\u9762\u590d\u73b0\u7684\u65f6\u5019\u9009\u7684\u8fd9\u4e2a\u53d8\u91cf\u662f\u51fa\u751f\u5730\uff08<\/strong><strong>birthprovince<\/strong><strong>\uff09\uff0c\u4e4b\u540e\u4f60\u4e0a\u4f20\u4e86\u4e00\u4e2a\u6587\u4ef6\u540e\uff0c<\/strong>\u5c31\u4f1a\u6267\u884c@unlink(getglobal(<a href=\"mailto:\u5c31\u4f1a\u6267\u884c@unlink(getglobal(\u2018setting\/attachdir\u2019).\u2018.\/profile\/\u2019.$space%5b$key%5d)\">\u2018<\/a>setting\/attachdir<a href=\"mailto:\u5c31\u4f1a\u6267\u884c@unlink(getglobal(\u2018setting\/attachdir\u2019).\u2018.\/profile\/\u2019.$space%5b$key%5d)\">\u2019<\/a><a href=\"mailto:\u5c31\u4f1a\u6267\u884c@unlink(getglobal(\u2018setting\/attachdir\u2019).\u2018.\/profile\/\u2019.$space%5b$key%5d)\">).<\/a><a href=\"mailto:\u5c31\u4f1a\u6267\u884c@unlink(getglobal(\u2018setting\/attachdir\u2019).\u2018.\/profile\/\u2019.$space%5b$key%5d)\">\u2018<\/a>.\/profile\/<a href=\"mailto:\u5c31\u4f1a\u6267\u884c@unlink(getglobal(\u2018setting\/attachdir\u2019).\u2018.\/profile\/\u2019.$space%5b$key%5d)\">\u2019<\/a>.$space[$key])<strong>;<\/strong><\/li>\n<li><strong>\u800c\u8fd9\u4e2a\u65f6\u5019<\/strong><strong>$space<\/strong><strong>\u8fd9\u4e2a\u53d8\u91cf\u91cc\u662f\u6211\u4eec\u521a\u521a\u6539\u7684\u4efb\u610f\u6587\u4ef6\u7684\u8def\u5f84\uff0c\u4e8e\u662f\u4e4e\u5c31\u5220\u9664\u4e86\u8fd9\u4e2a\u6587\u4ef6<\/strong><\/li>\n<\/ul>\n<h1><strong>0x03 \u5199\u5728\u6700\u540e<\/strong><\/h1>\n<ul>\n<li><strong>\u4ee3\u7801\u529f\u5e95\u5341\u5206\u91cd\u8981\uff0c\u9700\u8981\u52a0\u5f3a\u3002<\/strong><\/li>\n<li><strong>\u6f0f\u6d1e\u590d\u73b0\u4e00\u5b9a\u8981\u4eb2\u81ea\u642d\u73af\u5883\u53bb\u8bd5\u8bd5\uff0c\u4e0d\u80fd\u5149\u770b\u522b\u4eba\u505a\uff0c\u5728\u505a\u7684\u8fc7\u7a0b\u4e2d\u4f1a\u9047\u5230\u5f88\u591a\u60f3\u4e0d\u5230\u7684\u95ee\u9898\uff0c\u540c\u65f6\u4e5f\u80fd\u5b66\u5230\u4e0d\u5c11\u4e1c\u897f\u3002<\/strong><\/li>\n<li><strong>\u591a\u5173\u6ce8\u5b89\u5168\u52a8\u6001\uff0c\u76ee\u524d\u6700\u65b0\u7684\u4e66\u4e0a\u7684\u4e1c\u897f\u4e5f\u5df2\u7ecf\u843d\u540e\u73b0\u5728\u8d77\u7801<\/strong><strong>1-2<\/strong><strong>\u5e74\u4e86<\/strong><\/li>\n<li><strong>\u4e00\u5b9a\u8981\u5228\u6839\u95ee\u5e95\uff0c\u6709\u7684\u65f6\u5019\u4e00\u4e9b\u7ec6\u8282\u53ef\u80fd\u6b63\u662f\u95ee\u9898\u7684\u5173\u952e\u3002\u6bd4\u5982\u8bf4\u8fd9\u6b21\u7684\u76ee\u5f55\u95ee\u9898\uff0c\u4e3a\u4ec0\u4e48\u662f\u5411\u4e0a\u4e09\u7ea7\uff0c\u770b\u4e86\u4ee3\u7801\u4e4b\u540e\u624d\u5f7b\u5e95\u660e\u767d\uff0c\u8fd9\u662f\u4e2a\u5f88\u5173\u952e\u7684\u5730\u65b9\u3002<\/strong><\/li>\n<li><strong>\u5b98\u65b9\u7684\u8865\u4e01\u76f4\u63a5\u628a\u6240\u6709<\/strong><strong>unlike<\/strong><strong>\u8bed\u53e5\u5168\u90e8\u5220\u9664\u4e86\uff0c\u867d\u7136\u786e\u5b9e\u662f\u4e0d\u80fd\u5220\u9664\u6587\u4ef6\u4e86\u3002\u4f46\u662f\u7406\u8bba\u4e0a\u6765\u8bf4\u5e94\u8be5\u628a\u524d\u540e\u7aef\u90fd\u505a\u6821\u9a8c\uff0c\u5220\u9664\u6587\u4ef6\u7684\u8bed\u53e5\u8981\u68c0\u67e5\u6743\u9650\u3002<\/strong><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u597d\u957f\u65f6\u95f4\u6ca1\u66f4\u65b0\u4e86,\u6700\u8fd1\u6bd4\u8f83\u61d2\u3002 0x00 \u6982\u8ff0 Discuz!X\u793e&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-337","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/ssynas.top\/index.php?rest_route=\/wp\/v2\/posts\/337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/ssynas.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ssynas.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ssynas.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ssynas.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=337"}],"version-history":[{"count":0,"href":"http:\/\/ssynas.top\/index.php?rest_route=\/wp\/v2\/posts\/337\/revisions"}],"wp:attachment":[{"href":"http:\/\/ssynas.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ssynas.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=337"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ssynas.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}