Page 1 of 1

Flood auf Port 80

Posted: 2006-12-23 14:25
by a-n
Hallo,

seid einigen Tagen floodet jemand meinen HTTP Port mit vielen kleinen Paketen. Es ist kein GET DoS sondern ein TCP SYN Flood mit kaum Bandbreite.

Code: Select all

14:00:36.848992 00:15:17:0b:8b:ca > 00:16:17:a7:28:bc, ethertype IPv4 (0x0800), length 60: 221.125.18.106.1324 > xx.xx.xxx.xxx.80: R 1984553407:1984553407(0) win 0
14:00:36.849502 00:15:17:0b:8b:ca > 00:16:17:a7:28:bc, ethertype IPv4 (0x0800), length 78: 211.237.240.143.35768 > xx.xxx.xx.xxx.80: S 1255860340:1255860340(0) win 53760 <mss 1460,nop,wscale 3,nop,nop,timestamp 0 0,nop,nop,sackOK>
14:00:36.849512 00:16:17:a7:28:bc > 00:15:17:0b:8b:ca, ethertype IPv4 (0x0800), length 66: xx.xx.xxx.xxx.80 > 211.237.240.143.35768: S 1430541560:1430541560(0) ack 1255860341 win 5840 <mss 1460,nop,nop,sackOK,nop,wscale 5>
Es sind ca. 3000 pps mit 600 - 800 kbit/s Bandbreite auf dem port 80, welcher der Apache (Apache2.2.3) nicht verkraftet und somit nicht zu erreichen ist. Alle andere Dienste (SSH, SMTP, IMAP etc ..) sind wunderbar zu erreichen.

Ich habe schon versucht die IPs via iptables zu droppen, allerdings sind es soviele IPs das ich nicht hinterher komme, und somit nicht weiß ob man erfolg mit dem droppen der IP hat oder nicht.

Wie folgt ist mein Apache konfiguriert:

Code: Select all

Timeout 5

KeepAlive Off

MaxKeepAliveRequests 0
KeepAliveTimeout 15

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    ServerLimit          5000
    MaxClients           2560
    MaxRequestsPerChild   0
</IfModule>

<IfModule mpm_worker_module>
    StartServers          2
    MaxClients          200000
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    MaxRequestsPerChild   0
</IfModule>
...
mod_dosevasive und was es da noch alles gibt, wird in diesem Fall nicht helfen, da nur die IP gefloodet wird und nicht die Domain. Ergo es gibt keine Apache Logauszüge die solche Software auswerten könnte.

Würde mich über ein Tipp freuen.

Vielen Dank!

Hier noch kleine graphen bzgl. der Bandbreite und der geöffneten TCP Verbindungen.

http://img184.imageshack.us/img184/2559 ... aphmy8.png

Re: Flood auf Port 80

Posted: 2006-12-23 16:45
by captaincrunch
Hast du die SYN-Cookies mal im Kernel aktiviert?

Re: Flood auf Port 80

Posted: 2006-12-23 16:58
by a-n

Code: Select all

cat /boot/config-2.6.19.1-grsec | grep SYN
CONFIG_SYN_COOKIES=y
Jepp.

Re: Flood auf Port 80

Posted: 2006-12-24 10:21
by captaincrunch
Du hast uns zwar gezeigt, dass dein Kernel die Option unterstützt, jedoch nicht, ob due sie auch (z.B. via sysctl) aktiviert hast.

Re: Flood auf Port 80

Posted: 2006-12-24 11:37
by a-n
Hi,

ja ist auch aktiviert, ich dachte das wäre jetzt nicht auch noch nötig zu sagen.

Folgendes ist ebenfalls bei mir aktiviert bzw. deaktiviert:

Code: Select all

net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.forwarding = 0
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.accept_source_route = 0