WordPress Hacking Attempt With Visualisation

Well Tuesday was a fun evening watching someone relentlessly try and hack into the blog. Thankfully, they didn’t get in. Seriously though – why? Go & waste your time somewhere else instead of trying to actively cause harm. Anyway, I thought it was worth covering what this looks like on a WordPress blog and how it could quite easily have turned into a distributed denial of service attack (DDoS) due to the way it was being done. And I guess the most important bit, how you can prevent this type of attack on your WordPress blog with the help of a simple plugin, which thankfully I had installed already. 


The Cool DDoS Hacking Attack Visualisation

While I’m sure all of the information in this post will be useful, by far the coolest bit is the fancy visualisation that I was able to create with some handy software. Feast your eyes on this;



The above video shows the attack trying different passwords/usernames on wp-login.php by attempting to force access by guessing the password. The video is just a small snapshot of the attack which was happening for almost 9 hours on and off, I guess someone had the afternoon off work then…


The Data

 Being a bit of a data geek, I couldn’t resist the opportunity to dig into this a little deeper. Below shows the number of requests per minute between the time the attacks started to when they finally gave up. 


(click for larger graphic)


While these figures aren’t enormous, when the blog isn’t on enterprise class hosting this can slow the website down and more than anything it is just a bit annoying. 


Why A DDoS?

Why is this attack different than someone just simply attempting to guess a password? Well, this person is clearly well equipped with a bag full of IP addresses. I’ll explain about how to prevent your WordPress blog being hacked via this method a little later, but what I can say that if it wasn’t for the plugin that was installed, this could have been a lot worse. 

Another beautiful graph showing the number of attacks per IP address (this is only a selection);


(click for larger graphic)


I’ve not posted the IP addresses fully as, unlike the people doing this, this isn’t right as they could be hacked computers where these requests were coming from. In total there was 268 IP addresses used during the attack, which is quite considerable! The average number of attacks per IP address was at 12.38, which was no doubt limited by the plugin that was installed to stop people attempting this type of hacking attempt. 


How to Prevent a DDoS Hacking Attack on Your WordPress Blog

Do you have a WordPress blog? Then I seriously suggest installing a plugin called “Limit Login Attempts”. What this plugin does is, well exactly as you an imagine, it limits the login attempts based on the users IP address. If someone guesses your login details incorrectly for 2, 4, 8, 12, whatever, number of times then the IP address will be blocked for a set period of time. This type of plugin can further block IP addresses longer term, all automatically, if the same IP address keeps coming back and trying again. 

Had this plugin not been installed, I can’t imagine how many requests all 268 IP addresses would have tried during this period. While this was an interesting experience and has produced a cracking visualisation, I hope it doesn’t happen again either to me or anyone else. 



How To Add Anchor Links In WordPress

WordPress is a great piece of software but at the same time it can be a real pain. It assumes that people who use it don’t know a thing about HTML which can be quite annoying since when trying to add anchor links to your blog posts then you will see that WordPress actively removes these! Anchor links are an extremely important and useful function when creating longer blog posts where it is necessary to jump around the post for easier usability.

By the end of this post you will be able create an anchor link within WordPress.  

Have a go yourself and you will see what I mean. Try adding the following code to one of your blog posts to see how WordPress treats anchor links.


<a href=”#section2″>Go to section 2</a>

some text here

some text here

some text here

<h2 id=”section2″>Section 2</h2>


When you click on either ‘publish’ or ‘preview’ you will notice that this does appear to work (as long as you haven’t already saved the post after entering that code), the code behaves correctly so that when you click on the “Go to section 2” link then you are thrown further down in the post to “Section 2”. Ok so should be working fine then, yes? No. 

When you re-save / re-publish (i.e. update the post) then WordPress actively messes up the section “<h2 id=”section2″>” so that it escapes the double quotes surrounding the id attribute name. Very frustrating because this then translates into the following code;

<a href=”#section2″>Go to section 2</a>

some text here

some text here

some text here

<h2 id=”\”section2\”“>Section 2</h2>


Notice the additional \” which has been added at either end of the id attribute. This means that the anchor link is no longer called ‘section2‘ but it is now called “section2” with the double quotes as part of the name. 

There must be some issue with how WordPress interprets certain information by assuming this is an error on the webmasters part and tries to automatically fix it, but instead it is actually breaking the valid HTML markup and messing everything up. 

There is some good news though…..

How to add anchor links in WordPress

The issue I mentioned above about how WordPress tries to ‘fix’ things is actually a setting within WordPress that can be switched off (thankfully). 

If you click on Settings > Writing as seen below;



By default WordPress automatically ticks the section which says “WordPress should correct invalidly nested XHTML automatically”. This is the setting which is overriding the code id=”section2″ to become id=”\”section2\””. Keep this box blank and save your settings so that WordPress will no longer correct invalid markup. 



The next step is to actually markup the previous anchor link in an invalid way. Unfortunately this is the only way around the problem so it may annoy anyone who loves clean code, but hey at least it achieves the same end result! 

Previously the actual anchor was…


<h2 id=”section2″>Section 2</h2>


Now to add the anchor you need to code this up as follows…


<h2 id=section2>Section 2</h2>


You will notice there is no double quotes surrounding the actual name of the id attribute. Now when you publish or save the blog post as many times as you like then WordPress will no longer overwrite your hard work :-) 

In addition, it has been spotted over on StackOverflow that certain plugins may be affecting anchor links. In particular, SEO Smart Links and if you uncheck the “prevent linking in heading tags (h1,h2,h3,h4,h5,h6)” in the settings of the SEO Smart Links plugin, the back slashes are removed. So if you have this installed then this may also solve the problem.


The Google Monopoly Needs To Be Broken Up

With all of the changes and announcements from Google recently it appears they are heading in a completely different direction than their core business, search. Since Google began, it has always been about providing the best results to the users via their SERPs. They tried to give the user the choice of 10 organic (give or take) results based on a complex algorithm of hundreds of signals. They even wanted webmasters to get involved by making content more ‘readable’ to Google, which I guess is why the SEO industry was born.

Recently though Google seem to be steering away from this and thinking ‘Google knows best’. They now seem to be heading towards providing users choices based not on their normal SERPs, but choices via their own Google products. This is a very worrying direction since once they create a product and effectively force users to use this by prominently positioning it in the SERPs then this flushes all competition down the drain.

Lets take a look at a few of the recent developments from Google.

Google Advisor

Google Advisor which is a financial comparison tool comparing mortgages, credit cards and savings accounts.

This seems like a direct attack on the financial services industry and more importantly the rise of the recent price comparison monster websites. Should Google really be providing the same service as price comparison websites here? I don’t believe so as this is no longer about providing the ‘right’ results to the user, it is about pricing the competitors out of the market. Since Google doesn’t (at the moment) take any commissions on these products being offered, this could push out the price comparison websites who do take a commission – especially if Google begin to prioritise their own products in the SERPs.


Google Flight Comparison

Google Flight Comparison in the SERPs is Google’s latest brainwave which shows flight comparison information to ‘make it easier for users to understand’.

Seems like a good idea at first, and I know first hand that flight websites are some of the most confusing when coming to make a purchase. But looking at this closer, you can see that all of the comparison websites are now further down the listings in favour of Google’s own products! When did it become Google’s job to make things like this easier? Surely this is the job of the actual flight comparison websites and the flight companies their self, since they do have enough incentive to do this….better usability equals more sales.


Google Local

Now we get on to Google Local which  includes the 7-pak results and the local listings mingled in within the SERPs. If we take a look at the listings shown for the search term “Manchester Hotels” then we can see that everything above the fold is either sponsored listings or Google’s own products.

But wait, Google recently said that we should be focusing on quality content, making our websites the top source of information within the industry. And quoting the guidelines from Google directly

“Does this article have an excessive amount of ads that distract from or interfere with the main content?”

Is Google ignoring its own guidelines again…..? This whole scenario is causing lost business for the smaller companies who cannot afford the sponsored listings and lets be fair, the Google Places listings are more of a bonus than a real listing.


Google Mobile Wallet

Next we are looking at the latest Google Mobile Wallet which is offering a Paypal style payment system which is via your mobile phone, the only difference being is that Google Mobile Wallet is free! Does this mean that people will slowly move away from Paypal or maybe even moving further away from traditional credit cards?

This would no doubt all link in nicely with the Google Advisor tool mentioned above within the next few years.


Google Offers

Google’s latest product is Google Offers which seems to be attacking Groupon and other offer websites. Quite fitting really since in the latest algorithm update by Google, Panda, was actually attacking websites like this!

This seems like the good old business plan behind Tesco in the UK. Build lots of large retail outlets and offer cut price goods which forces all of the smaller retailers out of business. Then once all of the smaller retailers are forced out of business because they cannot compete in the market, Tesco opens up some  Tesco Express stores to fill the new gap in the market and totally dominating the market place.



It is certainly interesting looking at all of these new developments from Google and how they may all link together. Google already dominate a massive market and it seems they are going after everyone else now too….

Watch this space…


Never Rely On External Information for Business

If ever there was a reason needed to not rely on external information for business, this is one – Google Deprecating APIs

Have these affected your business? This is going to affect an awful lot of people, and looking at some of the 158 comments already on the official blog post from Google, this is not going down well….

That said though, any serious business should never be relying on external companies / data / APIs for any critical systems. Now I can totally see the power of API’s and I absolutely love them, but for any core business needs it can be a little like putting all of your eggs in one basket.

Unfortunately for many large organisations this always seems to be the route taken, the easiest and quickest route which rarely has the long term benefits. My philosophy is always to do something right from the beginning as this saves countless hours in the long run.

As for the Google API’s, well there are still a lot more available to use for the foreseeable future. For the API’s being deprecated I can foresee a lot of further abuse of these prior to these being shut down, such as using the services and storing the information which in most cases in against the guidelines of the services.

Well for now, time to build something more robust in-house – Maybe a scraper which accomplishes the same task :-)