免费注册 查看新帖 |

Chinaunix

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

讨论iptables RECENT的用法..及能否减缓DDOS,SYN的攻击..... [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-07-18 20:58 |只看该作者 |倒序浏览
这样的模块能不能减缓DDOS.,SYN等主动连接的攻击呢>????
只能用减缓这个词...毕竟如果对的流量大于你的带宽了...什么也是没有办法的...

希望大家一起讨论........


recent
Allows you to dynamically create a list of IP addresses and then match against that list in a few different ways.

For example, you can create a "badguy" list out of people attempting to connect to port 139 on your firewall and then DROP all future packets from them without considering them.

--set, --rcheck, --update and --remove are mutually exclusive.

--name name

Specify the list to use for the commands. If no name is given then DEFAULT will be used.

[!] --set

This will add the source address of the packet to the list. If the source address is already in the list, this will update the existing entry. This will always return success (or failure if ! is passed in).

--rsource

Match/save the source address of each packet in the recent list table. This is the default.

--rdest

Match/save the destination address of each packet in the recent list table.

[!] --rcheck

Check if the source address of the packet is currently in the list.

[!] --update

Like --rcheck, except it will update the "last seen" timestamp if it matches.

[!] --remove

Check if the source address of the packet is currently in the list and if so that address will be removed from the list and the rule will return true. If the address is not found, false is returned.

--seconds seconds

This option must be used in conjunction with one of --rcheck or --update. When used, this will narrow the match to only happen when the address is in the list and was seen within the last given number of seconds.

--hitcount hits

This option must be used in conjunction with one of --rcheck or --update. When used, this will narrow the match to only happen when the address is in the list and packets had been received greater than or equal to the given value. This option may be used along with --seconds to create an even narrower match requiring a certain number of hits within a specific time frame. The maximum value for the hitcount parameter is given by the "ip_pkt_list_tot" parameter of the xt_recent kernel module. Exceeding this value on the command line will cause the rule to be rejected.

--rttl

This option may only be used in conjunction with one of --rcheck or --update. When used, this will narrow the match to only happen when the address is in the list and the TTL of the current packet matches that of the packet which hit the --set rule. This may be useful if you have problems with people faking their source address in order to DoS you via this module by disallowing others access to your site by sending bogus packets to you.

Examples:

iptables -A FORWARD -m recent --name badguy --rcheck --seconds 60 -j DROP

iptables -A FORWARD -p tcp -i eth0 --dport 139 -m recent --name badguy --set -j DROP

论坛徽章:
0
2 [报告]
发表于 2010-07-18 22:00 |只看该作者

论坛徽章:
0
3 [报告]
发表于 2010-07-19 12:49 |只看该作者
上面的建议我觉得应该是不合理的...--limit  1/s这样的限制是所有的连接都被限制了..


用RECNET可以限制每个发起连接IP在规定时间内的访问次数..就才能保证正常的使用和攻击时的抗攻击性..

论坛徽章:
0
4 [报告]
发表于 2010-07-22 22:42 |只看该作者
但是大部分SYN Flood攻击包源地址都是伪造的,甚至每个SYN包伪造的源地址都不一样,因为攻击端根本就没想收到SYN/ACK包。但是我也不赞同--limit  1/s规则,使用recent效果也不好。只要用IPv4,想对抗SYN Flood攻击,只能用更快的CPU,更大的内存,更高的网络带宽,然后开SYN Cookie,减少超时时间,加大队列,只能提高攻击者的成本,毕竟租肉鸡也是要花钱的。

论坛徽章:
0
5 [报告]
发表于 2010-08-12 08:28 |只看该作者
非常不赞同--limit  1/s规则
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP