• nick robinson

    (@nick-robinson)


    Two of my sites (on the same server, but with seperate databases and passwords) have been hacked in the past couple of days. Both installed files in the uploads area which included fake login screens for wells-fargo bank.

    To be safe, I’ve wiped the installations clean and reuploaded with new, more secure passwords at every stage.

    What I’d like to know is how to discover how they got in to start with? One issue I’ve had is that with uploads set to anything other than 777, various error messages occur.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Krishna

    (@1nexus)

    In a shared hosting environment with suexec, no directories should ever be given 777. Since php process is running as the owner of the files, it gets the owners permissions and can write to even a 755 directory.
    Ref:- http://codex.wordpress.org/Changing_File_Permissions

    Assuming that you have fully deloused your site, still you may want to review again:
    http://codex.wordpress.org/FAQ_My_site_was_hacked
    http://codex.wordpress.org/Hardening_WordPress

    File permissions good or bad will not allow your site to be hacked, unless the server is quite badly configured or has not been updated in the past five years.

    Outdated versions of WordPress, pluginss or themes are virtually always the reason how/why.

    Alternately, be sure to change all passwords associated with your account, and likewise check your computer for viruses or malware.

    Thread Starter nick robinson

    (@nick-robinson)

    I use the latest version of WP, plus the weaverII theme. I’ve changed the permissions for the uploads folder to 755, but now cannot upload images. I get

    “failed to upload due to an error
    The uploaded file could not be moved to /var/www/vhosts etc.”

    I set to 777, it works. 755, it doesn’t.

    This was the reason I used 777 in the first place! It seems to be a hugely common issue – dozens of people appear to have the same problem and most seem to solve it only by using 777. I don’t understand – you say permssions isn’t a cause of hacking, so why is 777 is so dangerous?

    this page says use 770, which does appear to work.

    http://wordpress.org/support/topic/advanced-problem-image-upload?replies=12

    BTW, How can I find out if my password has been cracked?

    All my plugins are downloaded via the WP interface, how are we supposed to know if some contains malicious code?

    I’m trying to do what’s right….

    Clayton James

    (@claytonjames)

    Hey, Nick!

    File permissions good or bad will not allow your site to be hacked, unless the server is quite badly configured or has not been updated in the past five years.

    That is an ambiguously worded statement at best, that can ultimately lead to an misinformed interpretation that could prove to be dangerous:

    I’ve changed the permissions for the uploads folder to 755, but now cannot upload images.

    In a properly configured shared hosting environment, 0755 and 0644 permissions or LESS, can prove quite effective. Your uploads folder, or any folder for that matter, should never require 0777 permissions.

    You may have some ownership issues that are causing some grief.

    This was the reason I used 777 in the first place! It seems to be a hugely common issue – dozens of people appear to have the same problem and most seem to solve it only by using 777.

    It becomes an issue when files and directories or processes are owned/group-owned by something other than your own user account.

    Contact your host. Come right out and ask them what your file and directory permissions should be, what the owner and group should be, and why. If you’re in a shared environment, and they tell you that owner and group should be anything other than your own user account, you need push them into telling you why, and then make a decision about whether continued use of their service is in your best interest.

    Of course, if you’re managing your own VPS, and no shared hosting is involved, then the ownus is on you as a server administrator.

    What I’d like to know is how to discover how they got in to start with?

    Log files, auditing, and your hosts support staff involvement.

    15 years of experience says, if your host allows 777 permissions you need to move to a more secure host as soon as possible to do so. That’s just wrong and has been for years.

    Outdated servers = I was hacked.

    Clayton James

    (@claytonjames)

    if your host allows 777 permissions you need to move to a more secure host as soon as possible to do so. That’s just wrong and has been for years.

    Yep’. I cannot agree more. However, “allowing” and “requiring” are two different issues.

    Your uploads folder, or any folder for that matter, should never require 0777 permissions.

    Sorta’ what I said, don’t you think?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Hacked twice ;(’ is closed to new replies.