• Hi everyone, I have just been hacked. I am a web developer, and have about 20-30 WordPress sites, all of them running 3.3.1. They all seem to have been hacked. Here’s one you can look at, if you search google for harmonyhomes.net and click on the link from Google, you will see that it goes to http://saveprefs.ru/astro/index.php first then to msn.ca. Can anyone please help me find the code? I really don’t want to have to try to restore all my sites from backups.

    Thank you all.

    Jamie

Viewing 15 replies - 31 through 45 (of 98 total)
  • Thread Starter Jamie Edwards

    (@jamieedwards)

    I did that, made a new .htaccess file, uploaded it and changed the permissions on it to 444, but after about an hour, it had been overwritten by a corrupted file once again. So this solution doesn’t work 🙁

    Since yesterday I try to fix that and I can not :/

    The biggest problem is that you guys think you are editing and overwriting your .htaccess files, when in fact, the overwrites are failing. These hacked files are set to “read only” and can’t be overwritten. I seriously don’t think they are replacing themselves — you guys just aren’t changing the permissions before attempting an overwrite.

    @old_fart – I did everything that you listed. My site is working perfectly fine.

    @Richardline – Here’s detailed directions of what I did:

    1. Change all passwords

    2. Look in EVERY directory and delete the suspicious PHP files as mentioned previously.

    3. Look in EVERY directory for a .htaccess file and delete it or overwrite it with your desired .htaccess file. Overwriting will not work unless you first change the file permissions of the infected file to 0644 before overwriting.

    4. If you are overwriting your .htaccess files instead of deleting them, be sure to delete all of the hidden code at the top and bottom of each file. A lot of white-space was added to hide the code from you.

    5. Add a 404 redirect to your new .htaccess file if you haven’t already done so. I created a 404 page named “example.html” and added this to my .htaccess file(remove the quotes): “ErrorDocument 404 /example.html”

    6. Manually test your site to see if it’s working, and also test with http://sitecheck.sucuri.net/scanner/

    Let me know if this works for you. My site has been up for 7+ hours since doing these things.

    @jamieedwards
    Sorry, You’re right! 🙁

    I was on WP 3.2.1, i updated to 3.3.1 30 mins ago and seems the problem is gone and the .htaccess file is still not infected.

    I think the malicious script was injected to one of the WP core files so when i updated, all files were replaced by new ones and the problem is gone for now.

    I did everything that’s been said in this thread, but the issue has still not been resolved. I even made a clean reinstall – deleting every single wp-file on my server – including a new database. Didn’t work. I’m really lost on this one. And getting just a little desperate.

    The .htaccess file will always be modified as long as the backdoor files haven’t been removed.

    The backdoor files normally will be placed on directories and files that won’t be replaced even the wordpress updated, they are everything inside wp-content and wp-config.php.

    Try checking on your active theme and wp-content/uploads directory, in my case, I found the backdoor files there.

    And I updated all timthumb.php script to the latest version (2.8.5), since the old version having security vulnerability.

    It’s been 3 hours my .htaccess stay untouched (I hope it stay like that :prayhard:), it’s keep changing every single hour before.

    Hope that helps.

    I get that, but I manually deleted every single file that is related to WP (and more than that). I cleaned up my whole server. Still, after the reinstall, .htaccess was again targeted.

    @urbaanalmelo cleaning your whole server, re-install, and then not importing your old data at all? 😮

    Yep, that’s kind of what I did…

    I published a simple plugin a while ago that will give you a list of files within your site that have been changed since a particular time. It’s http://wordpress.org/extend/plugins/simple-changed-files/. There is also a plugin that will notify you when changes occur called http://wordpress.org/extend/plugins/wordpress-file-monitor-plus/, but it won’t do the initial scan.

    The initial vector for a lot of hacks is a stolen FTP password, so be sure to change those and check your PC for malware.

    All, I think the problem is related to web hosting. The hosting company apache servers are probably creating .htaccess so no matter what you do it will continue to get overwritten. Please contact your hosting provider to look into it. In the meantime I added a TEMPORARY solution which deletes the file every minute via cron.

    # create as many as you need to delete all the .htaccess that are being created.
    * * * * * rm -fr ~/public_html/.htaccess > /dev/null 2>&1

    Wow, if you have done that, and everything has been said here, including changing your FTP, MySQL and cpanel password, but still getting hacked. I don’t have any idea how the hacker is doing it.

    Sorry for later response. Finally I got a time to analyze file provided by p-mt.
    It actually isn’t too dangerous PHP script, it is really old crackers/hackers tools called WSO which is basically is a web shell.

    What it does:

    It has Authorization for cookies
    Get Server Information
    Disable logging
    Rewrite php setttings
    File manager (copy, rename, move, delete, chmod, touch, creating files and folders)
    View, hexview, editing, downloading, uploading files
    Working with zip archives (packing, unpacking) + compression via tar
    Console
    SQL Manager (MySql, PostgreSql)
    Execute PHP code
    Working with Strings + hash search online databases
    Bindport and can make back-Connect (via Perl. php script drop to /tmp files bp.pl and bc.pl)
    Bruteforce FTP, MySQL, PgSQL
    Search files, search text in files
    Works on nix-like and Windows systems
    Anti search engine (check User-Agent, if it is a search engine then returns 404 error)
    Use AJAX

    Actually, on infected systems should be something else(other files) that created this WebShell. It could be a hole in WP or in other servers (HTTP, FTP), but usually it happened because of really weak passwords.

    Grab KeePass(it works with the same database file on any platform – unix based, windows, iPhone, Android), create strong passwords with embedded generator and keep that passwords in KeePass.

    No, it’s not related to web hosting. It’s most likely related to hacked FTP accounts. I have reseller hosting, and only one of my sites have been affected by this — once I fixed it, it never came back. It’s been nearly 12 hours now.

Viewing 15 replies - 31 through 45 (of 98 total)
  • The topic ‘3.3.1 Hacked by saveprefs.ru redirect’ is closed to new replies.