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 리눅스 보안 - 권한설정에 주의해야할 명령어들은 ? l2zeo 2010.03.31 27750
67 안티 루트킷 사용 예 l2zeo 2010.03.28 11579
66 리눅스 - iptables NAT rule ADMINPLAY 2010.03.24 9672
65 Cisco/Tip/라우터,스위치에서 패킷 캡쳐하기 file l2zeo 2010.03.23 16132
64 해킹이 의심될 때 사용되는 명령어들 l2zeo 2010.03.08 9868
63 iptables 리눅스? NETFILTER관련 1 l2zeo 2010.03.08 10130
62 LINUX 해킹당했을 때 대처요령 l2zeo 2010.03.08 8734
61 파일 퍼미션 설정을 통한 로컬 공격 방지 l2zeo 2010.03.08 8172
60 SSH 공격막아내기 방법 l2zeo 2010.03.08 8394
59 Tcpdump 용어 정리 ADMINPLAY 2010.01.30 8509
58 홈페이지 보안 강화 도구(CASTLE) 보급 안내 1 file ADMINPLAY 2010.01.22 8929
57 Kernel 2.4.23 버전 이하에 나온 ptrace 버그에 관한 사항 ADMINPLAY 2009.12.13 8800
56 lsof 활용 가이드 ADMINPLAY 2009.11.30 8316
55 실전 테스트!! 스니퍼 공격 ADMINPLAY 2009.11.30 9774
54 해외에서 접근하는 IP 차단하기 ADMINPLAY 2009.11.30 9262
53 iptables 옵션 및 상태 추적 테이블 및 rule ADMINPLAY 2009.11.30 8854
52 ossec 로그 분석 툴 설치 ADMINPLAY 2009.10.20 11530
51 SSH(Security SHell) 보안쉘 ADMINPLAY 2009.10.20 8407
50 홈페이지 변조 대처법 (FTP 계정을 이용한 아이프레임 코... ADMINPLAY 2009.10.15 9047
49 iframe 이용한 악성코드 삽입, 홈페이지 변조 사고 대비 ... ADMINPLAY 2009.10.15 10809
Board Pagination Prev 1 2 3 4 5 Next
/ 5

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234