Serverprobleme... Kein Zugriff

Rund um die Sicherheit des Systems und die Applikationen
Post Reply
atrix
Posts: 25
Joined: 2006-11-21 21:23
Location: Bad Ems
 

Serverprobleme... Kein Zugriff

Post by atrix »

Hallo,

ich habe ein problem, seit einer Woche läuft mein Servernicht mehr, da er mit massig anfragen gleichzeitig niedergeflooded wird wohl...
# netstat -anpt|grep :"80"|wc -l
101
# netstat -anpt|grep :"80"
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 30496/httpd2-prefor
tcp 0 0 85.214.29.32:80 85.102.126.92:3910 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.103.212.166:12075 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.108.254.88:2379 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.200.144.201:3844 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.107.123.103:2525 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.232.105.243:2436 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.107.227.9:1279 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.229.9.160:12623 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.96.53.5:2942 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.224.148.30:3941 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.104.189.148:1465 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.224.200.141:3307 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.247.174.167:50176 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.107.68.210:1658 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.104.55.112:3059 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.240.226.53:3000 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.104.9.203:1321 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.104.60.230:3563 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.246.33.62:11356 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.108.64.234:1392 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.101.226.168:3894 SYN_RECV -
tcp 0 0 85.214.29.32:80 81.213.234.52:1332 SYN_RECV -
tcp 0 0 85.214.29.32:80 193.255.15.118:3352 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.240.226.53:2999 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.226.124.252:1336 SYN_RECV -
tcp 0 0 85.214.29.32:80 81.215.2.170:42878 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.229.9.160:12621 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.230.78.232:1805 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.200.144.201:3785 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.246.118.93:1194 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.229.89.12:23370 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.105.216.146:4302 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.108.228.86:22795 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.102.163.48:3363 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.241.212.47:1356 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.108.62.26:1831 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.230.40.108:1968 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.104.56.223:2549 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.101.43.31:3370 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.232.103.38:1260 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.102.126.92:4888 SYN_RECV -
tcp 0 0 85.214.29.32:80 81.215.2.170:41778 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.224.200.141:3592 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.243.12.158:3276 SYN_RECV -
tcp 0 0 85.214.29.32:80 212.175.112.190:36096 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.108.255.250:2659 SYN_RECV -
tcp 0 0 85.214.29.32:80 66.249.65.45:39326 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.247.10.200:1572 SYN_RECV -
tcp 0 0 85.214.29.32:80 81.213.217.114:2168 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.97.203.152:21146 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.241.202.65:1758 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.234.41.228:50433 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.107.68.210:1526 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.104.60.230:4531 SYN_RECV -
tcp 0 0 85.214.29.32:80 81.215.173.226:2844 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.99.198.134:3919 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.102.74.117:50699 SYN_RECV -
tcp 0 0 85.214.29.32:80 88.243.12.158:3479 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.105.209.13:23925 SYN_RECV -
tcp 0 0 85.214.29.32:80 85.100.159.178:1437 ESTABLISHED 20425/httpd2-prefor
tcp 285 0 85.214.29.32:80 88.229.189.38:29783 ESTABLISHED -
tcp 0 1748 85.214.29.32:80 85.102.74.117:50279 FIN_WAIT1 -
tcp 271 0 85.214.29.32:80 88.246.127.184:1487 ESTABLISHED -
tcp 0 0 85.214.29.32:80 217.20.215.114:3768 TIME_WAIT -
tcp 168 0 85.214.29.32:80 217.20.215.114:4259 ESTABLISHED -
tcp 0 0 85.214.29.32:80 88.230.65.118:1729 ESTABLISHED 20427/httpd2-prefor
tcp 0 0 85.214.29.32:80 194.27.186.39:40184 FIN_WAIT2 -
tcp 0 1748 85.214.29.32:80 85.102.74.117:50205 FIN_WAIT1 -
tcp 0 0 85.214.29.32:80 85.102.57.134:1652 FIN_WAIT2 -
tcp 0 0 85.214.29.32:80 217.20.215.114:4068 TIME_WAIT -
tcp 0 1 85.214.29.32:80 85.103.211.106:2180 FIN_WAIT1 -
tcp 0 0 85.214.29.32:80 212.175.112.131:55063 TIME_WAIT -
tcp 0 0 85.214.29.32:80 212.175.112.175:44336 TIME_WAIT -
tcp 0 0 85.214.29.32:80 81.214.119.112:3679 TIME_WAIT -
tcp 0 0 85.214.29.32:80 85.102.74.117:50121 ESTABLISHED 20423/httpd2-prefor
tcp 293 0 85.214.29.32:80 88.240.200.23:3249 ESTABLISHED -
tcp 0 1 85.214.29.32:80 81.213.196.217:2245 FIN_WAIT1 -
tcp 327 0 85.214.29.32:80 85.100.194.145:4361 ESTABLISHED -
tcp 442 0 85.214.29.32:80 212.175.112.187:56924 ESTABLISHED -
tcp 0 0 85.214.29.32:80 85.97.203.152:21253 ESTABLISHED 20431/httpd2-prefor
tcp 0 0 85.214.29.32:80 85.102.163.48:3366 ESTABLISHED 20506/httpd2-prefor
tcp 0 0 85.214.29.32:80 88.234.8.23:1059 ESTABLISHED 20428/httpd2-prefor
tcp 0 0 85.214.29.32:80 85.104.60.230:4175 TIME_WAIT -
tcp 0 1 85.214.29.32:80 88.240.10.26:50405 FIN_WAIT1 -
tcp 0 0 85.214.29.32:80 85.98.219.61:29590 ESTABLISHED -
tcp 0 0 85.214.29.32:80 88.240.129.35:2629 ESTABLISHED 20429/httpd2-prefor
tcp 0 1734 85.214.29.32:80 88.246.121.183:50852 FIN_WAIT1 -
tcp 294 0 85.214.29.32:80 88.247.40.22:1418 ESTABLISHED -
tcp 0 1750 85.214.29.32:80 85.102.126.92:4357 FIN_WAIT1 -
tcp 0 1590 85.214.29.32:80 88.232.105.243:1738 CLOSING -
tcp 0 0 85.214.29.32:80 212.175.112.156:37367 TIME_WAIT -
tcp 0 1734 85.214.29.32:80 88.224.148.30:3130 FIN_WAIT1 -
tcp 0 0 85.214.29.32:80 88.243.12.158:3275 TIME_WAIT -
tcp 0 0 85.214.29.32:80 88.230.15.137:16577 FIN_WAIT2 -
tcp 0 0 85.214.29.32:80 212.175.112.188:59440 TIME_WAIT -
tcp 0 0 85.214.29.32:80 84.60.1.65:10702 ESTABLISHED 20424/httpd2-prefor
tcp 443 0 85.214.29.32:80 212.175.112.142:32786 ESTABLISHED -
tcp 0 0 85.214.29.32:80 84.4.165.133:1883 TIME_WAIT -
tcp 0 0 85.214.29.32:80 81.215.2.170:42515 TIME_WAIT -
tcp 0 0 85.214.29.32:80 88.230.40.108:2102 ESTABLISHED 20426/httpd2-prefor
tcp 0 0 85.214.29.32:80 85.108.15.189:1473 ESTABLISHED 20430/httpd2-prefor
tcp 275 0 85.214.29.32:80 88.247.48.216:4870 ESTABLISHED -
tcp 377 0 85.214.29.32:80 81.215.2.170:43123 ESTABLISHED -
tcp 0 1734 85.214.29.32:80 88.247.32.172:1400 FIN_WAIT1 -
tcp 0 1748 85.214.29.32:80 88.225.113.73:27416 LAST_ACK -
kann man da was gegen machen? Die Domains können nicht aufgerufen werden...
Wenn ich den Server (Apache2) runterfahre gehen die Anfragen gen 0, starte ich ihn wieder, sind die direkt wieder auf 100 (Meiner Max Zahl in der Config...)
Steiger ich die Zahl in der Config, gehen diese auch hoch...
Dadurch funktioniert gar nichts...
Hab jetzt Portsentry installiert, hilft nur iwie nich...
Strato will nicht helfen... Sagen die können nix machen da es mein problem sei...
Server wurde aber neu installiert und funktiert auch genauso im neuzustand nicht...
Roger Wilco
Posts: 5923
Joined: 2004-05-23 12:53
 

Re: Serverprobleme... Kein Zugriff

Post by Roger Wilco »

Deaktiviere KeepAlive und füttere $SUCHMASCHINE mal mit "SYN Flood"
atrix
Posts: 25
Joined: 2006-11-21 21:23
Location: Bad Ems
 

Re: Serverprobleme... Kein Zugriff

Post by atrix »

KeepAlive ist deaktiviert... hilft nicht viel, aber minimal...

Jetzt will ich SynCookies aktivieren:

# echo 1 > /proc/sys/net/ipv4/tcp_syncookies
-bash: /proc/sys/net/ipv4/tcp_syncookies: Permission denied

Kommt mir auf meinem Server der Betroffen ist



Auf meinem Anderen der Fehlerfrei läuft kommt:

# echo 1 > /proc/sys/net/ipv4/tcp_syncookies
-bash: /proc/sys/net/ipv4/tcp_syncookies: Die Operation ist nicht erlaubt
Roger Wilco
Posts: 5923
Joined: 2004-05-23 12:53
 

Re: Serverprobleme... Kein Zugriff

Post by Roger Wilco »

Für SYN Cookies muss die Unterstützung im Kernel (CONFIG_SYNCOOKIES) vorhanden sein und das Kommando (bzw. entsprechender Aufruf von sysctl) als root ausgeführt werden. Damit die Änderung persistent ist, kannst du die Werte in /etc/sysctl.conf eintragen.
atrix
Posts: 25
Joined: 2006-11-21 21:23
Location: Bad Ems
 

Re: Serverprobleme... Kein Zugriff

Post by atrix »

und das heißt nochmal auf Deutsch? XD

Also wenn du es mir mit Befehlen oder so sagst, versteh ichs einfacher... Bin da nicht so profi auf dem Gebiet...
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
Contact:
 

Re: Serverprobleme... Kein Zugriff

Post by daemotron »

Code: Select all

gunzip -c /proc/config.gz | grep CONFIG_SYN_COOKIES
Entweder es kommt dann sowas:

Code: Select all

CONFIG_SYN_COOKIES=y
oder sowas:

Code: Select all

# CONFIG_SYN_COOKIES is not set
Damit weißt Du dann schon mal, ob Dein Kernel überhaupt Syncookies unterstützt...
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: Serverprobleme... Kein Zugriff

Post by Joe User »

The useless use of pipe ;)

Code: Select all

zgrep CONFIG_SYN_COOKIES /proc/config.gz
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
codc
Posts: 97
Joined: 2004-01-08 02:55
Location: Tübingen
Contact:
 

Re: Serverprobleme... Kein Zugriff

Post by codc »

Joe User wrote:The useless use of pipe ;)

Code: Select all

zgrep CONFIG_SYN_COOKIES /proc/config.gz
Was solls - ich benutze auch gerne (obwohl nicht maß aller Dinge) pipes weil es die Lesbarkeit unglaublich erhöht und die Performance nicht besonders beeinträchtigt afaik.

Ich mag nun mal keine Shell-Akrobatik und Code bei denen man erst mal pro Zeile 10 Minuten man-pages lesen muss um sie zu verstehen.

Ich schreibe auch immer cat /blah/blub | grep foo obwohl ich weiss dass es mit grep alleine geht - in Shellscripten aber ich finde es einfach lesbarer für andere. *persönliche Meinung*
elch_mg
Posts: 302
Joined: 2006-01-23 19:14
Location: 41063
Contact:
 

Re: Serverprobleme... Kein Zugriff

Post by elch_mg »

Ich finds unlesbarer *SCNR* ;)
atrix
Posts: 25
Joined: 2006-11-21 21:23
Location: Bad Ems
 

Re: Serverprobleme... Kein Zugriff

Post by atrix »

# zgrep CONFIG_SYN_COOKIES /proc/config.gz
gzip: /proc/config.gz: No such file or directory
elch_mg
Posts: 302
Joined: 2006-01-23 19:14
Location: 41063
Contact:
 

Re: Serverprobleme... Kein Zugriff

Post by elch_mg »

Code: Select all

zgrep CONFIG_SYN_COOKIES /boot/config-`uname -r`
?
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: Serverprobleme... Kein Zugriff

Post by Joe User »

elch_mg wrote:

Code: Select all

zgrep CONFIG_SYN_COOKIES /boot/config-`uname -r`
Welcher Distributor patched den Kernel denn an dieser Stelle?

Wenn /proc/config.gz nicht existiert, fehlt dem Kernel diese Option und der OP muss seine Kernelconfig greppen:

Code: Select all

grep CONFIG_SYN_COOKIES /path/to/kernelconfig
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
elch_mg
Posts: 302
Joined: 2006-01-23 19:14
Location: 41063
Contact:
 

Re: Serverprobleme... Kein Zugriff

Post by elch_mg »

Joe User wrote:Welcher Distributor patched den Kernel denn an dieser Stelle?
patchen niemand, aber bei den Debian-Derivaten die ich bisher in den Fingern hatte, lag an diesem Ort auch immer die config des Kernels - zusammen mit kernelimage sowie evtl. initrd. und System.map.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: Serverprobleme... Kein Zugriff

Post by Joe User »

Oops, verlesen, sorry :oops:
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
spasswolf
Posts: 27
Joined: 2006-06-09 11:00
 

Re: Serverprobleme... Kein Zugriff

Post by spasswolf »

Ich meine Debian Standardkernel haben keine /proc/config.gz, dafür liegt da die config in /boot als config-`uname -r`.

...zuspät
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
Contact:
 

Re: Serverprobleme... Kein Zugriff

Post by daemotron »

Trotzdem wäre dann ein "grep" sinnvoller als ein "zgrep" - oder packt Debian die configs etwa auch noch? :D
captaincrunch
Userprojekt
Userprojekt
Posts: 7066
Joined: 2002-10-09 14:30
Location: Dorsten
Contact:
 

Re: Serverprobleme... Kein Zugriff

Post by captaincrunch »

zgrep handhabt auch ungepackte Files. ;)
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
Post Reply