{"id":1241,"date":"2016-02-28T12:45:50","date_gmt":"2016-02-28T12:45:50","guid":{"rendered":"https:\/\/zogspat.tk\/blog\/?p=1241"},"modified":"2016-02-28T15:59:24","modified_gmt":"2016-02-28T15:59:24","slug":"im-sure-its-nothing-personal","status":"publish","type":"post","link":"https:\/\/the-plot.com\/blog\/?p=1241","title":{"rendered":"I&#8217;m sure it&#8217;s nothing personal&#8230;"},"content":{"rendered":"<p>Like probably the vast majority of people who are running WordPress for more than a few months, my site is frequently being hit with automated attacks. I&#8217;ve only recently noticed this in my logs so I thought it would be interesting to have a closer look.<\/p>\n<p>Around the turn of the year, for reasons I can&#8217;t recall, I happened to look at the raw access logs and noticed a lot of references to &#8216;xmlrpc.php&#8217;, which look like this:<\/p>\n<pre>142.4.4.190 - - [31\/Jan\/2016:18:13:42 +0000] \"POST \/blog\/xmlrpc.php HTTP\/1.0\" 200 58043 \"-\" \"-\"\r\n<\/pre>\n<p>This is a real log file entry, and is a classic example of an XMLRPC bruteforce amplification attack: someone has posted 58k at this page, to try and bruteforce the admin password. I disabled the mechanism &#8211; and just verified that it&#8217;s working this morning [two months later :)], as the 200 server response is a bit more polite than I would have expected.<\/p>\n<p>At the same time I installed [yet another] plugin, which rate limits failed admin password authentication attempts. It started triggering last week with repeated admin authentication failures from a machine\u00a0in Hanoi. In my latest access log file [31st January to about half an hour ago], I have 1500 POST attempts which look like this:<\/p>\n<pre>123.30.140.199 - - [26\/Feb\/2016:13:37:47 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 200 3766 \"-\" \"-\"\r\n<\/pre>\n<p>I&#8217;ve not paid much attention to log formats in a long time so I had to google what those final two hyphens are:\u00a0a blank referer [<a href=\"https:\/\/en.wikipedia.org\/wiki\/HTTP_referer\" target=\"_blank\">note<\/a> to my wife on the spelling :)] and <a href=\"https:\/\/en.wikipedia.org\/wiki\/User_agent\" target=\"_blank\">user agent<\/a> field respectively. The blank user agent is indicative of some sort of automated attack and, by virtue of the fact that the person who&#8217;s running it hasn&#8217;t even bothered to make it look like a real browser, one that isn&#8217;t particularly sophisticated.<\/p>\n<p>The logging pattern suggests what you&#8217;d expect: someone has harvested a set of servers that are running WordPress [how? by virtue of having the common pages that WordPress hosts. So a 200 in response to a GET for a ~\/wp-login.php page, for instance], and is stepping through them.<\/p>\n<p>This is another indicator of the lack of sophistication:<\/p>\n<pre>123.30.140.199 - - [26\/Feb\/2016:16:41:35 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 200 1643 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:41:37 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 200 1643 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:41:38 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 200 1643 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:41:44 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 200 1643 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:41:46 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 200 1643 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:41:58 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 200 1643 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:41:59 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 200 1643 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:42:05 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 200 1643 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:42:06 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 200 1643 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:42:13 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 200 1643 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:42:14 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 403 9 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:42:20 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 403 9 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:42:21 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 403 9 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:42:22 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 403 9 \"-\" \"-\"\r\n123.30.140.199 - - [26\/Feb\/2016:16:42:23 +0000] \"POST \/blog\/wp-login.php HTTP\/1.0\" 403 9 \"-\" \"-\"\r\n<\/pre>\n<p>What&#8217;s happening here is that some software I&#8217;m running is blocking the user&#8217;s IP address after 10 authentication failures, shown by the 403, which is the server returning a &#8216;Forbidden&#8217;. What I&#8217;ve deleted from the log extract above is \u00a0that there are a total of 25 Forbidden responses by the server in a row: the attack software isn&#8217;t checking the server response codes, which is a waste of resource on their part.<\/p>\n<p>I&#8217;ve had a bit of a trawl through my logs and am seeing similar, albeit less determined attacks like this, coming from all sorts of far flung\u00a0places:<\/p>\n<pre>62.109.19.98 - - [13\/Feb\/2016:07:46:48 +0000] \"POST \/blog\/xmlrpc.php HTTP\/1.0\" 200 58043 \"-\" \"-\"\r\n<\/pre>\n<p>That&#8217;s another XMLRPC bruteforce amplification attack, from Russia. A geolocation site reckons this one&#8230;<\/p>\n<pre>204.232.224.64 - - [12\/Feb\/2016:07:12:33 +0000] \"POST \/blog\/xmlrpc.php HTTP\/1.0\" 200 58043 \"-\" \"-\"\r\n<\/pre>\n<p>&#8230;is in San Antonio, Texas. Interesting that the byte sizes being posted through are identical: 58,043. Again, that&#8217;s indicative of the same off the shelf attack software running with a pre-canned payload. Let&#8217;s do one more of these:<\/p>\n<pre>1.83.251.239 - - [11\/Feb\/2016:02:19:14 +0000] \"POST \/blog\/xmlrpc.php HTTP\/1.1\" 200 45387 \"-\" \"Mozilla\/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident\/5.0)\"\r\n<\/pre>\n<p>I can honestly say that since I first started messing around on\u00a0the internet in 1992, I&#8217;ve never seen an IP address that starts with 1. The geolocation service dutifully informs me that the machine that sent this parcel of good intention is located in Xi&#8217;an in China. At least they&#8217;ve spiced things up a bit with a different sized payload.<\/p>\n<p>So here&#8217;s a thing: I have a couple of blog posts on this site about a holiday we had in Vietnam. I blogged about a holiday to China that included a trip to Xi&#8217;an. I&#8217;ve also got a posting about a work trip to Russia. So&#8230; Russia and China are massive, populous countries. But Xi&#8217;an, in China? That looks like a pattern to me. I wonder if the bundle of joy &#8211; malware, whatever it is &#8211; that would be deposited on my site if it were to be compromised is tailored or localised in some way or other, based on the occurrences of those locations.<\/p>\n<p>&nbsp;<\/p>\n<p>As per the title, and the obvious lack of finesse, I know that my server is just one on what&#8217;s probably a very long list of candidates that these automated attacks are hitting.\u00a0WordPress has had something of a chequered history from a security point of view: it&#8217;s a natural target. While I&#8217;ve done the easy stuff to shore it up &#8211; like blocking a blank user agent &#8211; the options are relatively limited. That&#8217;s fine, given the fairly low-rent nature of the stuff being thrown at it, but I&#8217;d really prefer not to be distributing malware to people. Migrating off WordPress looks like it would be a pain so if the ancillary approaches start to look like they&#8217;re too much trouble I&#8217;ll just delete the site.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Like probably the vast majority of people who are running WordPress for more than a few months, my site is frequently being hit with automated attacks. I&#8217;ve only recently noticed this in my logs so I thought it would be &hellip; <a href=\"https:\/\/the-plot.com\/blog\/?p=1241\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1241","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1241"}],"version-history":[{"count":4,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1241\/revisions"}],"predecessor-version":[{"id":1245,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1241\/revisions\/1245"}],"wp:attachment":[{"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/the-plot.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}