Website Security, 5 Tips to Secure Your Blog From Hackers
Last month several of my sites got hacked. I found a JavaScript on every file named index.html on WordPress installations as well as regular html sites. On WordPress it on index.php in the root, wp-content, and wp-admin. On HTML sites it was on every index.html going one sub-directory deep. All sites looked and worked fine and I wouldn’t have even noticed it except that there was an error in the injected HTML that broke one of the pages. When I looked I saw a JavaScript at the bottom of the file. No idea what it did or was planning to do.
This sparked a little paranoia which led to a bit of research on website security I should have done years ago. So here are a few things that I am now doing to protect my websites.
Last month several of my sites got hacked. I found a JavaScript on every file named index.html on WordPress installations as well as regular html websites. On my WordPress sites it was on index.php in the root, wp-content, and wp-admin. On my HTML sites it was on every index.html going one sub-directory deep. All sites looked and worked fine and I wouldn’t have even noticed it except that there was an error in the injected HTML that broke one of the pages. When I looked I saw a JavaScript at the bottom of the file. No idea what it did or was planning to do nor did I have any inclination to find out. I just deleted it immediately.
This sparked a little paranoia which led to a bit of research I should have done years ago. So here are a few things that I am now doing to protect my websites.
1a. Changing my username to anything but “admin.”
1b. Changing my passwords to long, meaningless strings of mixed character types. No dates or actual words, a good mix of lower and uppercase letters, numbers, and special characters. I try to make them at least 16 characters long.
2. For Wordpress installations I found a nice article on Matt Cutts site. His first piece of advice is to “lock down /wp-admin/” by blocking all IP addresses, except your own of course, with your .htaccess file. Keep in mind that some of us have dynamic IP addresses so if you find that all of a sudden you can’t log in, go to http://www.whatsmyip.org/ to find out what it is and update your .htaccess. Oh yeah, keep a copy of your .htaccess file locally.
3. In my case, since both WordPress and static HTML sites got hacked and they were all in the same shared hosting account I am pretty sure that it was a password discovery hack. I have since tried the Login Lockdown plugin. So far so good.
4. Delete the line of code in your WordPress template header.php that tells what version you have. It looks like this:
meta name=”generator” content=”WordPress ?php bloginfo(’version’); ?” / !-– leave this for stats please –
5. Always update your Wordpress installation and plugins as soon as possible. Many updates are created for the sole purpose of fixing exploitable holes in the core files. Being able to do this automatically within the admin as well as the blaring warning that shows up gives us no excuses for forgetting to do so.
Tags: html, website security, WordPress
