{"id":1109,"date":"2025-12-27T11:46:25","date_gmt":"2025-12-27T03:46:25","guid":{"rendered":"https:\/\/lalaland.wlzy.online\/?p=1109"},"modified":"2026-01-08T01:15:34","modified_gmt":"2026-01-07T17:15:34","slug":"wordpress%e8%a2%ab%e9%bb%91%e5%ae%a2%e7%88%86%e7%a0%b4%e5%af%86%e7%a0%81%e7%9a%84%e5%af%b9%e7%ad%96","status":"publish","type":"post","link":"https:\/\/lalaland.wlzy.online\/?p=1109","title":{"rendered":"\u7f51\u7edc\u653b\u9632\uff1awordpress\u88ab\u9ed1\u5ba2\u7206\u7834\u5bc6\u7801\u65f6\u7684\u5bf9\u7b56"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u75c7\u72b61\u2014\u2014\/xmlrpc.php\u7206\u7834<\/h2>\n\n\n\n<p>\u5728wordpress\u7684\u65e5\u5fd7\u63d2\u4ef6\u91cc\u53d1\u73b0\u5927\u91cf\u767b\u9646\u5c1d\u8bd5\uff0c\u6765\u81ea\u5404\u79cdIP\uff0c\u67e5\u770bdocker logs\u53d1\u73b0\u5927\u91cf\u7c7b\u4f3c&#8221;POST \/xmlrpc.php HTTP\/1.0&#8243;\u8fd9\u6837\u7684\u8bf7\u6c42\u3002<\/p>\n\n\n\n<p><strong>\u4e00\u3001xmlrpc.php \u662f\u4ec0\u4e48\uff1f<\/strong><\/p>\n\n\n\n<p>xmlrpc.php \u662f WordPress \u81ea\u5e26\u7684\u4e00\u4e2a\u8fdc\u7a0b\u63a5\u53e3\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>\u534f\u8bae\uff1aXML-RPC<\/p>\n\n\n\n<p>\u4f5c\u7528\uff1a\u5141\u8bb8 \u201c\u4e0d\u901a\u8fc7\u7f51\u9875\u201d \u6765\u8fdc\u7a0b\u64cd\u4f5c WordPress<\/p>\n\n\n\n<p>\u8bde\u751f\u80cc\u666f\uff1a\u79fb\u52a8\u7aef \/ \u684c\u9762\u5ba2\u6237\u7aef\u65f6\u4ee3<\/p>\n\n\n\n<p>\u6587\u4ef6\u4f4d\u7f6e\uff1a\/wordpress\/xmlrpc.php<\/p>\n\n\n\n<p><strong>\u4e8c\u3001\u5b83\u672c\u6765\u662f\u5e72\u561b\u7528\u7684\uff1f\uff08\u6b63\u5e38\u7528\u9014\uff09<\/strong><\/p>\n\n\n\n<p>\u8fdc\u7a0b\u53d1\u6587\u7ae0 \/ \u7ba1\u7406\u7f51\u7ad9<\/p>\n\n\n\n<p>\u4f8b\u5982\uff1aWordPress \u5b98\u65b9\u624b\u673a App\uff0c\u8001\u5f0f\u535a\u5ba2\u5ba2\u6237\u7aef\uff08Windows \/ macOS\uff09<\/p>\n\n\n\n<p>\u5b83\u53ef\u4ee5\u505a\uff1a\u767b\u5f55\uff0c\u53d1\u6587\u7ae0\uff0c\u6539\u6587\u7ae0\uff0c\u83b7\u53d6\u8bc4\u8bba<\/p>\n\n\n\n<p><strong>\u4e09\u3001\u90a3\u4e3a\u4ec0\u4e48\u9ed1\u5ba2\u300c\u7279\u522b\u7231\u300d\u5b83\uff1f\uff08\u6838\u5fc3\uff09<\/strong><\/p>\n\n\n\n<p>\u56e0\u4e3a\u5b83\u662f\u5b8c\u7f8e\u7684\u653b\u51fb\u5165\u53e3\uff0c\u5b83\u80fd\u7ed5\u8fc7\u4f20\u7edf\u767b\u5f55\u9650\u5236<\/p>\n\n\n\n<p>\/wp-login.php\uff1a\u6709\u9a8c\u8bc1\u7801\uff0c\u6709\u5931\u8d25\u6b21\u6570\u9650\u5236\uff0c\u6709\u63d2\u4ef6\u9632\u62a4<\/p>\n\n\n\n<p>xmlrpc.php\uff1a \u9ed8\u8ba4\u65e0\u9a8c\u8bc1\u7801\uff0c\u9ed8\u8ba4\u65e0\u767b\u5f55\u6b21\u6570\u9650\u5236\uff0c\u4e0d\u8d70 wp-login \u6d41\u7a0b\uff0c\u5929\u751f\u5c31\u662f\u7206\u7834\u63a5\u53e3<\/p>\n\n\n\n<p><strong>\u56db\u3001\u6211\u81ea\u5df1\u4f1a\u4e0d\u4f1a\u300c\u6b63\u5e38\u7528\u5230\u300d\u5b83\uff1f<\/strong><br>\u5bf9 90% \u7684\u4e2a\u4eba \/ \u535a\u5ba2 \/ \u4f01\u4e1a\u7ad9\uff0c\u4e0d\u4f1a\u7528\u5230<\/p>\n\n\n\n<p>\u4f60\u53ef\u4ee5\u81ea\u6d4b\u4e00\u4e0b\u9879\u76ee\uff0c\u5982\u679c\u5168\u90e8\u90fd\u662f NO\uff0c\u5c31\u53ef\u4ee5\u653e\u5fc3\u7981\u7528\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u573a\u666f<\/th><th>\u662f\u5426\u4f7f\u7528<\/th><\/tr><\/thead><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>\u7528 WordPress \u624b\u673a App \u53d1\u6587\u7ae0<\/td><td>\u274c<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>\u7528 Jetpack<\/td><td>\u274c<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>\u7528 WordPress.com \u8fdc\u7a0b\u7ba1\u7406<\/td><td>\u274c<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>\u4f9d\u8d56 Pingback<\/td><td>\u274c<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>\u7b2c\u4e09\u65b9\u535a\u5ba2\u5ba2\u6237\u7aef<\/td><td>\u274c<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>\u4e94\u3001\u6700\u4f73\u5b9e\u8df5\uff1a\u600e\u4e48\u5904\u7406 xmlrpc.php\uff1f<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b9\u6848 1\uff08\u5f3a\u70c8\u63a8\u8350\uff09\uff1a\u76f4\u63a5\u7981\u7528<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Nginx<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>location = \/xmlrpc.php {\n    deny all;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b9\u6848 2\uff1a\u53ea\u5141\u8bb8\u81ea\u5df1 IP\uff08\u5982\u679c\u4f60\u8981\u7528\u7684\u8bdd\uff09<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>location = \/xmlrpc.php {\n    allow YOUR.IP.ADDR;\n    deny all;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u75c7\u72b62\u2014\u2014\/wp-login.php\u7206\u7834\uff08\u8fdb\u9636\uff09<\/h2>\n\n\n\n<p>\u5982\u679c\u5e94\u7528\u4e86\u4e0a\u9762\u7684\u5bf9\u7b56\u4e4b\u540e\uff0c\u65e5\u5fd7\u91cc\u4f9d\u7136\u51fa\u73b0\u5f88\u591a\u767b\u5f55\u5c1d\u8bd5\uff0c\u4e14\u90fd\u662f\u901a\u8fc7wp-login.php\u8bbf\u95ee\u7684\uff0c\u90a3\u4e48\u8bf4\u660e<strong>\u9ed1\u5ba2\u5f00\u59cb\u76f4\u63a5\u603c\u4f60\u7684\u767b\u5f55\u9875\u9762<\/strong>\u4e86\u3002\u6bd4\u8f83\u63a8\u8350\u7684\u65b9\u6cd5\u662f<strong>\u9650\u5236\u6bcf\u4e2aIP\u5728\u5355\u4f4d\u65f6\u95f4\u5185\u7684\u767b\u5f55\u6b21\u6570<\/strong>\uff0c\u6bd4\u5982\u4e00\u5206\u949f\u8fbe\u52305\u6b21\u5c31\u6682\u65f6\u7981\u6b62\u8fd9\u4e2aIP\u767b\u5f55\u3002<\/p>\n\n\n\n<p>\u5177\u4f53\u5b9e\u73b0\u9700\u8981\u4fee\u6539\/etc\/nginx\/nginx.conf\u548c\/etc\/nginx\/sites-enable\/\u4f60\u7684\u9875\u9762\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \/etc\/nginx\/nginx.conf\n\nhttp {\n    \n    # =============  \u6dfb\u52a0\u90e8\u5206Start  =============\n    \n    # \u5b9a\u4e49login_limit_key\u6765\u8bbe\u7f6e\u8ba9\u8bbf\u95ee\u9650\u5236\u53ea\u5bf9POST\u8bf7\u6c42\u6709\u6548\uff0c\u8fd9\u6837\u7528\u6237\u6b63\u5e38\u7528GET\u6253\u5f00\u9875\u9762\u5c31\u4e0d\u4f1a\u88abcount\uff0c\u53ea\u6709\u70b9\u51fb\u767b\u5f55\u6309\u94ae\u4f1acount\n    map $request_method $login_limit_key {  \n        GET     \"\";\n        POST    $binary_remote_addr;  \n    }\n    \n    # \u8bbe\u7f6e\u4e0a\u9650\u6bcf\u5206\u949f5\u6b21\n    limit_req_zone $login_limit_key zone=wp_login:10m rate=5r\/m;\n\n    # =============  \u6dfb\u52a0\u90e8\u5206End  =============\n\n    ......\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># \/etc\/nginx\/sites-enable\/\u4f60\u7684\u9875\u9762\u914d\u7f6e\u6587\u4ef6\n\nserver{\n    \n    ......\n\n    # =============  \u6dfb\u52a0\u90e8\u5206Start  =============\n    location = \/wp-login.php {\n        limit_req zone=wp_login burst=3 nodelay;  # \u5141\u8bb8\u6781\u5feb\u901f\u5ea6\u77ac\u65f6\u8fde\u70b93\u6b21\uff0c\u7b97\u4e0a\u4e0a\u9762\u7684\u5c31\u662f8\u6b21\n        limit_req_status 429;\n\n        # \u4ee5\u4e0b\u56db\u884c\u7528\u4e8e\u5728docker\u53cd\u5411\u4ee3\u7406\u65f6\u8ba9\u8bf7\u6c42\u5e26\u6709\u8db3\u591f\u7684\u4fe1\u606f\uff0c\u4ee5\u907f\u514d\u52a0\u8f7d\u4e0d\u51facss\u548cjs\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n\n        proxy_pass http:\/\/127.0.0.1:8080;  # \u6837\u4f8b\uff0c\u8bf7\u586b\u5199\u4f60\u81ea\u5df1\u7684\u7f51\u7ad9\u5165\u53e3\u3002\u53e6\u5916\u8981\u6ce8\u610f<strong>\u4e0d\u8981\u5728\u6700\u540e\u52a0\u659c\u6760<\/strong>\uff0c\u90a3\u6837\u4f1a\u5bfc\u81f4\u767b\u9646\u9875\u9762\u6c38\u8fdc\u88ab\u91cd\u5b9a\u5411\u5230\u4e3b\u9875\n    }\n\n    # =============  \u6dfb\u52a0\u90e8\u5206End  =============\n\n    ......\n\n}<\/code><\/pre>\n\n\n\n<p>\u901a\u8fc7\u4ee5\u4e0a\u8bbe\u7f6e\u5c31\u53ef\u4ee5\u8ba9\u6bcf\u4e2aIP\u53ea\u80fd\u5728\u4e00\u5206\u949f\u5185\u767b\u5f555\u6b21\u3002\u5982\u679c\u9700\u8981\u8fdb\u4e00\u6b65\u9650\u5236\uff0c\u53ef\u4ee5\u4f7f\u7528fail2ban \/ CrowdSec\u6765\u8bbe\u7f6e\u5728\u4e00\u5b9a\u6761\u4ef6\u4e0b\u76f4\u63a5\u5c01\u7981IP\u3002<\/p>\n\n\n\n<p>\u6b64\u5916\uff0c\u8fd8\u6709\u4e00\u4e2a\u6709\u6548\u624b\u6bb5\u662f\u66f4\u6539\u767b\u5f55\u5165\u53e3url\uff0c\u5177\u4f53\u539f\u7406\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>\u9996\u5148WordPress \u5185\u90e8\u7684\u767b\u5f55\u5165\u53e3\u6c38\u8fdc\u662fwp-login.php\uff0c\u4e0d\u80fd\u771f\u7684\u6539\u540d\u3002<\/p>\n\n\n\n<p>\u6240\u8c13\u201c\u6362\u8def\u5f84\u201d\uff0c\u5b9e\u9645\u505a\u7684\u662f\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>\ud83d\udd01 \u5916\u90e8\u8bbf\u95ee \/my-secret-login-123 \u2192 nginx \u5185\u90e8\u8f6c\u53d1\u5230 \/wp-login.php<\/strong><\/p>\n<\/blockquote>\n\n\n\n<p>\u540c\u65f6\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\ud83d\udeab <strong>\u76f4\u63a5\u8bbf\u95ee <strong>\/<strong>wp-login.php<\/strong><\/strong>\u2192 \u62d2\u7edd<\/strong><\/p>\n<\/blockquote>\n\n\n\n<p>\u8fd9\u5bf9\u626b\u63cf\u5668\u662f<strong>\u81f4\u547d\u7684<\/strong>\uff0c\u56e0\u4e3a\u5b83\u4eec\u53ea\u4f1a\u626b\u56fa\u5b9a\u8def\u5f84\u3002<\/p>\n\n\n\n<p>\u5177\u4f53\u65b9\u6cd5\u53ea\u9700\u8981\u57fa\u4e8e\u4e0a\u9762\u7684<strong>\/etc\/nginx\/sites-enable\/\u914d\u7f6e\u6587\u4ef6<\/strong>\u8fdb\u884c\u8fdb\u4e00\u6b65\u4fee\u6539\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n\n    ......\n\n    # =============  \u6dfb\u52a0\u90e8\u5206Start  =============\n    \n    location = \/wp-login.php {\n\n            proxy_set_header Host $host;\n            proxy_set_header X-Real-IP $remote_addr;\n            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n            proxy_set_header X-Forwarded-Proto $scheme;\n\n        # \u7531\u4e8e\u6ce8\u9500\u6309\u94ae\u548c\u4e00\u4e9b\u5176\u5b83\u9875\u9762\u529f\u80fd\u4ecd\u7136\u4f1a\u4ece\u6d4f\u89c8\u5668\u8bbf\u95ee\u5e26URI\u7684wp-login.php\uff0c\u5e76\u4e14\u5728\u8bbf\u95ee\u540e\u505a\u4e00\u4e9b\u5de5\u4f5c\uff0c\u56e0\u6b64\u6211\u4eec\u53ea\u5c4f\u853d\u7eaf\/wp-login.php\uff0c\u5bf9\u4e8e\u540e\u9762\u5e26URI\u7684\u60c5\u51b5\u5219\u5168\u90e8\u653e\u884c\u3002\n        if ($args != \"\") {\n            proxy_pass http:\/\/127.0.0.1:8080;\n            break;\n        }\n        \n        # \u4f7f\u7528307\u8df3\u8f6c\u800c\u4e0d\u662f302\uff0c\u56e0\u4e3a307\u4ee3\u8868\u539f\u6837\u91cd\u653e\u8bf7\u6c42\uff0c\u4f1a\u5e26POST body\uff0c\u800c302\u8df3\u8f6c\u4e0d\u4f1a\n        return 307 \/my-secret-login-123;\n    }\n\n    location = \/my-secret-login-123 {\n\n        limit_req zone=wp_login burst=3 nodelay;\n\n        limit_req_status 429;\n\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n\n        # \u9700\u8981\u663e\u5f0f\u6307\u5b9aURI\uff0c\u5426\u5219\u767b\u5f55\u6309\u94ae\u4f1a\u76f4\u63a5\u8df3\u8f6c\u4e3b\u9875\u3002\n        proxy_pass http:\/\/127.0.0.1:8080\/wp-login.php;\n    }\n\n    # =============  \u6dfb\u52a0\u90e8\u5206End  =============\n\n    ......\n}<\/code><\/pre>\n\n\n\n<p>\u5b8c\u6210\u8fd9\u4e00\u6b65\u4e4b\u540e\u7684\u6548\u679c\u662f\uff1a\u5f53\u9ed1\u5ba2\u4f7f\u7528\u5de5\u5177\u7206\u7834POST \/wp-login.php\u65f6\uff0c\u4ed6\u7684\u5de5\u5177\u4f1a\u5f97\u5230\u4e00\u4e2a307\u8df3\u8f6c\u800c\u4e0d\u662f\u6b63\u5e38\u7684POST\u8fd4\u56de\u503c\u3002\u800c\u5982\u679c\u9ed1\u5ba2\u5df2\u7ecf\u5bf9\u4f60\u9488\u5bf9\u6027\u5730\u4f7f\u7528POST \/my-secret-login-123\u6765\u7206\u7834\uff0c\u90a3\u6211\u4eec\u8fd8\u6709\u4e00\u5206\u949f\u4e94\u6b21\u7684\u9650\u5236\u53ef\u4ee5\u5ef6\u7f13\u4ed6\u7684\u8fdb\u653b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u75c7\u72b61\u2014\u2014\/xmlrpc.php\u7206\u7834 \u5728wordpress\u7684\u65e5\u5fd7\u63d2\u4ef6\u91cc\u53d1\u73b0\u5927\u91cf\u767b\u9646\u5c1d\u8bd5\uff0c\u6765\u81ea\u5404\u79cdIP\uff0c\u67e5\u770bdo&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[3,20,1,32],"tags":[],"class_list":["post-1109","post","type-post","status-publish","format-standard","hentry","category-linux-tech","category-20","category-tech","category-32"],"_links":{"self":[{"href":"https:\/\/lalaland.wlzy.online\/index.php?rest_route=\/wp\/v2\/posts\/1109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lalaland.wlzy.online\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lalaland.wlzy.online\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lalaland.wlzy.online\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lalaland.wlzy.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1109"}],"version-history":[{"count":37,"href":"https:\/\/lalaland.wlzy.online\/index.php?rest_route=\/wp\/v2\/posts\/1109\/revisions"}],"predecessor-version":[{"id":1197,"href":"https:\/\/lalaland.wlzy.online\/index.php?rest_route=\/wp\/v2\/posts\/1109\/revisions\/1197"}],"wp:attachment":[{"href":"https:\/\/lalaland.wlzy.online\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lalaland.wlzy.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lalaland.wlzy.online\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}