WordPress Backdoor and How to Remove (Blank Page When Submitting Posts)
-
Hi,
I wanted to share something that I discovered with the WordPress community. I’ve noticed several unresolved threads about getting a blank page when submitting a new post (i.e., post.php returns a blank page without an error).
I went to upgrade a client’s installation of WordPress earlier today and ran into the same problem. Another blog is installed on the same server, and I upgraded it at the same time. It worked perfectly following the upgrade, so I was understandably confused when the first upgrade failed.
I tried the usual remedies that are suggested around here to no avail. When those didn’t work, I stepped into the WordPress database and found a plugin called Magic Include Shell that wasn’t visible from the plugin list. From the database:
| active_plugins |a:5:{i:0;s:71:”/../../../../../../../../../../../../../../../../../tmp/ro8kfbswmag.txt“;i:1;s:19:”akismet/akismet.php”;i:2;s:23:”all_in_one_seo_pack.php”;i:3;s:14:”breadcrumb.php”;i:4;s:24:”underscorepermalinks.php”;} |
You can determine whether or not your installation is infected by running the following MySQL query:
SELECT * FROM wp_options WHERE option_name = 'active_plugins';
Look for entries like the one I’ve highlighted above in bold, or one that doesn’t correspond to a plugin that you use. If one exists, run the following query. You’ll need to reactivate your plugins afterward. (Before doing so, be sure to note the path of the hidden plugin, as indicated in bold above.)
UPDATE wp_options SET option_value="" where option_name="active_plugins";
Now, delete the hidden plugin and make sure that your version of WordPress is current. Additionally, check your upload directory to make sure that it is set correctly, and that no malicious files (especially hidden files, prepended with a
.
, which aren’t shown in some directory listings) have been placed there.Magic Include Shell gives an attacker the equivalent to console access, which means that the attacker can upload and execute arbitrary code. In other words, one should be extremely careful to ensure that the problem has been fully mitigated.
If you would like to read the source code of Magic Include Shell, you’re welcome to read it here.
Hope this helps!
Best regards,
Trey
Edit: Fixed mistake in MySQL “SELECT” query.
- The topic ‘WordPress Backdoor and How to Remove (Blank Page When Submitting Posts)’ is closed to new replies.