{"id":253746,"date":"2022-10-02T08:02:27","date_gmt":"2022-10-02T00:02:27","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=253746"},"modified":"2022-09-28T11:02:48","modified_gmt":"2022-09-28T03:02:48","slug":"discuz-memcachessrf-getshell","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/discuz-memcachessrf-getshell.html","title":{"rendered":"Discuz memcache+ssrf GETSHELL\u6f0f\u6d1e\u89e3\u51b3\u65b9\u6cd5"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5f88\u591a\u540c\u5b66\u80af\u5b9a\u90fd\u6536\u5230\u963f\u91cc\u4e91\u63d0\u793a\u7684Discuz memcache+ssrf GETSHELL\u6f0f\u6d1e\u7684\u76f8\u5173\u8bf4\u660e\uff0c\u963f\u91cc\u4e0d\u65ad\u63d0\u9192\u5c31\u662f\u4e3a\u4e86\u60f3\u63a8\u5e7f\u4ed6\u4eec\u7684\u4ec0\u4e48\u4e91\u76fe\u5b89\u9a91\u58eb\u3002\u90a3\u4e48\uff0c\u9664\u4e86\u4f7f\u7528\u4e91\u76fe\u5b89\u9a91\u58eb\u4e4b\u5916\uff0c\u8fd8\u6709\u4ec0\u4e48\u65b9\u6cd5\u53ef\u4ee5\u4fee\u590d\u8fd9\u4e2a\u6f0f\u6d1e\u5462\uff1f\u4e0b\u9762\u5c31\u7ed9\u5927\u5bb6\u8bb2\u8ff0\u4e24\u79cd\u89e3\u51b3\u65b9\u6cd5\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u6f0f\u6d1e\u540d\u79f0\uff1aDiscuz memcache+ssrf GETSHELL\u6f0f\u6d1e<\/p>\n

\u6f0f\u6d1e\u7c7b\u578b\uff1aWeb-CMS\u6f0f\u6d1e<\/p>\n

\u6f0f\u6d1e\u63cf\u8ff0\uff1aDiscuz\u5b58\u5728SSRF\u6f0f\u6d1e\uff0c\u5728\u914d\u7f6e\u4e86memcache\u7684\u60c5\u51b5\u4e0b\uff0c\u653b\u51fb\u8005\u53ef\u4ee5\u5229\u7528ssrf\u901a\u8fc7memcache\u4e2d\u8f6c\uff0c\u5411\u78c1\u76d8\u4e0a\u5199\u5165WEBSHELL\u6076\u610f\u4ee3\u7801\uff0c\u4ece\u800c\u9020\u6210\u6570\u636e\u5e93\u6cc4\u6f0f\u3002\u4efb\u4f55\u7684\u5916\u90e8\u8f93\u5165\uff0c\u5305\u62ecmemcache\u7f13\u5b58\u90fd\u5e94\u8be5\u8ba4\u4e3a\u4e0d\u53ef\u4fe1\uff0c\u5efa\u8bae\u5728\u4efb\u4f55\u4ece\u5916\u90e8\u8f93\u5165\u7684\u6570\u636e\u90fd\u8fdb\u884c\u5fc5\u8981\u7684\u8f6c\u4e49\u548c\u8fc7\u6ee4\uff0c\u53ef\u7981\u7528preg_replace \/e\u4ee3\u7801\u6267\u884c\u3002<\/p>\n

\u89e3\u51b3\u65b9\u6cd5\u4e00<\/strong><\/div>\n

\u6253\u5f00\/source\/function\/function_core.php<\/p>\n

\u641c\u7d22\u5982\u4e0b\u4ee3\u7801\uff1a\uff08\u5927\u6982\u5728\u6587\u4ef6\u76841089\u884c\u5de6\u53f3\uff09<\/p>\n

\r\n$content = preg_replace($_G['setting']['output']['preg']['search'], $_G['setting']['output']['preg']['replace'], $content);\r\n<\/pre>\n

\u5728\u4e0a\u9762\u52a0\u5165\uff08\u770b\u6e05\u695a\u4e00\u5b9a\u662f\u4e0a\u9762\uff09\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n

\r\nif (preg_match(\"(\/|#|\\+|%).*(\/|#|\\+|%)e\", $_G['setting']['output']['preg']['search']) !== FALSE) { die(\"request error\"); }\r\n<\/pre>\n

\u4fee\u6539\u5b8c\u6210\u4e4b\u540e\u66ff\u6362\u6389\u670d\u52a1\u5668\u4e0a\u7684\u6587\u4ef6\u3002<\/p>\n

\u89e3\u51b3\u65b9\u6cd5\u4e8c<\/strong><\/div>\n

\u505c\u6b62\u4f7f\u7528\u6216\u5378\u8f7dmemcache\u3002<\/p>\n

\u505c\u6b62\u4f7f\u7528memcache<\/strong><\/span><\/div>\n

\u767b\u5f55discuz\u7ba1\u7406\u540e\u53f0-\u5168\u5c40-\u6027\u80fd\u4f18\u5316-\u5185\u5b58\u4f18\u5316\uff0c\u67e5\u770b\u7f51\u7ad9\u652f\u4e0d\u652f\u6301memcache\uff0c\u4ee5\u53ca\u6709\u6ca1\u6709\u5f00\u542f\uff0c\u5047\u5982\u5f00\u542f\u7684\u8bdd\u5c31\u5173\u95ed\u3002<\/p>\n

\"\"<\/p>\n

\u5378\u8f7dmemcache<\/strong><\/span><\/div>\n

Windows\u4e0b\u7684memcache\u5378\u8f7d\u65b9\u6cd5\uff1a<\/p>\n

\r\nmemcached -d stop\r\n\r\nmemcached -d remove\r\n\r\nsc delete \"Memcached Server\"\r\n<\/pre>\n

linux\u4e0b\u7684memcached\u5378\u8f7d\u65b9\u6cd5\uff1a<\/p>\n

1\u3001\u9996\u5148\u67e5\u627e\u4f60\u7684memcached\u6240\u5728\u76ee\u5f55\uff0c\u53ef\u7528\u5982\u4e0b\u547d\u4ee4\u67e5\u627e\u540d\u4e3amemcached\u7684\u6587\u4ef6\u5939 find \/ -name memcached<\/p>\n

2\u3001\u7ed3\u675fmemcached\u8fdb\u7a0b killall memcached<\/p>\n

3\u3001\u5220\u9664memcached\u76ee\u5f55\u53ca\u6587\u4ef6 rm -rf \/www\/wdlinux\/memcached rm -rf \/www\/wdlinux\/init.d\/memcached<\/p>\n

4\u3001\u5173\u95edmemcached\u5f00\u673a\u542f\u52a8 chkconfig memcached off<\/p>\n

5\u3001\u628amemcached\u79fb\u51fa\u5f00\u673a\u542f\u52a8 chkconfig --del memcached<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6f0f\u6d1e\u540d\u79f0\uff1aDiscuz memcache+ssrf GETSHELL\u6f0f\u6d1e \u6f0f\u6d1e\u7c7b\u578b\uff1aWeb-CMS\u6f0f\u6d1e \u6f0f\u6d1e\u63cf […]<\/p>\n","protected":false},"author":1903,"featured_media":253749,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-253746","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/253746","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1903"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=253746"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/253746\/revisions"}],"predecessor-version":[{"id":253748,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/253746\/revisions\/253748"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/253749"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=253746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=253746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=253746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}