300,000 WordPress hacking attempts and 5 observations
simonfredsted.com
simonfredsted.com
Use the highly loved, 5 star rated, 5+ million downloaded "iThemes Security Plugin" for Wordpress (formerly Better Wordpress Security). https://wordpress.org/plugins/better-wp-security/
● Use the "Change Admin" feature to change your admin username to anything other than "admin".
● Hide your backend so that "yoursite.com/wp-admin" doesn't even lead to the login screen
● Use "Away Mode" so the backend is completely disabled during certain days or times of day. (10pm - 8am overnight)
● Enable "Brute Force" protection for logins, after 3 bad password attempts the host should be locked out.
● DO NOT enable "Blacklist Offenders" feature. If you do, this will add the IP address of offenders to your .htaccess file and eventually take your site offline when the list reaches thousands of IPs. It doesn't scale and you can quickly reach thousands of IPs in just a few days depending on the popularity of your blog.
● Use "Immediately ban host who tries to log in as Admin"
Personally this is what I've found to work for me and my blog. Some days I get 220 hacking attempts and other days it dies down.
Personally, since I basically use WordPress as a static HTML generator, I'm wondering if there is a solution out there that can just decouple the administration interface and put it on a while different domain, port, or server – I really like WordPress for managing my content.
Really? That's basically exactly what I would expect.
The costs of operating something like this would have to be passed on to the client making them less competitive. No way AWS would do this.
I would expect they would block the offender very quickly if notified though.
It's amazing that in nearly-2015, enough people still use passwords like '123456' and 'password' such that they're still at the top of the guessing list in hacking attempts. Some of us will never learn, I guess...
(Alternatively, you can just update the password hash for the existing user account.)
Like this article closes with though, non "admin" accounts and strong passwords foil all these lame automated attempts. (I suspect one day it'll get attacked by someone with a Wordpress zeroday, and I'll have to reprovision the vm from scratch - Yay Ansible! - come at me scriptkiddies!)
I looked up Wordfence. The way it preemptively blocks attacks from all domains that attack any Wordfence user's site is pretty clever.
Not exactly a famous site, but I thought a larger sample size might be interesting...
We [1] provides shared hosting for about 500 WordPress installations, of widely varying sizes. The sites are mostly static "blogs" for student groups or individual students, with about half on a single domain (www.ocf.berkeley.edu/~something) and others on different subdomains of berkeley.edu.
In the past week, the webserver handled 3,527,157 requests (about 814 MB of uncompressed access logs). 111,409 of those were WordPress login attempts [2].
I was going to compare the list of top IPs with the list in the article, but was surprised to find that there were no shared IPs between the lists. For context, we had 435 unique IPs, 9 with > 1000 requests, and 32 with > 100 requests.
The top ten requestors in the past week are from (cities from whois data):
56742 Kiev, Ukraine
19302 Novosibirsk, Russia
7645 Sofia, Bulgaria
7641 Moscow, Russia
7190 Kiev, Ukraine
6748 Kharkov, Ukraine
2160 Roubaix, France
1041 Kharkov, Ukraine
967 Kuala Lumpur, Malaysia
894 Putian, China
[1] https://www.ocf.berkeley.edu/[2] POST requests to wp-login.php. I don't have accurate numbers on how many failed, but to say that less than 250 were legitimate user logins is probably accurate.
The cause for this is the belief that Google gives more weight to content and backlinks from these TLDs.
*Edit: here: http://portal.aws.amazon.com/gp/aws/html-forms-controller/co...
location = /wp-login.php {
allow x.x.x.x/32;
allow y.y.y.y/32;
deny all;
} AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/etc/htpasswd/.htpasswd"
Require valid-user1. Disable PHP execution in the uploads directory (hmm, wonder if it'd work if I disabled it in the entire wp-content folder?).
2. Run PHP as a different user to the file owner.
Both of these are to minimise damage when an extension is exploited by a hacker (if it hasn't happened to you yet, it will do) and to reduce the damage done to the server/site.
It sets up a hidden Wordpress admin page on the following URL:
http://www.youramazingblog.co.uk/wp-admin/?key=value
So you need to enter a key/value of your choosing in the URL before you can access the admin page.
Works pretty well especially if paired up with a decent key/value.
Of course, you would have to accumulate the list across many computers and distribute it to WP servers... And be careful NOT to include misspelled passwords (invalid login followed by a valid login). :)
I am also not sure "top X passwords" list would be enough - you should probably check against the whole list, which could be huge.
At my job (small web host), many of the WordPress brute force attacks we see across our shared hosting fleet use the '?author=\d+' trick in WordPress to find the usernames of admin-like users before starting the actual attack.
Totally idiotic of WordPress to reveal usernames this way.
We have moderate success in slowing/blocking these attacks using a WAF such as mod_security (after a certain number of HTTP 200 responses on wp-login, aka login failed, block the IP).
On the bright side, our load averages went down a non-trivial amount once we introduced these rules (a few customers would get effectively and inadvertently DoS'd by these brute forces LOL)
e.g. http://en.blog.wordpress.com/?author=1 http://en.blog.wordpress.com/?author=2
Pointless information disclosure
I'm not sure about WordPress revealing whether it's the username or password that's incorrect though. It's a compromise between security and UX that should be left to the admin (of course, there are plugins to remedy this).
Regular users never see the example/ directory.