Protect Your Blog From Hackers

Every day hackers sit out there an pray on good sites for no good reason. Some days they are even successful. In the past few months I’ve worked with a few blogs to detect and remove hidden code that was causing various unwanted issues. It happens to the best of blogs, and knowing how to find and remove it is just as important as trying to prevent it.

Blog #1 - The iFrame - The first indicator that something was wrong here was the time it took the blog to load. It seemed abnormally long. I popped open Safari’s activity window and noticed it was connecting out to an IP address that I didn’t recognize.

When the did finally load, it then asked me if I wanted to run a Java applet. Huge red flag there. It took some digging but I found a lot of files contained some iFrame code that was loading badware from an external site.

To fix, I deleted and re-uploaded all the files I could, and walked though each theme and plugin file to find any traces of code that should not be there. Once cleaned out, the site ran much smoother.

Blog #2 - Hidden Random Links - With this blog, Google actually caught the issue first. They put a lovely note on search results that said the site may be unsafe to visit. Even when someone did click on the search result, Google sent them to a warning page. So not cool, but understandable.

I immediately looked though the theme files and re-uploaded any admin files with no luck. Oddly enough, the issue presented itself only on a few posts, not all pages. This means that the issue was not part of the theme or any other main files. The badware was actually embedded in individual posts.

Using Google Webmaster Tools, they listed out a number of infected pages. I then viewed the sources of those pages and was able to see an empty link that went out to a known badware site.

To fix, I edited each post with WYSIWYG editing turned off. This allowed me to see the raw HTML and it was easy to see the infected posts. Within a day or two of cleaning up the code, Google cleared the warning message.

Blog 3 - Spam Links - If you’re not running the most recent version of Wordpress, you may become affected by old security issues. With blog #3, someone added a couple hundred invisible spam links to the footer of the site. We were lucky with this one as a visitor tipped us off early. The fix was simple, remove the links from the footer file and update to the latest version of Wordpress.

Hack Attack Tips

If you do find your blog has become infected, here are a few things you should always do.

1. Clean up any infected files as soon as possible. It’s your reputation and your visitors safety at stake.

2. Delete any blog and plugin files you can and re-upload new ones. Don’t get rid of your configuration or theme files though.

3. For those files that you can’t just delete (like config and theme files) open each one and check for issues.

4. Update your blog software and plugins to the most recent version. The newer the files the safer they probably are.

5. Change your passwords. Your blog user, your ftp and any others you can. You never know how hackers get in.

6. Backup everything. In the three cases above, no files or information was deleted by the hackers, but that doesn’t mean they will always be as nice.

Hackers are out there every day doing what they can to harm innocent sites. You can take steps to protect yourself by keeping your blog software and plugins up to date and creating good, strong passwords along with frequent backups.

Do you have any words of wisdom to share about keeping blogs safe?

Comments

About The Author



Posted in: Blogging, Technology |
Stumble Digg Technorati Subscribe Delicious
del.icio.us Digg Reddit Netscape StumbleUpon Technorati

If you enjoyed this post, then make sure you subscribe to my RSS Feed.
 

Related Posts

RSS feed | Trackback URI

4 Comments »

Comment by MB Web Design

July 8th, 2008 at 10:06 pm

This is good advice that newbie Wordpress users and experienced users alike should listen to

 
Comment by JPRuss

July 13th, 2008 at 5:03 am

Nice tips, but how is the code getting into the blog in the first place. Are people uploading it through security bugs in the comments section?

If they do not have admin access to the blog, how else can they upload malware stuff onto the blog?

Tks.

 
Comment by Robert Navarro Subscribed to comments via email

July 31st, 2008 at 12:47 pm

Thanks for the tips, very helpfull. One question tho, what version of WordPress are you using on this site? I went to your /wp-admin page and it’s way! difrent from mine. I’m using WP 2.6, considering that your talcing about hackers, upgrading and keeping your blog safe don’t you think you should upgrade if you havent already?

P.S.

How can i ad the Notify me of followup comments via e-mail checkbox to my blog?

 
Comment by Robert Navarro Subscribed to comments via email

July 31st, 2008 at 12:48 pm

Thanks for the tips, very helpfull. One question tho, what version of WordPress are you using on this site? I went to your /wp-admin page and it’s way! difrent from mine. I’m using WP 2.6, considering that your talking about hackers, upgrading and keeping your blog safe don’t you think you should upgrade if you havent already?

P.S.

How can i ad the Notify me of followup comments via e-mail checkbox to my blog?

 
Name (required)
E-mail (required - never shown publicly)
Website
Subscribe to comments via email
Your Comment (smaller size | larger size)