{"id":5082,"date":"2016-05-02T11:21:01","date_gmt":"2016-05-02T03:21:01","guid":{"rendered":"http:\/\/www.orczhou.com\/?p=5082"},"modified":"2016-05-02T11:21:01","modified_gmt":"2016-05-02T03:21:01","slug":"write-sth-about-and-in-blog","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2016\/05\/write-sth-about-and-in-blog\/","title":{"rendered":"\u9504\u8349\u8bb0&#8211;WordPress\u535a\u5ba2\u7684xmlrpc\u6f0f\u6d1e"},"content":{"rendered":"<p>\u535a\u5ba2\u8001\u65e9\u5c31\u957f\u6ee1\u4e86\u8349\uff0c\u6700\u8fd1\u5728\u9504\u8349\u3002<\/p>\n\n<h3>\u53d1\u73b0\u95ee\u9898<\/h3>\n<p>\u6700\u8fd1\u603b\u6709\u4eba\u544a\u8bc9\u6211\uff0c\u8bf4\u535a\u5ba2\u4e0d\u80fd\u8bbf\u95ee\u4e86\u3002\u5f00\u59cb\u53ea\u662f\u76f4\u63a5\u53bb\u91cd\u542f\u4e00\u4e0bhttpd\uff0c\u6062\u590d\u4e86\u5c31\u4e0d\u7ba1\u4e86\u3002\u4e0d\u8fc7\u6700\u8fd1\u6709\u70b9\u9891\u7e41\u51fa\u73b0\u4e0d\u80fd\u8bbf\u95ee\u7684\u60c5\u51b5\uff0c\u751a\u81f3Google\u7ed9\u6211\u53d1\u90ae\u4ef6\u8bf4&#8221;Increase in \u201c404\u201d pages on http:\/\/orczhou.com\/&#8221;\uff1a<\/p>\n<p><a href=\"http:\/\/www.orczhou.com\/wp-content\/uploads\/2016\/04\/Snip20160427_25.png\" rel=\"attachment wp-att-5100\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.orczhou.com\/wp-content\/uploads\/2016\/04\/Snip20160427_25.png\" alt=\"Snip20160427_25\" width=\"568\" height=\"207\" class=\"alignleft size-full wp-image-5100\" srcset=\"https:\/\/www.orczhou.com\/wp-content\/uploads\/2016\/04\/Snip20160427_25.png 568w, https:\/\/www.orczhou.com\/wp-content\/uploads\/2016\/04\/Snip20160427_25-300x109.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/a><\/p>\n<p>\u4e8e\u662f\uff0c\u6253\u7b97\u63a2\u7a76\u4e00\u4e0b\u539f\u56e0\u3002<!--more--><\/p>\n<h3>\u521d\u6b65\u63a2\u7d22<\/h3>\n<p>\u9996\u5148\uff0c\u5148\u770b\u4e86\u4e00\u4e0bMySQL\u4e2d\u6709\u6ca1\u6709\u6162\u67e5\u8be2\uff0c\u7b80\u5355\u7684\u901a\u8fc7show processlist\u786e\u8ba4\u4e86\u5728\u51fa\u73b0\u95ee\u9898\u7684\u65f6\u5019\u662f\u6ca1\u6709\u4ec0\u4e48\u6162SQL\u3002<\/p>\n<p>\u63a5\u7740\u53bb\u770b\uff0chttpd\u7684\u9519\u8bef\u65e5\u5fd7\uff0c\u9519\u8bef\u65e5\u5fd7\u5565\u90fd\u6ca1\u6709\u3002<\/p>\n<p>\u60f3\u60f3\uff0c\u518d\u770b\u770baccess log\u5427\uff0c\u770b\u770b\u6709\u6ca1\u6709\u4ec0\u4e48\u6536\u83b7\u3002\u679c\u7136\uff0c\u8fd9\u91cc\u53d1\u73b0\u4e86\u4e00\u4e9b\u5f02\u5e38\u7684\u65e5\u5fd7\uff1a<\/p>\n<pre><blockquote>.......\r\n31.184.195.26 - - [17\/Apr\/2016:03:17:28 +0000] \"POST \/xmlrpc.php HTTP\/1.0\" 200 435\r\n185.106.92.160 - - [17\/Apr\/2016:03:17:32 +0000] \"POST \/xmlrpc.php HTTP\/1.0\" 200 435\r\n31.184.195.26 - - [17\/Apr\/2016:03:17:43 +0000] \"POST \/xmlrpc.php HTTP\/1.0\" 200 435\r\n185.106.92.160 - - [17\/Apr\/2016:03:17:49 +0000] \"POST \/xmlrpc.php HTTP\/1.0\" 200 435\r\n.......<\/blockquote><\/pre>\n<p>\u91cf\u5316\u4e00\u4e0b\uff0c\u770b\u770b\u6709\u591a\u5c11\u5230xmlrpc.php\u7684\u8bbf\u95ee\uff0c\u7528\u4e86\u5982\u4e0b\u4e24\u4e2a\u547d\u4ee4\uff1a<\/p>\n<pre><div class=\"mycode\">grep \"xmlrpc.php\" orczhou.com-access_log|awk '{print $1}' orczhou.com-access_log|\\\r\n    sort|uniq -c|sort -k 1 -n|tail -n 20\r\n......\r\nawk '{print $1}' orczhou.com-access_log|sort|uniq -c|sort -k 1 -n|tail -n 20|\\\r\n    awk '{print $2}'|xargs -n 1 -I {} grep -m 1 {} orczhou.com-access_log\r\n......\r\n<\/div><\/pre>\n<p>\u8f93\u51fa\u5982\u4e0b\uff1a<\/p>\n<pre><div class=\"mycode\">[root@orczhou logs]# grep \"xmlrpc.php\" orczhou.com-access_log|awk '{print $1}' orczhou.com-access_log|sort|uniq -c|sort -k 1 -n|tail -n 20\r\n   .......\r\n   4772 199.15.233.162\r\n   5050 185.106.92.160\r\n   6002 185.106.92.55\r\n   8698 49.65.243.27\r\n   9988 31.184.195.26\r\n  11278 ::1\r\n  11368 185.103.252.172\r\n  17312 89.248.167.131\r\n[root@orczhou logs]# awk '{print $1}' orczhou.com-access_log|sort|uniq -c|sort -k 1 -n|tail -n 20|awk '{print $2}'|xargs -n 1 -I {} grep -m 1 {} orczhou.com-access_log\r\n......\r\n199.15.233.162 - - [10\/Apr\/2016:05:16:19 +0000] \"GET \/index.php\/2011\/09\/thanks-percona-response-time-distribution\/comment-page-1\/ HTTP\/1.0\" 200 35571\r\n185.106.92.160 - - [10\/Apr\/2016:03:19:42 +0000] \"POST \/xmlrpc.php HTTP\/1.0\" 200 370\r\n185.106.92.55 - - [12\/Apr\/2016:23:38:17 +0000] \"POST \/xmlrpc.php HTTP\/1.0\" 200 370\r\n49.65.243.27 - - [10\/Apr\/2016:03:19:02 +0000] \"GET \/index.php\/2012\/11\/more-about-mysql-item\/comment-page-1\/ HTTP\/1.1\" 200 41404\r\n31.184.195.26 - - [10\/Apr\/2016:03:19:10 +0000] \"POST \/xmlrpc.php HTTP\/1.0\" 200 370\r\n::1 - - [10\/Apr\/2016:03:19:04 +0000] \"OPTIONS * HTTP\/1.0\" 200 -\r\n185.103.252.172 - - [12\/Apr\/2016:16:33:40 +0000] \"POST \/xmlrpc.php HTTP\/1.0\" 200 370\r\n89.248.167.131 - - [12\/Apr\/2016:19:06:23 +0000] \"GET \/xmlrpc.php HTTP\/1.1\" 405 42<\/div><\/pre>\n<p>\u53ef\u4ee5\u770b\u5230\u6709\u5927\u91cfPOST\u548cGET\u5230xmlprc\u7684\u8bf7\u6c42\u3002<\/p>\n<p>\u5230\u8fd9\u91cc\uff0c\u5927\u6982\u77e5\u9053\u95ee\u9898\u51fa\u5728\u4e86xmlrpc.php\uff0c\u4f46\u662f\u5177\u4f53\u662f\u4ec0\u4e48\u60c5\u51b5\u8fd8\u4e0d\u77e5\u9053\u3002\u4e8e\u662f\uff0c\u8fdb\u4e00\u6b65\u6df1\u5165\uff0c\u770b\u770b\u5230\u5e95\u7ed9xmlrpc\u53d1\u9001\u4e86\u4ec0\u4e48\u8bf7\u6c42\u3002<\/p>\n<h3>\u6df1\u5165\u8c03\u67e5<\/h3>\n<p>\u4e3a\u4e86\u770b\u5230POST\u8868\u5355\u7684\u5185\u5bb9\uff0c\u9700\u8981\u5f00\u542fmod_dumpio\u6a21\u5757\uff0c\u8be5\u6a21\u5757\u914d\u7f6e\u53c2\u8003\uff1a<a href=\"http:\/\/httpd.apache.org\/docs\/2.2\/mod\/mod_dumpio.html\" target=\"_blank\">Apache Module mod_dumpio<\/a>\u3002\u6211\u5728httpd.conf\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u65b0\u589e\u4e86\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre><div class=\"mycode\">......\r\nLoadModule dumpio_module modules\/mod_dumpio.so\r\n......\r\n&lt;VirtualHost *:80&gt;\r\n    .......\r\n    DumpIOInput On\r\n    DumpIOOutput On\r\n    LogLevel debug\r\n    DumpIOLogLevel debug\r\n    .......\r\n&lt;\/VirtualHost&gt;<\/div><\/pre>\n<p>\u91cd\u542fhttpd\uff0c\u4e8e\u662f\u5728\u9519\u8bef\u65e5\u5fd7\u4e2d\u5c31\u53ef\u4ee5\u67e5\u770b\u5230POST\u7684\u5185\u5bb9\u4e86\uff1a<\/p>\n<pre><div class=\"mycode\">[Wed Apr 13 08:48:05 2016] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in (data-HEAP): &lt;?xmlversion=\"1.0\"?&gt;&lt;meth\r\n  &lt;methodName&gt;pingback.ping&lt;\/methodName&gt;\r\n    &lt;params&gt;\r\n      &lt;param&gt;&lt;value&gt;&lt;string&gt;http:\/\/crystalweb.co.za&lt;\/string&gt;&lt;\/value&gt;&lt;\/param&gt;\r\n      &lt;param&gt; &lt;value&gt;&lt;string&gt;http:\/\/www.orczhou.com\/index.php\/2015\/03\/glance-amazon-rds-pricing\/&lt;\/stri\r\n    &lt;\/params&gt;\r\n  &lt;\/methodCall&gt;<\/div><\/pre>\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u8fd9\u91cc\u5ba2\u6237\u7aef\u53d1\u9001\u4e86\u4e00\u4e2apingback\u8bf7\u6c42\u3002\u6e90\u5730\u5740\u662fhttp:\/\/crystalweb.co.za\uff0c\u76ee\u6807\u5730\u5740\u662f\u6211\u7684\u4e00\u7bc7\u535a\u5ba2\u5185\u5bb9\u3002<\/p>\n<h3>\u786e\u8ba4\u95ee\u9898<\/h3>\n<p>\u4e3a\u4ec0\u4e48\u4f1a\u6709\u5927\u91cf\u8fd9\u6837\u7684\u8bf7\u6c42\uff1f\u8ffd\u8e2a\u5230\u8fd9\u91cc\uff0c\u95ee\u9898\u5c31\u6bd4\u8f83\u660e\u4e86\u4e86\u3002\u5728Google\u4e0a\u4e00\u641c\u7d22\uff0c&#8221;wordpress xmlrpc pingback&#8221;\uff0c\u7b2c\u4e00\u4e2a\u7ed3\u679c\uff1a<a href=\"https:\/\/www.trustwave.com\/Resources\/SpiderLabs-Blog\/WordPress-XML-RPC-PingBack-Vulnerability-Analysis\/\" target=\"_blank\">WordPress XML-RPC PingBack Vulnerability Analysis<\/a>\u8f83\u4e3a\u7ec6\u81f4\u4e86\u63cf\u8ff0\u8fd9\u79cd\u5229\u7528Wordpress\u8fdb\u884cDDos\u653b\u51fb\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u8fd9\u91cc\u5bf9\u8fd9\u6837\u95ee\u9898\u5927\u81f4\u63cf\u8ff0\u5982\u4e0b\uff1a\u653b\u51fb\u8005\u5229\u7528WordPress\u7684XML-RPC PingBack\u529f\u80fd\uff0c\u5411\u4e00\u4e2a\u7b2c\u4e09\u65b9\u535a\u5ba2X(\u53ef\u4ee5\u662f\u4efb\u4f55\u4e00\u4e2aWordpress\u535a\u5ba2)\u53d1\u9001\u4e00\u4e2aPingBack\uff0c\u544a\u8bc9\u535a\u5ba2X\u8bf4\uff1a&#8221;\u5582\uff0c\u535a\u5ba2X\uff0c\u7f51\u9875Y\u5f15\u7528\u4e86\u4f60\u8fd9\u7bc7\u6587\u7ae0&#8221;\u3002\u8fd9\u65f6\uff0c\u535a\u5ba2X\u4f1a\u5c1d\u8bd5\u53bb\u68c0\u67e5\u7f51\u9875Y\u7684\u5185\u5bb9\uff0c\u770b\u770b\u662f\u4e0d\u662f\u771f\u7684\u5f15\u7528\u4e86\u8fd9\u7bc7\u6587\u7ae0\u3002\u5982\u679c\u771f\u7684\u5f15\u7528\u4e86\uff0c\u90a3\u4e48\uff0cWordpress\u4f1a\u5728\u8fd9\u7bc7\u535a\u5ba2\u7684\u7559\u8a00\u5904\uff0c\u7ed9\u51fa\u8fd9\u4e2a\u94fe\u63a5\u5f15\u7528\u3002\u5982\u679c\u6ca1\u6709\u5f15\u7528\uff0c\u5219\u8fd4\u56de\u4e00\u4e2a\u9519\u8bef\u3002\u5982\u679c\u653b\u51fb\u8005\u901a\u8fc7\u5411\u5927\u91cf\u535a\u5ba2\u53d1\u9001\u7c7b\u4f3c\u7684\u8bf7\u6c42\uff0c\u5c31\u53ef\u4ee5\u6784\u6210\u4e00\u4e2a\u5bf9\u7f51\u9875Y\u7684\u653b\u51fb\u3002<\/p>\n<p>\u6839\u636e<a href=\"http:\/\/www.computerweekly.com\/news\/2240215998\/More-the-162000-WordPress-sites-used-in-DDoS-attack\" target=\"_blank\">\u8fd9\u7bc7\u6587\u7ae0\u7684\u6570\u636e<\/a>\uff0c\u57282014\u5e74\u5c31\u5df2\u7ecf\u670916\u4e07\u535a\u5ba2\u88ab\u653b\u51fb\u8005\u5229\u7528\u8fdb\u884cDDos\u653b\u51fb\u3002<\/p>\n<h4>\u5173\u4e8eWordpress\u7684Pingback\u529f\u80fd<\/h4>\n<p>\u8fd9\u91cc\u4e0d\u6253\u7b97\u8be6\u7ec6\u4ecb\u7ecdPingback\u529f\u80fd\uff0c\u5982\u679c\u611f\u5174\u8da3\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u94fe\u63a5\u53bb\u4e86\u89e3\uff1a<\/p>\n<ul>\n<li><a href=\"http:\/\/www.yuhua.org\/ping-pingback-trackback-in-wordpress\/#Pingback\" target=\"_blank\">WordPress\u4e2d\u7684Ping\u3001Trackback\u4e0ePingback\uff1a\u6982\u5ff5\u3001\u533a\u522b\u4e0e\u8fd0\u7528<\/a><\/li>\n<li><a href=\"https:\/\/en.support.wordpress.com\/comments\/pingbacks\/\" target=\"_blank\">WordPress Comments Pingbacks<\/a><\/li>\n<li><a href=\"http:\/\/www.hixie.ch\/specs\/pingback\/pingback\" target=\"_blank\">Pingback Specification<\/a><\/li>\n<\/ul>\n<h3>\u5982\u4f55\u89e3\u51b3\u95ee\u9898<\/h3>\n<p>\u65e9\u671f\u7684\u7f51\u7ad9\u90fd\u662f\u5efa\u8bae\u76f4\u63a5\u4fee\u6539Wordpress\u7684\u4ee3\u7801\uff0c\u5c4f\u853dPingback\u529f\u80fd\uff0c\u8fd9\u5f53\u7136\u4e0d\u662f\u597d\u529e\u6cd5\u3002<strong>\u73b0\u5728\u5df2\u7ecf\u6709\u597d\u51e0\u4e2a\u63d2\u4ef6\u53ef\u4ee5\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u8fd9\u91cc\u63a8\u8350\uff1a<a href=\"https:\/\/cn.wordpress.org\/plugins\/disable-xml-rpc-pingback\/\" target=\"_blank\">Disable XML-RPC Pingback<\/a><\/strong><\/p>\n<p>\u53e6\u5916\uff0c\u5982\u679c\u5bf9\u5e94IP\u8fd8\u603b\u662f\u7ed9\u4f60\u53d1\u5230xmlrpc\u7684\u8bdd\uff0c\u4e34\u65f6\u8fd8\u53ef\u4ee5\u76f4\u63a5\u628a\u5bf9\u5e94\u7684IP\u901a\u8fc7\u9632\u706b\u5899\u8fc7\u6ee4\u6389\uff1a<\/p>\n<pre><div class=\"mycode\">iptables -A INPUT -s 185.130.5.243 -j DROP<\/div><\/pre>\n<h3>\u6700\u540e<\/h3>\n<p>\u679c\u7136\u95ee\u9898\u89e3\u51b3\uff0c\u7f51\u7ad9\u6ca1\u6709\u518d\u65e0\u6cd5\u8bbf\u95ee\u8fc7\uff0cGoogle\u4e5f\u6ca1\u6709\u518d\u7ed9\u6211\u53d1404\u7684\u95ee\u9898\u4e86\uff0c\u867d\u7136\uff0c\u6211\u89c9\u5f97404\u672a\u5fc5\u662f\u8fd9\u4e2a\u95ee\u9898\u5bfc\u81f4\u7684\u3002<\/p>\n<p>Have Fun\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u535a\u5ba2\u8001\u65e9\u5c31\u957f\u6ee1\u4e86\u8349\uff0c\u6700\u8fd1\u5728\u9504\u8349\u3002 \u53d1\u73b0\u95ee\u9898 \u6700\u8fd1\u603b\u6709\u4eba\u544a\u8bc9\u6211\uff0c\u8bf4\u535a\u5ba2\u4e0d\u80fd\u8bbf\u95ee\u4e86\u3002\u5f00\u59cb\u53ea\u662f\u76f4\u63a5\u53bb\u91cd\u542f\u4e00\u4e0bhttpd\uff0c\u6062\u590d\u4e86\u5c31\u4e0d\u7ba1\u4e86\u3002\u4e0d\u8fc7\u6700\u8fd1\u6709\u70b9\u9891\u7e41\u51fa\u73b0\u4e0d\u80fd\u8bbf\u95ee\u7684\u60c5\u51b5\uff0c\u751a\u81f3Google\u7ed9\u6211\u53d1\u90ae\u4ef6\u8bf4&#8221;Increase in \u201c404\u201d pages on http:\/\/orczhou.com\/&#8221;\uff1a \u4e8e\u662f\uff0c\u6253\u7b97\u63a2\u7a76\u4e00\u4e0b\u539f\u56e0\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[4],"tags":[],"class_list":["post-5082","post","type-post","status-publish","format-standard","hentry","category-code-detail"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/5082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=5082"}],"version-history":[{"count":28,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/5082\/revisions"}],"predecessor-version":[{"id":5112,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/5082\/revisions\/5112"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=5082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=5082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=5082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}