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
번호 제목 글쓴이 날짜 조회 수
68 Cisco/Tip/라우터,스위치에서 패킷 캡쳐하기 file l2zeo 2010.03.23 16132
67 Portsentry 1.1 설치하기 2 file ADMINPLAY 2012.01.16 15113
66 리눅스서버에서 ping(ICMP) 열기/닫기 ADMINPLAY 2009.08.18 14838
65 접속 로그파일 보기(wtmp) ADMINPLAY 2009.05.11 13883
64 SYN Flooding공격에 대한 대비 ADMINPLAY 2009.09.24 12967
63 최신 버전으로 구축하는 웹 파이어월, modsecurity file ADMINPLAY 2009.03.17 12856
62 SQL 인젝션(injection) 프로그램 15종 ADMINPLAY 2009.05.22 12542
61 DDOS - iptables 방화벽 초간단 문서 ADMINPLAY 2009.05.28 12305
60 SQL Injection tools 15종 ADMINPLAY 2009.09.25 12287
59 iptables 포트 포워딩 ADMINPLAY 2009.06.04 12040
58 기본 tcpdump사용법 ADMINPLAY 2009.05.22 11700
57 안티 루트킷 사용 예 l2zeo 2010.03.28 11577
56 ossec 로그 분석 툴 설치 ADMINPLAY 2009.10.20 11530
55 Tcpdump 사용법 ADMINPLAY 2009.06.06 11159
54 fcheck - 리눅스 시스템 무결성 검사 툴 ADMIN 2008.12.14 11030
53 보안서버 구축시 openssl/modssl/apache 버전 호환성 ADMIN 2008.12.14 10904
52 iframe 이용한 악성코드 삽입, 홈페이지 변조 사고 대비 ... ADMINPLAY 2009.10.15 10809
51 Apache 에 ModSecurity 모듈 설치하기 ADMINPLAY 2009.08.03 10542
50 리눅스 아이피 차단 해제 ADMINPLAY 2009.03.11 10542
49 보안서버구축 - SSL(설치 및 키생성) 1 ADMIN 2009.01.04 10467
Board Pagination Prev 1 2 3 4 5 Next
/ 5

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234