WordPress.org

Ready to get started?Download WordPress

Forums

Security Concern - Hacked Website (13 posts)

  1. medusa_g
    Member
    Posted 1 year ago #

    Hi,

    This is going to be a long one, so please bear with me.

    Over the past few weeks there have been some security issues with a website I designed and developed for a client. A little over a week ago the site was hacked into and the home page displayed 'Hacked by Hmei7' with animated falling snowflakes in the background. I contacted the hosting company (no help whatsoever) did a bunch of research, poked around and found that the hacker had replaced the header.php file. I didn't notice that anything else was different or altered, but just to be safe, I changed all associated passwords and did a fresh WordPress install of the latest version, restored a clean backup of my theme etc...

    For about a week everything seemed fine and dandy until this morning. I tried logging into WordPress and kept getting an 'invalid username' error. I instantly thought 'oh no, here we go again' but I didn't want to jump to conclusions, so once again I contacted the host, researched and poked around. I checked the wp_user/s database table via phpmyadmin and found that the username had been changed to admin (it was something else when I created it) and the password was changed to long (seemingly) random characters. Despite this, the site itself appeared to look and function as normal.

    That's the 'short' version of what's happened, but I did find that there was something in common with both 'attacks'. I had a look at the error_log and the dates that fit around the time of both incidents show numerous attempts at accessing/changing the wp-db.php file (in wp-includes). I can't be sure, but that makes me think that it could be the same 'offender'.

    For the time being I have uploaded a temporary maintenance page as a safety measure for site visitors. I have a feeling that it will happen again soon if I restore the site as I had previously, so I need to try and get to the bottom of it, 'patch' things up (or start afresh) and do what I can to prevent this from happening in future. I'm just not sure where to start, if I am missing something or have just been awfully unlucky. Any help or advise would be much appreciated.

    Thanks in advance :)

  2. medusa_g
    Member
    Posted 1 year ago #

    Forgot to mention that I was using WordPress version 3.4 when the first incident occurred, then version 3.4.2 the second time.

  3. jonpedlow
    Member
    Posted 1 year ago #

    Push your host to help out.

    I had a similar problem once as in the problem kept reappearing, when looking deeply at everything I found it was simply the hacker had created them self a user account in my dashboard with full admin rights.

    Might be a good idea to check the users of your site just in case?

  4. medusa_g
    Member
    Posted 1 year ago #

    Thanks for the suggestion jonpedlow.

    I checked the wp_users table of the WordPress database in phpmyadmin (as explained above) and my username and password were non existent. They were overwritten/replaced by username: admin password: long bunch of random characters.

    As for the host, they are the least helpful hosting company I have ever dealt with. In short, they refuse to look into it or admit whether or not it's a problem at their end. I don't think changing hosts at this point will resolve the issue, but I am going to strongly suggest my client changes hosts asap once it is sorted.

  5. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    password: long bunch of random characters.

    You do realise that the password is one-way encrypted in the database, don't you?

  6. medusa_g
    Member
    Posted 1 year ago #

    @esmi, I'll rephrase that. It seems that the username and password have either been changed or have been rendered useless. 'admin' is a recognised username (this might always be the case, I'm not sure), but it isn't the one I used in the initial WordPress setup. I've tried the password with both usernames numerous times, but kept getting error messages. There is only the one user account and I am the only person (or at least I thought I was) with the login details.

  7. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

  8. medusa_g
    Member
    Posted 1 year ago #

    Yes, I did come across http://codex.wordpress.org/Resetting_Your_Password whilst researching the problem, although I haven't tried changing the password yet. I'm pretty sure that regaining access won't stop the login details (or anything else) being changed again soon, which is why I am being so adamant about finding out exactly what happened if possible.

    In the meantime I had uploaded a maintenance.php page, which was later rendered useless also. I now have an index.htm temp page up instead and that seems to be doing the job for now.

  9. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

  10. medusa_g
    Member
    Posted 1 year ago #

    Thanks for the info.

    I'll have a good look through the resources to see if I can turn up anything or missed something the first time around, but I am sure they are the same ones I went through the first time the site was hacked into. Admittedly, I didn't follow them all to a T and figured it was probably best to delete everything WordPress related from the server and start afresh. Either I was very mistaken, or there's a lot more to it than that.

  11. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    There is. You need to follow all of the instructions to completely de-louse your site.

  12. medusa_g
    Member
    Posted 1 year ago #

    I had an extensive look through the WordPress database, folders and files etc... paying particular attention to certain db tables and files mentioned in the resources above and others I have come across throughout my research. Despite this, I haven't noticed anything strange or suspicious. I also tried the suggested site scanners (http://sitecheck.sucuri.net/scanner/ and http://www.unmaskparasites.com/), which also haven't turned up anything.

    Something I am still not sure about is that the error_log on the server shows numerous MySQL connection errors to wp-db.php (as mentioned in my first post). I couldn't really find any info on what the file does or is for, or if it could lead to finding out what went wrong.

    My client is changing hosts very soon, so I haven't restored the site as yet. For now I have put a HTML temp page up and deleted all WordPress files on the server). At this point, I am thinking it might be best to start afresh (clean install, restoring clean/pre-hacked local backups etc...) on the new server and follow these tips/suggestions http://codex.wordpress.org/Hardening_WordPress.

  13. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    the error_log on the server shows numerous MySQL connection errors to wp-db.php

    That could just be part of the normal generation of a populated page on a WordPress site.

Topic Closed

This topic has been closed to new replies.

About this Topic