Bio
Contact: lizhenry@gmail.com   I'm a writer, literary translator, and long-time computer geek. I'll be writing here to give BlogHer readers...
 
 
 
 

What’s Hot on BlogHer.com

Recent Comments

How to detect and fix the latest WordPress attack

  • Share This Post
  • submit
  • 13
  • Sparkle (
    )
     

If you aren't using the latest version of WordPress, currently 2.8.4, your blog might have been hacked. There's an attack going on right now that breaks into your blog to create, and then hide, administrator accounts.

You can see if this has happened on your blog by going to the Dashboard and then the Users panel. The number listed in parentheses after Administrators should match the number of actual admins that you have for the blog!

WP users panel

If that number is higher than the amount of admins for the blog, you probably have hidden users. You could try turning Javascript off in your browser to see those hidden users.

Then, delete them (if you can) from the panel. I didn't try this myself, but I think it will work.

Or, you can use mysql or phpmyadmin to delete those users from your database. If you don't remember how to connect to your database, look at the files in your wordpress folder and read the contents of wp-config.php. That will have the username and password and database host name. You might also need to look at the help or FAQ files for your web host.

In phpMyAdmin, you can find and delete the hidden users by connecting to your database, then browsing the users table. Check the boxes by the wp_users and the email fields (or just check all of them) and then click Browse again. This should show you a list of all the users on your blog.

This is what a row of user data should look like in phpMyAdmin:

wp_users-sql-good

This is what a "hidden user" account will look like. It'll be a name that doesn't show up in your WordPress Dashboard, and it won't have an email address in that 5th field. Might be a good idea to delete these users right away.

wp_users-sql-bad

I followed Lorelle's instructions for how to recover from my WordPress blog being hacked. That worked fine:

* I did an xml export from the Dashboard and made sure I knew what that file was named and where I saved it.
* I did an sql dump of the whole blog (from the mysql command line, but you could do one from phpMyAdmin too) Just to make sure I would have everything, and so that I could do some forensics later on the contaminated db.
* Then I deleted that db, made a new db, and saved the information on how to log into it. You could also drop all the tables in the old one, I guess, and keep using it. While you could leave the old db there, it seems unwise.
* I deleted all the stuff in my wordpress folder on my server. If I'd thought, I would have saved a few custom banners and images first.
* I downloaded WordPress latest version, 2.8.4 and unzipped it, along with some themes and plugins.
* I then went to the url for my blog and told the install screen a blog name and my email address, and got a new admin password. Voila, new empty blog.
* Then, from the WordPress Dashboard, went to Manage and then Import. I imported the xml file as a WordPress import, with its attachments. This brought me all my pages, posts, comments, and so on.

A little tweaking and my blog was as good as new.

Total Crisis Panic Street Sign (While Danger is "Eminent" sometimes, like Godzilla, I don't think that's what the signmaker meant!)

I think for your average user, who finds upgrading and installing a bit scary, this will seem even more scary. But it's not bad at all. It just requires you to follow the steps, write down or cut and paste all the information you will need to keep track of:

- one set of info for your web host account
- one set for your sql database account and phpmyadmin
- the information for your blog itself, for the WordPress install
- where you're saving the export file with your blog posts and comments!

In a pinch, if you really mess up in this process, you can get a backup and restore from your web host.

Now, even though I went through this process, I think that someone might potentially write a plugin or script to reveal and delete those hidden users. It might not

  • 13
  • Sparkle (
    )
     

Comments

Post comment as twitter logo facebook logo
Sort: Newest | Oldest
mashadutoit 5 pts

Basically, you can leave Wordpress.com in the drivers' seat, a bit like
getting on a bus and holding up your blog out the bus window;

that made me smile.  It is a bit like that.  I have one of each - .com, and .org.

.org is a bit more nerve wracking as you have to look after things yourself. But actually, its not such a big deal. 

Liz Rizzo 5 pts

So this applies to people that have downloaded and are self hosting the blog software.

That makes much more sense - Thank you!

Liz Rizzo ( http://blogher.org/blog/liz-rizzo )

I blog at Everyday Goddess ( http://everydaygoddess.typepad.com/ ).

emilymendell 5 pts

Ok - I know that I have been hit as I saw an unfamiliar author yesterday but couldnt delete it in my settings.  I am trying to follow what you suggest above to delete the users by connecting to the data base but I dont even know where to go to find phpMyAdmin?  Embarassing to say the least but I need to start somewhere.  Where do I find that?

Vered 5 pts

Her name is Kim Woodbridge, she's a friend of mine, and she's a wonderful Wordpress consultant ( http://www.kimwoodbridge.com/ )who does paid work at very reasonable prices. I paid her to upgrade my own blog when it needed a major upgrade a while ago from 2.3 to 2.6

She is also very helpful if you just have a question about Wordpress.

I like the calm way she handles Wordpress issues, very different than the panicky mode I tend to enter whenever something goes wrong.

----

Need to hire a blogger ( http://momgrind.com/hire-me/ )? I’m a mommy blogger and a blogger for hire ( http://momgrind.com/ ).

Liz Henry 5 pts

The idea is that the WordPress software is running on a server account you control directly. You can use wordpress.com, which is hosted on that site and they keep it upgraded. But! If you want much more control over your blog and its software, you can download it from lizzard@bookmaniac.net

Liz Rizzo 5 pts

To think of even "upgrading a version" on a blog. I primarily use Typepad, although I have a small blog in WordPress. I don't really understand how you would have to upgrade a web application - Shouldn't that happen behind the scenes?

Oy, I don't really even get it enough to word my comment right here!

I did check my admins, and I guess I'm OK for now...

Liz Rizzo ( http://blogher.org/blog/liz-rizzo )

I blog at Everyday Goddess ( http://everydaygoddess.typepad.com/ ).

mashadutoit 5 pts

wow this is very useful info. Thanks!

Liz Henry 5 pts

Viviane that's fantastic advice, thank you! I also like lizzard@bookmaniac.net

Liz Henry 5 pts

I definitely feel for you!  It's a million times easier to upgrade than to re-install a hacked blog. So, get someone to hold your hand and go through it with you - that can be super helpful and steadying! I also advise printing out the instructions and reading them all first before doing anything. It helps to have an idea of what's coming next. And checking stuff off a list is helpful too.

-----------------

Liz Henry ( http://www.blogher.com/haystackprofile/viewprofile... )

Composite: Tech & Poetics ( http://liz-henry.blogspot.com/ )

lizzard@bookmaniac.net

Liz Henry 5 pts

Hi Mashadutoit! You can do it one of several ways. PRobably the easiest is by viewing your blog in the browser, then view source and look for a line like this, that identifies the version number: 

" meta name="generator" content="WordPress 2.8.4" / "

Also, you can look at the Dashboard and in recent versions it does list the version in the "right now, at a glance" section, center middle of the page, like this,

"You are using WordPress 2.7.1"

-----------------

Liz Henry ( http://www.blogher.com/haystackprofile/viewprofile... )

Composite: Tech & Poetics ( http://liz-henry.blogspot.com/ )

lizzard@bookmaniac.net

Viviane212 5 pts

The other issue is the Admin account. I had a friend's blog hacked when someone logged in as an admin user. We think her password was obtained over an insecure wireless network. We were able to get to it in time.

I created a second user account with Admin privileges, logged out, and logged into the new Admin account and deleted the account named Admin.

I used to list the plugins I used, but no longer. I think it's better to share it with a group via Google Docs.

In addition, once you've updated to the latest version, I suggest  installing these plugins:

Secure Wordpress - Remove Error information on login page; adds index.html to plugin directory; removes the wp-version, except in admin area.

Login Lockout-Limit Login Attempts blocks an Internet address from making further
attempts after a specified limit on retries is reached, making a
brute-force attack difficult or impossible.

One Click Plugin Updater - I used this to update the core install after an attempt to edit the WP-config file to add the security keys didn't work (and I ended up with a blank white page).

Viviane
www.thesexcarnival.com

cardiogirl 5 pts

Man that chart was made for me. My chest is actually tight right now. I absolutely hate upgrading WP. Gah.

So far I have only one administrator as I should. But now I know I have to do this and I don't want to so I'll probably stay in a holding pattern in Don't Think Stay Fearful and Alert. But when I do upgrade it I will reference this post.

Thanks for the detailed instructions. (Crosses fingers that she doesn't have to upgrade and skitters away.)

Cardiogirl 19% body fat 100% fun

http://www.cardiogirl.net ( http://www.cardiogirl.net )

mashadutoit 5 pts

Quick check but all is ok.  Phew!

This goes to show that it's a good idea to keep a worklog of all the
things you've done to a blog, or a wiki or any sort of installation, so
that you can recreate it from scratch!

That sounds like a good idea.

By the way, how do I quickly check what version of WordPress I am using?