Skip to content

조회 수 9207 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

Check whether it shows lot of SYN_WAIT / TIME_WAIT / FIN_WAIT. If yes its due to the high number of connections. You can reduce these by adding some rules to the Iptables.

# iptables -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
# iptables -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
# iptables -A INPUT -p tcp --tcp-flags FIN,RST FIN,RST -j DROP
# iptables -A INPUT -p tcp --tcp-flags ACK,FIN FIN -j DROP

# service iptables save
# service iptables restart

Adding rules to sysctl.conf

Also you can reduce these by adding some rules to sysctl.conf, the details given below.

# echo 1 > /proc/sys/net/ipv4/tcp_syncookies

Put following in /etc/sysctl.conf

# Enable TCP SYN cookie protection
net.ipv4.tcp_syncookies = 1

# Decrease the time default value for tcp_fin_timeout connection
net.ipv4.tcp_fin_timeout = 30

# Turn off the tcp_window_scaling
net.ipv4.tcp_window_scaling = 0

# Turn off the tcp_sack
net.ipv4.tcp_sack = 0


Then execute the command :

A quick and usefull command for checking if a server is under ddos is:

# netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

Reference : http://linuxhow2.net/?p=9


# Set default policies
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -P FORWARD DROP
/sbin/iptables -F
/sbin/iptables -F INPUT
/sbin/iptables -F OUTPUT
/sbin/iptables -F FORWARD
/sbin/iptables -F -t mangle
/sbin/iptables -X
/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A INPUT -d 127.0.0.0/8 -j REJECT
/sbin/iptables -A INPUT -i eth0 -j ACCEPT
/sbin/iptables -A INPUT -m state --state INVALID -j DROP
### chains to DROP too many SYN-s ######
/sbin/iptables -N syn-flood
/sbin/iptables -A syn-flood -m limit --limit 100/second --limit-burst 150 -j RETURN
/sbin/iptables -A syn-flood -j LOG --log-prefix "SYN flood: "
/sbin/iptables -A syn-flood -j DROP

Reference : http://www.webhostingtalk.com/archive/index.php/t-355411.html


List of Articles
번호 제목 글쓴이 날짜 조회 수
88 /etc/passwd 구조 l2zeo 2010.03.31 34932
87 리눅스용 각종 보안도구 사이트모음 ADMINPLAY 2009.07.12 33717
86 매직키를 이용한 응급복구법 l2zeo 2010.03.31 32096
85 리눅스 보안 - 권한설정에 주의해야할 명령어들은 ? l2zeo 2010.03.31 27748
84 [적용] iptables 접속 차단 스크립트 ADMINPLAY 2010.05.03 25687
83 Modsecurity 무료 웹방화벽 설치 file ADMINPLAY 2010.09.12 24063
82 denyhosts (ssh, ftp 등의 접근 차단) ADMINPLAY 2010.05.03 21373
81 Modsecurity-apache 2.5.X 설치중 에러 server: /usr/lib/... ADMINPLAY 2010.09.12 21300
80 modsecurity-2.5 configure: *** apr library not found. ADMINPLAY 2010.09.12 21146
79 php 수호신 설치 ADMINPLAY 2010.05.03 20838
78 php.ini 보안 설정 ADMINPLAY 2010.05.03 20387
77 PHP 보안관련 설정 권고사항 ADMINPLAY 2010.05.19 20222
76 해킹 당했는지 알아보는 방법 ADMINPLAY 2010.05.03 19992
75 iptables와 mod_security 연동을 통한 ip 차단 file ADMINPLAY 2010.09.15 19777
74 iptables를 이용한 SSH brute force 공격방어 l2zeo 2010.05.29 19701
73 Modsecurity-apache 2.5.12 file ADMINPLAY 2010.09.12 18721
72 리눅스 해킹점검 가이드 ADMIN 2008.12.10 18241
71 웹어플리케이션 보안 ADMINPLAY 2010.05.03 17163
70 보안 체킹 프로그램 - portsentry file ADMINPLAY 2010.04.27 16180
69 [그누보드관련] $_POST 는 이미 오염된(?) 변수다. ADMINPLAY 2010.11.18 16139
Board Pagination Prev 1 2 3 4 5 Next
/ 5

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234