Possible fixes for recent WordPress hack
UPDATE:
While the instructions below can help remove the lines of code inserted into your php pages, it doesn’t necessarily remove the *exploit* that allowed such an incursion in the first place. Â What I’ve learned after the code re-appeared in the past 24 hours on ~7 blogs hosted (for reference, I’m on dreamhost):
1. Delete all unused, old themes. Â The “blue kino” theme looks like a possible culprit, but just get rid of whatever you aren’t using, and upgrade the one you are.
2. Update all plug-ins you are using, and delete the ones you are not.
3. Make sure WordPress itself is up-to-date.
4. Look for odd files that don’t fit. If you’ve been hacked, contact your host–they can run scripts to help you track these down. Â For example, on one site there was:
[domain name]/wp-admin/network/verdiweston.php
and
[domain name]/wp-admin/user/addiathoreau.php
5. Consider a database dump and re-install (I believe @wayne_graham might be planning a blog post to outline a clear process for this).
Note: I’m hopeful these steps will work, but I’m also expecting to be surprised by a fresh round of cleaning (and full re-installations) tomorrow.  So, caveat emptor.
==
ORIGINAL POST
I’ve found the the Sucuri.net blog (http://blog.sucuri.net/) an incredibly valuable resource when wordherder blogs have been hit with various hacks. Recently, George’s workbook.wordherders.net was hacked, and I was able to use the same script that Sucuri provided in a May 2010 posting to clean up the files.
The hack puts one line of php code in each of your php files. It begins with the following script:
<?php /**/ eval(base64_decode("aWY....
Cleaning the site requires extraction of that php code from all pages in all directories for your WP installation. The Sucuri solution uses SED to accomplish this. If you want to make sure this is the hack that impacted you, you can check by either downloading one of your php files by ftp or SSH in to read one. A very, very long line of php code should begin with that you see above.
Here is an old Sucuri post from May 2010 where I downloaded the original fix (which I used to clean a hack in 2010):
http://blog.sucuri.net/2010/05/simple-cleanup-solution-for-the-latest-wordpress-hack.html
The link to the file they provided is broken, so here’s the copy that I have (again, all credit to the original Sucuri post):
http://misc.wordherders.net/wp/wordpress-fix_php.txt
Follow the directions from the May 2010 post under the section “via web” — this same script worked in cleaning up the recent attack from last week on http://workbook.wordherders.net/ (and also worked just now on my own site, which I had to clean before posting this). Remember that you have to change the file name so to wordpress-fix.php
Be patient…it can take a few seconds to run. It will give you a notice when it is done. Then go and check some of your php files to make sure it worked.
—
Another possible solution: in the comments feed from this Feb 2012 Sucuri post (http://blog.sucuri.net/2012/02/malware-campaign-from-rr-nu.html), Walker de Alencar provides this link to his github script rrnuVaccine:
https://github.com/walkeralencar/rrnuVaccine
—
Good luck all!
3 Responses to Possible fixes for recent WordPress hack
Leave a Reply
Archives
- February 2016
- April 2014
- March 2014
- April 2013
- March 2012
- January 2012
- March 2011
- February 2011
- February 2009
- January 2008
- September 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- November 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- April 2004
- March 2004
- February 2004
- January 2004
- December 2003
- November 2003
- October 2003
- September 2003
- August 2003
- July 2003
- June 2003
- May 2003
- April 2003
- March 2003
Categories
Thanks. This worked for me too. However, it broke my bbpress forum, so I ended up restoring the entire forum directory from backup and then all was well since the forum posts are all stored in the database. It also broke my ‘Contact Form 7’with ‘Really Simple Captcha’ but I deleted and reinstalled those from scratch and now I’m back. Thanks for the posting.
Thank you for fixing everything again.
[…] I posted the situation to Facebook and Geroge Williams provided a link to the blog post “Possible fixes for recent WordPress hack,”which provides links to Sucuri.net’s post that includes an easy to install and run […]