Patching the WordPress AnyResults.Net Hack
Published on - June 8th, 2008 (Modified on - June 13th, 2008) (by J.D. Roth) This post has nothing to do with personal finance, yet it’s be important to many readers. Please ignore it if it doesn’t apply to you.
It’s 2:30 a.m. I just spent the last eight hours tracking down an insidious hack that had affected all of my WordPress blogs except for Get Rich Slowly. This hack redirected search traffic from Google (and other sources) away from my blogs to AnyResults.Net and similar sites. Direct links were not affected.
To tell if your blog has been hacked, clear you browser’s cookies. Go to Google and search for your blog. Follow a link. If you wind up at your site, you’re probably safe. If you wind up someplace else, you’ve been hacked. You are:
- Losing traffic.
- Losing revenue.
- Possibly in danger of being delisted by Google.
Several of my sites were already running the latest version of WordPress (2.5.1) when they were hacked, but it may be that the vulnerability was introduced earlier. In each case, a file was planted on May 7th of this year.
I’m very tired and don’t have time to go into great detail, but I feel like I should get what I know out there for others to share and build upon. If you believe you’ve been affected by this problem, follow these steps.
- Back up your WordPress database.
- Download the latest version of WordPress.
- Check your header.php and your index.php for suspicious code. If you have something inlcuding a line like “if($ser==”1″ && sizeof($_COOKIE)==0){ header(“Location:”, delete the code. (It’ll be several lines.)
- Edit your WordPress database. If you don’t know how to do this, you’ll need to get help. (But not from me — sorry.) Specifically, you must:
- In the wp_options table, find the active_plugins row and examine it (which may mean entering edit mode). You’ll see a list of your plugins, but one of the files won’t be right. It’ll be named something like “XXX_old.jpeg” where XXX is something arbitrary. Don’t edit anything here, but note the path to that file.
- Using FTP, navigate to the path you just found. Delete the file.
- From your WordPress admin panel, activate a plugin (any plugin). (You may have to deactivate and then reactivate a plugin.) This will clear the gunk from your active_plugins row.
- While still in the wp_options table, find a row containing this string: “rss_f541b3abd05e7962fcab37737f40fad8″. Delete that row. (You will see several other similar strings. Do not delete them.)
- Now edit the wp_users table. You’ll find a nameless user created at 00:00:00 on 0000-00-00. Note the userid, then delete the user.
- Finally, edit your wp_usermeta table. You’ll find three rows associated with the userid of the invader you just deleted. Delete these three rows.
- Again via FTP, create an empty “index.html” file in your plugins directory. (This makes it more difficult for hackers to determine which plugins you’re running.)
- If you are not currently running WordPress 2.5.1, upgrade to this latest version (which you downloaded in step two). If you are already running WordPress 2.5.1, then use the fresh download to replace the file called “wp-blog-header.php”.
- Change your password.
I’m not convinced that this will take care of everything. There may be other crap inserted into the database or scattered in various directories. But this will deal with the immediate problem. (Actually, just replacing wp-blog-header.php probably removes the problem, though it leaves all the malicious stuff behind.)
I realize that this has nothing whatsoever to do with personal finance, but it’s important, and there’s very little information out there about his exploit right now.
Many thanks to Nickel, who discovered this problem yesterday, and who helped me with troubleshooting tonight.
GRS is committed to helping our readers save and achieve your financial goals.Savings interest rates may be low, but that’s all the more reason to shop for the best rate.Find the highest savings interest rate from Ally Bank, Capital One 360, Everbank, and more.
This article is about Administration
Disclaimer: This content is not provided or commissioned by American Express. Opinions expressed here are author's alone, not those of American Express, and have not been reviewed, approved or otherwise endorsed by American Express. This site may be compensated through American Express Affiliate Program.
Discover is a paid advertiser of this site. Reasonable efforts are made to maintain accurate information. See the Discover online credit card application for full terms and conditions on offers and rewards.
SEARCH FOR RECENT ARTICLES




Here’s a video that demonstrates part of the problem.
http://it.youtube.com/watch?v=Obqa6jDV-WQ
It’s in Italian, but you should be able to get the idea.
loading....
Wow, and I just moved my site from self-hosting to WP.com yesterday.
Good luck cleaning that out.
loading....
Thanks for this great guide. Now I won’t panic (too much) if this happens to me.
Cheers,
Penelope
loading....
Hi JD,
Thanks for informing us.
Am on my way to check on my blogs & would have lost precious time if you had not blogged about it here.
Thanks again & have a great rest !
loading....
Man, these spammers really push my buttons! If only going after them legally fit into the “Frugal Things to Do” category
loading....
I just has a Coppermine site attacked a few months back. So I’ve been researching security. I wrote a 3 part plugin set to help secure WP.
The first can be found here:
http://wordpress.org/extend/plugins/ttc-user-registration-bot-detector/
The second will be released tomorrow AM on WP and on http://herselfswebtools.com
The third and final next Mon. I need the time between to deal with the traffic and questions.
The second in particular has blocked about 10 attempts a day to find security flaws in my WP blogs. I hope you’ll find them useful and interesting as well.
loading....
Darn. I was always checking for such here at GRS, but didnt even think to check your other sites…
loading....
JD, you’re a real trooper to warn everyone about this problem before you fall exhausted into bed. Hope everything looks a-ok when you wake up.
loading....
Thanks for the clear detailed explanation of what to do. I’m going to do the checking you recommend right now. Good luck with this!
loading....
I can see
“rss_f541b3abd05e7962fcab37737f40fad8″ but I see tons of other familar strings. Should I be only deleting this string or the others too?
Thanks so much.
loading....
DC – no, do not delete the other strings. I did a fresh WordPress install last night at one site just to see if the other strings were a problem. They’re not. WP sticks them in the database at the start.
loading....
JD, thanks, your my hero! Thanks so much for posting this. I’ve noticed a reducing of traffic from Google this week, and I think this could be why.
loading....
As a barely literate computer user and fan of your site, will using WordPress affect MY personal computer?
loading....
Here is more information from one of the developers:
http://ocaoimh.ie/2008/06/08/did-your-wordpress-site-get-hacked/
loading....
JD-thanks for the heads up. I checked my blog and don’t seem to be affected. After all the work I went through to make my site and blog look right I would hate to start again!
loading....
What a pain! I’m now more thankful for Typepad.
loading....
@J.D.: I concur, thanks for the heads up on this. I just checked both my WP sites, and they’re cool. I’ll pass this along to a WP-related forum I post to, as well.
@Karen: It depends on how you define “using WordPress”. If you’re visiting a hacked WP site (or really, any hacked site), the hacker may have placed malicious code on the page that may take advantage of browser vulnerabilities to do things to your browser or machine. If you’re administering a WP site, it’s about the same danger wrt browser vulnerabilities, but since you’ve also got all sorts of other fun information in the site’s database, who knows what other things the hackers may be able to do with that info. Moral of the story: use a secure browser (I like Firefox + NoScript, which is extra work up front to define what sites you’ll allow to execute scripts, but worth it IMHO).
Some more WP security bits that I like to recommend to other WP users are from these articles:
http://www.hackosis.com/index.php/2007/11/04/10-ways-to-secure-your-wordpress-install/
http://www.simplehelp.net/2007/09/10/9-ways-to-secure-your-wordpress-blog/
And now, back to your regularly scheduled personal finance.
loading....
This was such a pain in the azz…
loading....
While I’m running WP 2.5.1 as well, I seem to have escaped the attack by salting my database name and tables. If you call your WordPress DB something other than “wordpress” and your tables something other than “users” and “posts”, the attack probably fails.
JIC, I checked my install and it appears to be clean.
loading....
This is interesting. I have a wordpress blog, but nothing is happening yet. Is there a possibility that this same thing could happen to me at some point?
loading....
JD, thanks for posting this recap as I too discovered this on my site and had been looking into why my search traffic had really dropped. Hopefully it has all been resolved but I will be keeping a close eye on everything.
Thanks to all other parties that were involved in the discovery of this as well, your efforts are appreciated!
loading....
thanks for the article. but i went through all the steps and my site is still getting redirected. if there any other new solutions out there please drop them here. thanks.
loading....
I use your site for motivation & information to keep my spending down, but this was great information to transfer over to my own site.
Thanks for your work and details on fixing this problem.
loading....
Actually, it is totally safe to delete ALL of the rss_bigStringOfRandomGibberish lines. These are the caches for the RSS feeds/widgets, and if they are not found, then they will simply be reloaded on the next run through.
loading....
I found this plugin:
http://www.mittineague.com/dev/co.php
if you want to clear old RSS feeds from wp_options table.
(if you not sure that your database is injected)
loading....
Thanks for this post. I just found out I was hacked back in April. Your instructions helped me take care of the problem. Thanks again.
loading....