-2

Possible Duplicate:
My server’s been hacked EMERGENCY

My website was hacked recently. I think i've found the code that was added to the htaccess file, deleted it and then added script to prevent the htaccess file being accessed again. I've also deleted the php file that the hacked code refers to (common.php). What do i need to do next? I'm not a programmer or website developer but i really wanted to see if i could fix the problem myself as i've spent quite a few hours trying and don't give up easily.

Here is the hacked code that i deleted:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (google|yahoo) [OR]
RewriteCond %{HTTP_REFERER} (google|yahoo)
RewriteCond %{REQUEST_URI} /$ [OR]
RewriteCond %{REQUEST_FILENAME} (shtml|html|htm|php|xml|phtml|asp|aspx)$ [NC] 
RewriteCond %{REQUEST_FILENAME} !common.php
RewriteCond /home/httpd/vhosts/bluestardive.com/httpdocs/common.php -f
RewriteRule ^.*$    /common.php [L]
</IfModule>

this code has to stay in the htaccess file as it redirects my url to seo friendly ones or the website errors, but has this code been hacked as well?

# Apache search queries statistic module
RewriteEngine On
AddHandler php5-fastcgi .php .php5
# <contrexx>
#   <core_modules__alias>
    RewriteRule ^about-us$    /index.php?page=883 [L,NC]
    RewriteRule ^ausfluge-und-aktivitaten$    /index.php?page=800 [L,NC]
    RewriteRule ^bluestardive-news$    /index.php?page=919 [L,NC]
    RewriteRule ^bookings$    /index.php?page=911 [L,NC]
    RewriteRule ^diveresort$    /index.php?page=879 [L,NC]
    RewriteRule ^diving$    /index.php?page=880 [L,NC]
    RewriteRule ^excursions-and-activities$    /index.php?page=881 [L,NC]
    RewriteRule ^galerie$    /index.php?section=gallery [L,NC]
    RewriteRule ^oceannight$    http://www.bluestardive.com/index.php?page=906 [L,NC]
    RewriteRule ^philosophy$    /index.php?page=846 [L,NC]
    RewriteRule ^reservation$    /index.php?page=917 [L,NC]
    RewriteRule ^reservierung$    /index.php?page=918 [L,NC]
    RewriteRule ^resort$    /index.php?page=798 [L,NC]
#   </core_modules__alias>
# </contrexx>

1 Answers1

2

The best thing to do in situations like these is to pinpoint the users entry point, and duplicate the attack - I cannot tell you whether there is any thing suspicious added into the .htaccess as I have no idea what is inside of index.php.

If index.php echo's data directly from the database, then it might be possible that he/she added malicious code inside the database, he/she possibly created a few new entry points (PHP Shells, Vulns) in other files.

I would strongly recommend you to talk to a security professional - if not, thoroughly re-inspect every file on your server, including database entries.

Make sure to figure out what his entry point was as well, to prevent future attacks - if you need any further information you can always contact me.

symplyf
  • 121