<6B B1E2BCFAB9AEBCAD5FBAAFB1D4BCAE2E687770>

Similar documents
APOGEE Insight_KR_Base_3P11

0125_ 워크샵 발표자료_완성.key

Page 2 of 6 Here are the rules for conjugating Whether (or not) and If when using a Descriptive Verb. The only difference here from Action Verbs is wh

- 2 -

휠세미나3 ver0.4

Page 2 of 5 아니다 means to not be, and is therefore the opposite of 이다. While English simply turns words like to be or to exist negative by adding not,


Microsoft PowerPoint - ch03ysk2012.ppt [호환 모드]

LXR 설치 및 사용법.doc

Solaris Express Developer Edition

UDP Flooding Attack 공격과 방어

PowerChute Personal Edition v3.1.0 에이전트 사용 설명서

28 THE ASIAN JOURNAL OF TEX [2] ko.tex [5]

chapter4

Stage 2 First Phonics

°í¼®ÁÖ Ãâ·Â

#Ȳ¿ë¼®

PowerPoint 프레젠테이션

chapter1,2.doc

CD-RW_Advanced.PDF

1217 WebTrafMon II

thesis-shk

슬라이드 제목 없음

목차 BUG offline replicator 에서유효하지않은로그를읽을경우비정상종료할수있다... 3 BUG 각 partition 이서로다른 tablespace 를가지고, column type 이 CLOB 이며, 해당 table 을 truncate

<31332DB9E9C6AEB7A2C7D8C5B72D3131C0E528BACEB7CF292E687770>

H3050(aap)

<32B1B3BDC32E687770>

¹Ìµå¹Ì3Â÷Àμâ

ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE (Online Upgrade) ORANGE CONFIGURATION ADMIN O

K7VT2_QIG_v3

본문서는 초급자들을 대상으로 최대한 쉽게 작성하였습니다. 본문서에서는 설치방법만 기술했으며 자세한 설정방법은 검색을 통하시기 바랍니다. 1. 설치개요 워드프레스는 블로그 형태의 홈페이지를 빠르게 만들수 있게 해 주는 프로그램입니다. 다양한 기능을 하는 플러그인과 디자인

Remote UI Guide

11¹Ú´ö±Ô

<30322D28C6AF29C0CCB1E2B4EB35362D312E687770>

Hi-MO 애프터케어 시스템 편 5. 오비맥주 카스 카스 후레쉬 테이블 맥주는 천연식품이다 편 처음 스타일 그대로, 부탁 케어~ Hi-MO 애프터케어 시스템 지속적인 모발 관리로 끝까지 스타일이 유지되도록 독보적이다! 근데 그거 아세요? 맥주도 인공첨가물이

bn2019_2

<B3EDB9AEC1FD5F3235C1FD2E687770>

DE1-SoC Board

Product A4

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

PWR PWR HDD HDD USB USB Quick Network Setup Guide xdsl/cable Modem PC DVR 1~3 1.. DVR DVR IP xdsl Cable xdsl Cable PC PC DDNS (

<B1E2C8B9BEC828BFCFBCBAC1F7C0FC29322E687770>

강의10

<32382DC3BBB0A2C0E5BED6C0DA2E687770>

Á¶´öÈñ_0304_final.hwp

민속지_이건욱T 최종

Intra_DW_Ch4.PDF

04-다시_고속철도61~80p

USB USB DV25 DV25 REC SRN-475S REC SRN-475S LAN POWER LAN POWER Quick Network Setup Guide xdsl/cable Modem PC DVR 1~3 1.. DVR DVR IP xdsl Cable xdsl C

<31325FB1E8B0E6BCBA2E687770>

step 1-1

Microsoft PowerPoint - 06-IPAddress [호환 모드]

우리들이 일반적으로 기호

ARMBOOT 1


Coriolis.hwp

Oracle hacking 작성자 : 임동현 작성일 2008 년 10 월 11 일 ~ 2008 년 10 월 19 일 신규작성 작성내용

PRO1_04E [읽기 전용]


사용시 기본적인 주의사항 경고 : 전기 기구를 사용할 때는 다음의 기본적인 주의 사항을 반드시 유의하여야 합니다..제품을 사용하기 전에 반드시 사용법을 정독하십시오. 2.물과 가까운 곳, 욕실이나 부엌 그리고 수영장 같은 곳에서 제품을 사용하지 마십시오. 3.이 제품은

2 min 응용 말하기 01 I set my alarm for It goes off. 03 It doesn t go off. 04 I sleep in. 05 I make my bed. 06 I brush my teeth. 07 I take a shower.

2 2010년 1월 15일 경상북도 직업 스쿨 운영 자격 취득 위한 맞춤형 교육 시 10곳 100명에 교육 기회 제공 본인에게 적합한 직종 스스로 선택 1인당 최고 100만원까지 교육비 지원 경상북도는 결혼이주여성 100명에게 맞춤형 취업교 육을 제공하는 결혼이민자 직

제20회_해킹방지워크샵_(이재석)

06_ÀÌÀçÈÆ¿Ü0926

슬라이드 1

Microsoft PowerPoint - G3-2-박재우.pptx

Chapter 1

untitled

06_±è¼öö_0323

Copyright 2012, Oracle and/or its affiliates. All rights reserved.,.,,,,,,,,,,,,.,...,. U.S. GOVERNMENT END USERS. Oracle programs, including any oper

Mango220 Android How to compile and Transfer image to Target

Journal of Educational Innovation Research 2019, Vol. 29, No. 1, pp DOI: (LiD) - - * Way to

Output file

1. 안드로이드개발환경설정 안드로이드개발을위해선툴체인을비롯한다양한소프트웨어패키지가필요합니다 툴체인 (Cross-Compiler) 설치 안드로이드 2.2 프로요부터는소스에기본툴체인이 prebuilt 라는이름으로포함되어있지만, 리눅스 나부트로더 (U-boot)

Oracle Apps Day_SEM

Cache_cny.ppt [읽기 전용]

歯kjmh2004v13n1.PDF

슬라이드 1

6자료집최종(6.8))

09김정식.PDF

Microsoft Word - ntasFrameBuilderInstallGuide2.5.doc

ps

PowerPoint 프레젠테이션

Something that can be seen, touched or otherwise sensed

Sena Device Server Serial/IP TM Version

< BFCFB7E15FC7D1B1B9C1A4BAB8B9FDC7D0C8B85F31352D31BCF6C1A4C8AEC0CE2E687770>

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

Copyright 2012, Oracle and/or its affiliates. All rights reserved.,,,,,,,,,,,,,.,..., U.S. GOVERNMENT END USERS. Oracle programs, including any operat

본문01

10송동수.hwp

MySQL-Ch05

Microsoft PowerPoint ppt

... 수시연구 국가물류비산정및추이분석 Korean Macroeconomic Logistics Costs in 권혁구ㆍ서상범...

Portal_9iAS.ppt [읽기 전용]

Journal of Educational Innovation Research 2018, Vol. 28, No. 3, pp DOI: NCS : * A Study on

02. 특2 원혜욱 지니 3.hwp

2 소식나누기 대구시 경북도 영남대의료원 다문화가족 건강 위해 손 맞잡다 다문화가정 행복지킴이 치료비 지원 업무협약 개인당 200만원 한도 지원 대구서구센터-서부소방서 여성의용소방대, 업무협약 대구서구다문화가족지원센터는 지난 4월 2일 다문화가족의 지역사회 적응 지원을

OP_Journalism

하나님의 선한 손의 도우심 이세상에서 가장 큰 축복은 하나님이 나와 함께 하시는 것입니다. 그 이 유는 하나님이 모든 축복의 근원이시기 때문입니다. 에스라서에 보면 하나님의 선한 손의 도우심이 함께 했던 사람의 이야기 가 나와 있는데 에스라 7장은 거듭해서 그 비결을

Sena Technologies, Inc. HelloDevice Super 1.1.0

Transcription:

기술문서 09. 09. 21. 작성 Iptables 이용한 Apache slowloris 공격방어 - 1 -

- 목차 - 1. mod_evasive 설치및방화벽정책적용을하는이유...3 가. 영향받는시스템...3 2. 소스파일준비가. slowloris 파일준비...3 나. connlimit&geoip 준비...3 3. 파일설치과정가. slowloris 설치...4 나. connlimit&geoip 설치...4 4. DOS 시연및방어가. DOS 시연...5 나. 방화벽적용...6 다. 기타DOS 방어...7 7. 참고문헌...9 별첨 1...10-2 -

1. mod_evasive 설치및방화벽정책적용을하는이유 IDS 및로드밸런싱을구현하지못한웹서버들은 DOS공격에취약하다고생각된다. 모듈설치및방화벽사용은 IT제품에대한투자없이소프트웨어적인방법으로회피가가능하다는것이특징이다. 특히 iptables는불완전접속종료를하며아파치웹서버의허용가능한클라이언트를모두채워버리는형태의 DOS에효과적으로대처할수있다고생각한다. 가. 영향받는시스템 Apache 1.x Apache 2.x dhttpd GoAhead WebServer WebSense "block pages" (unconfirmed) Trapeze Wireless Web Portal (unconfirmed) Verizon's MI424-WR FIOS Cable modem (unconfirmed) Verizon's Motorola Set-Top Box (port 8082 and requires auth - unconfirmed) BeeWare WAF (unconfirmed) Deny All WAF (unconfirmed) 2. 소스파일준비하기가. slowloris http://ha.ckers.org/slowloris/ -> http://ha.ckers.org/slowloris/slowloris.pl 나. geoip 모듈 patch-o-matic ( 원하는패치들을선택하는과정으로안내해주고, 커널을자동으로패치 ) -> http://ftp.netfilter.org/pub/patch-o-matic-ng/snapshot/ iptables -> ftp.netfilter.org/pub/iptables geoup update ( 스크립트 ) -> http://people.netfilter.org/peejix/geoip/tools/geoip_update.sh 다. apache2 rpm && src 로설치 - 3 -

3. 파일설치가. slowloris slowloris는설치과정이별도로존재하지않는다. 다만실행하기전에 INET와 SSL을설치해야사용할수있다. perl -MCPAN -e 'install IO::Socket::INET' perl -MCPAN -e 'install IO::Socket::SSL' 나. geoip 모듈 && connlimit 모듈 필자가사용할것은 connlimit 뿐이고 geoip같은경우특정지역에서 dos공격이들어올경우국가별로접속을차단하기위함이다. 1)p-o-m 설치및모듈설치 #tar xvfj patch-o-matic-ng-xxxxxxxx.tar.bz2 #./runme --download // 패키지가져옴 ( 커널및 iptables소스폴더입력해야함 ) #./runme geoip // geoip모듈설치 #./runme connlimit //connlimit 모듈설치 #cd / 사용자리눅스디렉터리 #make menuconfig Networking options --> IP:Netfilter Configuration --> geoip 및추가한모듈선택 #make modules // 실행하면 /usr/src/linux/net/ipv4/netfilter/ipt_geoip.o 모듈생성 #make modules_install 또는 #cp ipt_geoip.o /lib/modules/xxxxx/kernel/net/ipv4/netfilter/ #cd /ipatables 설치폴더 #make // libipt_geoip.so 생성 #make install or cp libipt_geoip.so /usr/local/lib/iptables/ 2) geoip database 생성하기 # vi geoip_update.sh GEO_BIN="http://www.cookinglinux.org/geoip/db/geoipdb.bin" GEO_IDX="http://www.cookinglinux.org/geoip/db/geoipdb.idx" 다음과같이수정. GEO_BIN="http://people.netfilter.org/peejix/geoip/database/20050410/geoipdb.bin" GEO_IDX="http://people.netfilter.org/peejix/geoip/database/20050410/geoipdb.idx" #geoip_update.sh - 4 -

// 실행시 /var/geoip/ 에 geoipdb.bin geoipdb.idx geoipdb.last 파일이생성 3) geoip database 최신버전다운로드 http://www.maxmind.com/download/geoip/database/ 4) 매월 1 일업데이트생성하기 cvs2bin 툴을이용하여매월1일업데이트되는 geoip database를생성한다. o 툴다운로드후설치 #wget http://people.netfilter.org/peejix/geoip/tools/csv2bin-20041103.tar.gz #geoip database 생성후 /var/geoip/ 에저장 #cvs2bin GeoIPCountryWhois.csv // 실행시geoipdb.bin geoipdb.idx 파일이생성 #cp geoipdb.bin /var/geoip/ #cp geoipdb.idx /var/geoip/ 5) ipt_geoip.o 모듈올리기 #insmod /lib/modules/xxxx/kernel/net/ipv4/netfilter/ipt_geoip.o #lsmod // 확인해볼것. 다. apache 설치 DOS테스트만할것이므로 apache만설치 #sudo apt-get install apache2 // 꾸러미가없어서설치할수없다고나오면 apt-get update를먼저실행할것 4. DOS 시연및방어법가. DOS 시연./slowloris.pl -dns 공격지주소 -port 포트지정 -shost virtualhost공격 -httpready HTTPReady Bypass 공격장면 옵션설명 정상적인작동 DOS 공격으로인한접속불가 - 5 -

아파치로그 나. 방화벽적용 #iptables -I INPUT -p tcp --dport 80 -m connlimit --connlimit-above 30 -j LOG --log-prefix "DOS" // 로그남기기 #iptables -A INPUT -p tcp --dport 80 -m connlimit --connlimit-above 30 -j DROP #iptables -L // 정책확인 iptables는기본적으로시스템을재부팅하던가서비스를재시작하면설정이초기화됨 #iptables-save > /root/firewall.txt // 출력리다이렉션 iptables-restore < /root/firewall.txt //rc.local에추가옵션정리 -N : 새로운체인만들기. -X : 비어있는체인을제거하기. -P : 미리만들어진체인의정책을바꾸기. -L : 어떤체인으로부터규칙들을나열하기 -F : 체인으로부터규칙들을지우기 -Z : 체인내의모든규칙들의패킷과바이트의카운트를 0으로만들기 -A : 체인에새로운규칙을추가하기 -I : 체인의어떤지점에규칙을삽입하기 ( 최상위로 ) -R : 체인의어떤지점의규칙을교환하기 -D : 체인에서일치하는첫번째규칙을제거하기 -s : 소스주소 -d : 목적지주소 -p : 프로토콜 ( 보통 :tcp/udp/protnumber:/ip/icmp/arp/rarp/igmp 등을이용 ) -i : 패킷이들어오는인터페이스 (INPUT, FOWARD) -o : 패킷이나가는인터페이스 (forward, output) -j : 해달룰의패턴이들어왔을때처리할작업정의 --dport : 목적지포트정의 --sport : 출발지포트정의 - 6 -

방화벽정책적용후작동모습 iptables 로그 다. 기타 DOS방어 1) mod_evasive? 방화벽정책사용후불완전접속종료에대한그림 이것은 HTTP Dos 또는DDos 스택또는저돌적인공격으로부터아파치를보호함탐지는주소, URI의 IP 내부동적해쉬테이블을생성함으로수행되고, 각아이피별로거부된다. 2) mod_evasive 의설치 # wget http://www.zdziarski.com/projects/mod_evasive/mod_evasive_1.10.1.tar.gz # tar xvzf mod_evasive_1.10.1.tar.gz // 압축해제 # cd mod_evasive // 디렉토리이동 # /usr/local/apache/bin/apxs -iac mod_evasive.c -> Apache.1.x # /usr/local/apache/bin/apxs -iac mod_evasive20.c -> Apache.2.x - 7 -

# vi /usr/local/apache/conf/httpd.conf // 환경설정아래에해당하는내용이존재하는지확인한다. 없으면추가. LoadModule evasive_module modules/mod_evasive.so -> Apache.1.x LoadModule evasive20_module modules/mod_evasive20.so -> Apache.2.x <IfModule mod_evasive20.c> DOSHashTableSize 4096 # 공격에대한기록을하는해시테이블크기이다. DOSPageCount 5 # 페이지를 DOSPageInterval 에설정된시간동안정해진횟수만큼호출하면차단한다. DOSSiteCount 50 # 사이트를 DOSSiteInterval 에설정된시간동안정해진횟수만큼호출하면차단한다. DOSPageInterval 1 # 페이지에대한호출횟수인지시간이다. DOSSiteInterval 1 # 사이트에대한호출횟수인지시간이다. DOSBlockingPeriod 30 # 차단후 403 오류 ( 접근권한없음 ) 을보여줄시간이다 DOSLogDir "/usr/local/apache/logs/mod_evasive.log" # 로그를파일의경로 </IfModule> # apachectl configtest // 환경설정검사 # apachectl -k restart // 재시작 3) 지시자에대한설명 DOSHashTableSize 각자식해쉬테이블마다탑레벨노드의수를지정한다. 수치가높으면높을수록더많은퍼포먼스가나타나지만테이블스페이스에메모리를남기게된다, 접속량이많으면이이수치를높혀도된다. DOSPageCount 이것은같은페이지또는 URI, 인터벌당요청수에대한카운트수이다. 지정된값이초과되면클라이언트에대한 IP 정보가블러킹리스트에추가 DOSSiteCount 지정된시간동안같은페이지를지정된수보다초과될경우 IP 정보가블러킹리스트에추가된다. DOSPageInterva 페이지카운트시발점, 디폴트는 1초이다. DOSSiteInterval 사이트카운트시발점, 디폴트는역시 1초이다. DOSBlockingPeriod 클라이언트가블랙리스트에추가되어블러킹되는총시간. 이때클라이언트는 403 (Forbidden) 에러를출력하게된다. DOSEmailNotify 이값이지정되면, IP가블러킹될때마다지정된이메일로발동된다. 주의 : 메일러는 mod_dosevasive.c 에정확하게지정되어야한다. 디폴트는 "/bin/mail -t %s" 이다. DOSLogDir 로그파일경로 DOSSystemCommand 이값이지정되면, 시스템은아이피가블러킹될때마다명령행을실행한다. - 8 -

- DOSWhitelist 차단에서제외될호스트 라. 테스트하기 # perl test.pl <- 다운받은파일안에포함되어있다. 마. 원문보기 별첨 1 7. 참고문헌 참고사이트 -http://wiki.kldp.org/wiki.php/docbooksgml/netfilter-extensions-trans -http://blog.cytoo.net/entry/dos-%ea%b3%b5%ea%b2%a9-%eb%b0%a9%ec%96 %B4-%EB%AA%A8%EB%93%88-mod_evasive -http://ha.ckers.org/slowloris/ - 9 -

별첨1. Apache DoS Evasive Maneuvers Module For Apache 1.3 and 2.0 Copyright (c) 2002 Network Dweebs Corporation Version 1.8 [2003.0901.1845] LICENSE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. WHAT IS MOD_DOSEVASIVE? mod_dosevasive is an evasive maneuvers module for Apache to provide evasive action in the event of an HTTP DoS or DDoS attack or brute force attack. It is also designed to be a detection tool, and can be easily configured to talk to ipchains, firewalls, routers, and etcetera. Detection is performed by creating an internal dynamic hash table of IP Addresses and URIs, and denying any single IP address from any of the following: - Requesting the same page more than a few times per second - Making more than 50 concurrent requests on the same child per second - Making any requests while temporarily blacklisted (on a blocking list) This method has worked well in both single-server script attacks as well as distributed attacks, but just like other evasive tools, is only as useful to the point of bandwidth and processor consumption (e.g. the amount of bandwidth and processor required to receive/process/respond to invalid requests), which is why it's a good idea to integrate this with your firewalls and routers. - 10 -

This module instantiates for each listener individually, and therefore has a built-in cleanup mechanism and scaling capabilities. Because of this, legitimate requests are never compromised but only scripted attacks. Even a user repeatedly clicking on 'reload' should not be affected unless they do it maliciously. Two different module sources have been provided: Apache v1.3 API: Apache v2.0 API: mod_dosevasive.c mod_dosevasive20.c HOW IT WORKS A web hit request comes in. The following steps take place: - The IP address of the requestor is looked up on the temporary blacklist - The IP address of the requestor and the URI are both hashed into a "key". A lookup is performed in the listener's internal hash table to determine if the same host has requested this page more than once within the past 1 second. - The IP address of the requestor is hashed into a "key". A lookup is performed in the listerner's internal hash table to determine if the same host has requested more than 50 objects within the past second (from the same child). If any of the above are true, a 403 response is sent. This conserves bandwidth and system resources in the event of a DoS attack. Additionally, a system command and/or an email notification can also be triggered to block all the originating addresses of a DDoS attack. Once a single 403 incident occurs, mod_dosevasive now blocks the entire IP address for a period of 10 seconds (configurable). If the host requests a page within this period, it is forced to wait even longer. Since this is triggered from requesting the same URL multiple times per second, this again does not affect legitimate users. The blacklist can/should be configured to talk to your network's firewalls and/or routers to push the attack out to the front lines, but this is not required. mod_dosevasive also performs syslog reporting using daemon.alert. Messages will look like this: - 11 -

Aug 6 17:41:49 elijah mod_dosevasive[23184]: [ID 801097 daemon.alert] Blacklisting address x.x.x.x: possible DoS attack. WHAT IS THIS TOOL USEFUL FOR? This tool is *excellent* at fending off small to medium-sized request-based DoS attacks or script attacks and brute force attacks. Its features will prevent you from wasting bandwidth or having a few thousand CGI scripts running as a result of an attack. When used in conjunction with other preventative measures such as router blackholing, this tool is very effective against larger DDoS attacks as well. If you do not have an infrastructure capable of fending off any other types of DoS attacks, chances are this tool will only help you to the point of your total bandwidth or server capacity for sending 403's. Without a solid infrastructure and DoS evasion plan in place, a heavy distributed DoS will most likely still take you offline. HOW TO INSTALL APACHE v1.3 ----------- Without DSO Support: 1. Extract this archive into src/modules in the Apache source tree 2. Run./configure --add-module=src/modules/dosevasive/mod_dosevasive.c 3. make, install 4. Restart Apache With DSO Support, Ensim, or CPanel: 1. $APACHE_ROOT/bin/apxs -iac mod_dosevasive.c 2. Restart Apache APACHE v2.0 ----------- 1. Extract this archive 2. Run $APACHE_ROOT/bin/apxs -i -a -c mod_dosevasive20.c - 12 -

3. The module will be built and installed into $APACHE_ROOT/modules, and loaded into your httpd.conf 4. Restart Apache CONFIGURATION mod_dosevasive has default options configured, but you may also add the following block to your httpd.conf: APACHE v1.3 ----------- DOSHashTableSize 3097 DOSPageCount 2 DOSSiteCount 50 DOSPageInterval 1 DOSSiteInterval 1 DOSBlockingPeriod 10 APACHE v2.0 ----------- DOSHashTableSize 3097 DOSPageCount 2 DOSSiteCount 50 DOSPageInterval 1 DOSSiteInterval 1 DOSBlockingPeriod 10 Optionally you can also add the following directives: DOSEmailNotify DOSSystemCommand you@yourdomain.com "su - someuser -c '/sbin/... %s...'" You will also need to add this line if you are building with dynamic support: APACHE v1.3 ----------- AddModule mod_dosevasive.c - 13 -

APACHE v2.0 ----------- LoadModule dosevasive20_module modules/mod_dosevasive20.so (This line is already added to your configuration by apxs) DOSHashTableSize ---------------- The hash table size defines the number of top-level nodes for each child's hash table. Increasing this number will provide faster performance by decreasing the number of iterations required to get to the record, but consume more memory for table space. You should increase this if you have a busy web server. The value you specify will automatically be tiered up to the next prime number in the primes list (see mod_dosevasive.c for a list of primes used). DOSPageCount ------------ This is the threshhold for the number of requests for the same page (or URI) per page interval. Once the threshhold for that interval has been exceeded, the IP address of the client will be added to the blocking list. DOSSiteCount ------------ This is the threshhold for the total number of requests for any object by the same client on the same listener per site interval. Once the threshhold for that interval has been exceeded, the IP address of the client will be added to the blocking list. DOSPageInterval --------------- The interval for the page count threshhold; defaults to 1 second intervals. DOSSiteInterval --------------- The interval for the site count threshhold; defaults to 1 second intervals. - 14 -

DOSBlockingPeriod ----------------- The blocking period is the amount of time (in seconds) that a client will be blocked for if they are added to the blocking list. During this time, all subsequent requests from the client will result in a 403 (Forbidden) and the timer being reset (e.g. another 10 seconds). Since the timer is reset for every subsequent request, it is not necessary to have a long blocking period; in the event of a DoS attack, this timer will keep getting reset. DOSEmailNotify -------------- If this value is set, an email will be sent to the address specified whenever an IP address becomes blacklisted. A locking mechanism using /tmp prevents continuous emails from being sent. NOTE: Be sure MAILER is set correctly in mod_dosevasive.c (or mod_dosevasive20.c). The default is "/bin/mail -t %s" where %s is used to denote the destination email address set in the configuration. If you are running on linux or some other operating system with a different type of mailer, you'll need to change this. DOSSystemCommand ---------------- If this value is set, the system command specified will be executed whenever an IP address becomes blacklisted. This is designed to enable system calls to ip filter or other tools. A locking mechanism using /tmp prevents continuous system calls. Use %s to denote the IP address of the blacklisted IP. WHITELISTING IP ADDRESSES As of version 1.8, IP addresses of trusted clients can be whitelisted to insure they are never denied. The purpose of whitelisting is to protect software, scripts, local searchbots, or other automated tools from being denied for requesting large amounts of data from the server. Whitelisting should *not* be used to add customer lists or anything of the sort, as this will open the server to abuse. This module is very difficult to trigger without performing some type of malicious attack, - 15 -

and for that reason it is more appropriate to allow the module to decide on its own whether or not an individual customer should be blocked. To whitelist an address (or range) add an entry to the Apache configuration in the following fashion: DOSWhitelist 127.0.0.1 DOSWhitelist 127.0.0.* Wildcards can be used on up to the last 3 octets if necessary. Multiple DOSWhitelist commands may be used in the configuration. TWEAKING APACHE The keep-alive settings for your children should be reasonable enough to keep each child up long enough to resist a DOS attack (or at least part of one). For every child that exits, another 5-10 copies of the page may get through before putting the attacker back into '403 Land'. With this said, you should have a very high MaxRequestsPerChild, but not unlimited as this will prevent cleanup. You'll want to have a MaxRequestsPerChild set to a non-zero value, as DosEvasive cleans up its internal hashes only on exit. The default MaxRequestsPerChild is usually 10000. This should suffice in only allowing a few requests per 10000 per child through in the event of an attack (although if you use DOSSystemCommand to firewall the IP address, a hole will no longer be open in between child cycles). TESTING Want to make sure it's working? Run test.pl, and view the response codes. If the target machine is not localhost, be sure to change it in the script first. You should receive 403 responses after the first 25-50 requests, depending on your server configuration. Please don't use this script to DoS others without their permission. KNOWN BUGS - This module appears to conflict with the Microsoft Frontpage Extensions - 16 -

FEEDBACK Please email me with questions, constructive comments, or feedback: jonathan@nuclearelephant.com. - 17 -