免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 3224 | 回复: 12
打印 上一主题 下一主题

rh9服务器,如何防止简单的dos攻击 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-07-19 16:35 |只看该作者 |倒序浏览
敌人估计有30个左右,不停的连接我得某个端口,连接进来后就在那里等待超时,不作任何动作,导致不少正常连接无法访问。请问我应改怎么办

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
2 [报告]
发表于 2004-07-19 17:07 |只看该作者

rh9服务器,如何防止简单的dos攻击

暂时先封IP?

这端口有用吗?没用关闭

限制连接数,连接次数,连接超时时间

看看系统有什么漏洞没

论坛徽章:
0
3 [报告]
发表于 2004-07-19 21:53 |只看该作者

rh9服务器,如何防止简单的dos攻击

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

http://www.chinaunix.net/jh/4/335692.html
http://bbs.chinaunix.net/forum/viewtopic.php?t=23116

论坛徽章:
0
4 [报告]
发表于 2004-07-19 22:02 |只看该作者

rh9服务器,如何防止简单的dos攻击

这个端口肯定是有用的,不能封,

封锁ip也不现实,敌人会不断的变换自己的ip,估计不少用户是adsl

至于楼上的作法,我也不知道有没有用,敌人是通过正常的conect到我的服务器,只不过这个connect比较特殊罢了,也就是说不属于半打开之类的攻击

还有各位兄弟回复的时候,麻烦稍微详细一点,谢谢。

论坛徽章:
0
5 [报告]
发表于 2004-07-19 22:11 |只看该作者

rh9服务器,如何防止简单的dos攻击

这个问题好象是讨论过了,结论上没有办法。

论坛徽章:
0
6 [报告]
发表于 2004-07-20 12:04 |只看该作者

rh9服务器,如何防止简单的dos攻击

购买硬件的防DDOS攻击产品

论坛徽章:
0
7 [报告]
发表于 2004-07-20 13:47 |只看该作者

rh9服务器,如何防止简单的dos攻击

我知道可以用iptable来限制相同ip同一时间的连接个数,可是需要编译内核,但是我不想这么麻烦。

论坛徽章:
0
8 [报告]
发表于 2004-07-20 18:40 |只看该作者

rh9服务器,如何防止简单的dos攻击

不用重新编译内核,直接用就行

论坛徽章:
0
9 [报告]
发表于 2004-07-23 09:48 |只看该作者

rh9服务器,如何防止简单的dos攻击

看看www.lartc.org,其中的15.2,15.3节。

我摘下来吧,希望有帮助。

15.2. Protecting your host from SYN floods

From Alexey's iproute documentation, adapted to netfilter and with more plausible paths. If you use this, take care to adjust the numbers to reasonable values for your system.

If you want to protect an entire network, skip this script, which is best suited for a single host.

It appears that you need the very latest version of the iproute2 tools to get this to work with 2.4.0.

#! /bin/sh -x
#
# sample script on using the ingress capabilities
# this script shows how one can rate limit incoming SYNs
# Useful for TCP-SYN attack protection. You can use
# IPchains to have more powerful additions to the SYN (eg
# in addition the subnet)
#
#path to various utilities;
#change to reflect yours.
#
TC=/sbin/tc
IP=/sbin/ip
IPTABLES=/sbin/iptables
INDEV=eth2
#
# tag all incoming SYN packets through $INDEV as mark value 1
############################################################
$iptables -A PREROUTING -i $INDEV -t mangle -p tcp --syn \
  -j MARK --set-mark 1
############################################################
#
# install the ingress qdisc on the ingress interface
############################################################
$TC qdisc add dev $INDEV handle ffff: ingress
############################################################

#
#
# SYN packets are 40 bytes (320 bits) so three SYNs equals
# 960 bits (approximately 1kbit); so we rate limit below
# the incoming SYNs to 3/sec (not very useful really; but
#serves to show the point - JHS
############################################################
$TC filter add dev $INDEV parent ffff: protocol ip prio 50 handle 1 fw \
police rate 1kbit burst 40 mtu 9k drop flowid :1
############################################################


#
echo "---- qdisc parameters Ingress  ----------"
$TC qdisc ls dev $INDEV
echo "---- Class parameters Ingress  ----------"
$TC class ls dev $INDEV
echo "---- filter parameters Ingress ----------"
$TC filter ls dev $INDEV parent ffff:

#deleting the ingress qdisc
#$TC qdisc del $INDEV ingress

15.3. Rate limit ICMP to prevent dDoS

Recently, distributed denial of service attacks have become a major nuisance on the Internet. By properly filtering and rate limiting your network, you can both prevent becoming a casualty or the cause of these attacks.

You should filter your networks so that you do not allow non-local IP source addressed packets to leave your network. This stops people from anonymously sending junk to the Internet.

Rate limiting goes much as shown earlier. To refresh your memory, our ASCIIgram again:

[The Internet] ---<E3, T3, whatever>;--- [Linux router] --- [Office+ISP]
                                      eth1          eth0

We first set up the prerequisite parts:

# tc qdisc add dev eth0 root handle 10: cbq bandwidth 10Mbit avpkt 1000
# tc class add dev eth0 parent 10:0 classid 10:1 cbq bandwidth 10Mbit rate \
  10Mbit allot 1514 prio 5 maxburst 20 avpkt 1000

If you have 100Mbit, or more, interfaces, adjust these numbers. Now you need to determine how much ICMP traffic you want to allow. You can perform measurements with tcpdump, by having it write to a file for a while, and seeing how much ICMP passes your network. Do not forget to raise the snapshot length!

If measurement is impractical, you might want to choose 5% of your available bandwidth. Let's set up our class:

# tc class add dev eth0 parent 10:1 classid 10:100 cbq bandwidth 10Mbit rate \
  100Kbit allot 1514 weight 800Kbit prio 5 maxburst 20 avpkt 250 \
  bounded

This limits at 100Kbit. Now we need a filter to assign ICMP traffic to this class:

# tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip
  protocol 1 0xFF flowid 10:100

论坛徽章:
0
10 [报告]
发表于 2004-07-25 20:10 |只看该作者

rh9服务器,如何防止简单的dos攻击

编译一下,不是很麻烦的。 用 connlimit. 应该可以解决。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP