2011-08-31 3 views
2

내 워드 프레스는 다음 .htacess 파일이 있습니다워드 프레스 -의 RewriteRules 및 w00t 문제

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule \.php /index.php [L,R=404] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 

# END WordPress 

내가 최근에하는 error.log에 해당 URL을보고 한

[Wed Aug 31 04:02:28 2011] [error] [client 69.162.74.102] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 04:02:32 2011] [error] [client 69.162.74.102] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 04:02:32 2011] [error] [client 69.162.74.102] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 04:02:32 2011] [error] [client 69.162.74.102] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 04:02:32 2011] [error] [client 69.162.74.102] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 04:19:40 2011] [error] [client 67.205.102.172] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 04:19:42 2011] [error] [client 67.205.102.172] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 04:19:42 2011] [error] [client 67.205.102.172] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 04:19:42 2011] [error] [client 67.205.102.172] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 04:19:42 2011] [error] [client 67.205.102.172] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 08:53:30 2011] [error] [client 67.205.102.172] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 08:53:32 2011] [error] [client 67.205.102.172] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 08:53:32 2011] [error] [client 67.205.102.172] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 08:53:32 2011] [error] [client 67.205.102.172] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 08:53:32 2011] [error] [client 67.205.102.172] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 10:30:24 2011] [error] [client 124.124.204.58] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 10:31:12 2011] [error] [client 124.124.204.58] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 10:31:12 2011] [error] [client 124.124.204.58] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 10:31:12 2011] [error] [client 124.124.204.58] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 
[Wed Aug 31 10:31:12 2011] [error] [client 124.124.204.58] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) 

문제는이 URL 히트 모든 시간을 우리 서버는 Wordpress (.htaccess 규칙 참조)로 이동하여 db와 일치하는 페이지를 검색합니다. 이것은 아파치가 segfault하는 원인이되는 불필요한 스파이크를 일으키고 있습니다.

어떻게하면이 URL이 Wp를 공격하지 못하게 할 수 있습니까? 규칙이 일치 할 때

+0

와우 : 그 일은 아직 살아 있습니까? :-) (나는 그 스캐너를 당신의 서버가 아니라고 말합니다) : D – PeeHaa

답변

1

F 플래그는 403 Forbidden 응답을 보냅니다 :

RewriteRule /w00tw00t\.at\.ISC\.SANS\.DFind - [F] 

그냥 RewriteBase / 후이를 추가합니다.

BTW의 [error] client sent HTTP/1.1 request without hostname 오류는 아파치가 400 Bad request 상태로 회신하고 이러한 요청이 wordpress를 공격하지 않는다고 제안합니다.

+0

다시 쓰기 규칙에서 /w00tw00t.at.ISC.SANS.DFind 하드 코딩에 의존하고 싶지 않습니다. 호스트 이름없이 쿼리를 타겟화할 수 있습니까? 내 시도는 지금까지 성공을 입증하지 못했습니다. – Adil

+1

아파치는 호스트 명없이 HTTP/1.1 요청에 대해 이미 400 오류로 응답하므로 wordpress를 전혀 치는 것이 아닙니다. – arnaud576875

3

iptables를 통해 이러한 종류의 액세스를 차단하고 싶지 않을 수 있습니다. ssh를 통해 루트 계정으로 서버에 가서 다음을 입력하십시오.

iptables -I INPUT -p tcp --dport 80 -m string --to 60 --algo bm --string 'GET /w00tw00t' -j DROP 
+0

iptables를 사용하는 IMHO가 가장 좋습니다. http://spamcleaner.org/en/misc/w00tw00t.html에서 더 자세한 정보를보십시오. – pevik

+0

또는'/ etc/csf/csfpost.sh' 파일을 만들고 서버에 csf가 있으면'iptables' 명령을 삽입하십시오 – yitwail