Skip to content

조회 수 9204 추천 수 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


  1. No Image 28May
    by ADMINPLAY
    2009/05/28 by ADMINPLAY
    Views 9283 

    iptables 명령어로 ip 차단 법.

  2. No Image 30Nov
    by ADMINPLAY
    2009/11/30 by ADMINPLAY
    Views 9258 

    해외에서 접근하는 IP 차단하기

  3. No Image 25Nov
    by ADMIN
    2008/11/25 by ADMIN
    Views 9253 

    웹취약점 점검

  4. No Image 28May
    by ADMINPLAY
    2009/05/28 by ADMINPLAY
    Views 9204 

    iptables/sysctl을 이용하여 DDOS SYN 공격 방어하기

  5. rootkit 검색 프로그램 rkhunter-1.2.9.tar.gz

  6. No Image 04Jun
    by ADMINPLAY
    2009/06/04 by ADMINPLAY
    Views 9088 

    리눅스용 백신 AVG

  7. No Image 15Oct
    by ADMINPLAY
    2009/10/15 by ADMINPLAY
    Views 9043 

    홈페이지 변조 대처법 (FTP 계정을 이용한 아이프레임 코드 삽입)

  8. No Image 22May
    by ADMINPLAY
    2009/05/22 by ADMINPLAY
    Views 8941 

    간단한 보안 설정 (TCP Wrapper)

  9. 홈페이지 보안 강화 도구(CASTLE) 보급 안내

  10. No Image 28May
    by ADMINPLAY
    2009/05/28 by ADMINPLAY
    Views 8854 

    iptables 설정, centos64 설치 간단셋팅

  11. No Image 30Nov
    by ADMINPLAY
    2009/11/30 by ADMINPLAY
    Views 8851 

    iptables 옵션 및 상태 추적 테이블 및 rule

  12. No Image 13Dec
    by ADMINPLAY
    2009/12/13 by ADMINPLAY
    Views 8797 

    Kernel 2.4.23 버전 이하에 나온 ptrace 버그에 관한 사항

  13. No Image 28May
    by ADMINPLAY
    2009/05/28 by ADMINPLAY
    Views 8786 

    서버의 iptable 보안설정 일부분

  14. No Image 08Sep
    by ADMINPLAY
    2009/09/08 by ADMINPLAY
    Views 8772 

    시스템 로그를 메일로 - logcheck

  15. No Image 08Mar
    by l2zeo
    2010/03/08 by l2zeo
    Views 8731 

    LINUX 해킹당했을 때 대처요령

  16. No Image 04Jun
    by ADMINPLAY
    2009/06/04 by ADMINPLAY
    Views 8731 

    pam_abl 을 통한 SSH 무작위 공격 방어

  17. No Image 11Nov
    by ADMIN
    2008/11/11 by ADMIN
    Views 8542 

    ZONE-H.KR

  18. No Image 30Jan
    by ADMINPLAY
    2010/01/30 by ADMINPLAY
    Views 8505 

    Tcpdump 용어 정리

  19. No Image 20Oct
    by ADMINPLAY
    2009/10/20 by ADMINPLAY
    Views 8404 

    SSH(Security SHell) 보안쉘

  20. No Image 08Mar
    by l2zeo
    2010/03/08 by l2zeo
    Views 8391 

    SSH 공격막아내기 방법

Board Pagination Prev 1 2 3 4 5 Next
/ 5

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234