【问题标题】:Using iptables, how to limit connections for IP range and browser's string?使用 iptables,如何限制 IP 范围和浏览器字符串的连接?
【发布时间】:2019-02-21 23:34:15
【问题描述】:

每天一次,以下 IP 范围每秒发送多个请求。在攻击过程中使用了一个奇怪的浏览器,如下所述:

IP Range: 192.168.1.100-192.168.1.200
Port: 80 (Apache web server)   
Browser Name: X11: Crawler

在其他时候,我收到来自提到的 IP 愤怒的合法流量(使用其他浏览器)。因此,我无法完全阻止此 IP 范围。

我想将聚合连接数(仅限上述 IP 范围)限制为 15/分钟。下面的 iptable 规则正确吗?

iptables -A INPUT -p tcp --syn  --dport 80    
-m string    --algo bm --string "X11: Crawler"  \    
-m iprange   --src-range 192.168.1.100-192.168.1.200  \    
-m connlimit --connlimit-above 15/minute --connlimit-mask 32  \    
-j REJECT --reject-with tcp-reset 

【问题讨论】:

    标签: linux iptables web-application-firewall


    【解决方案1】:

    我认为这行得通

    iptables -A INPUT -p tcp --destination-port 80 -m iprange --src-range 192.168.1.100-192.168.1.200 -j ACCEPT

    如果您想禁止 IP 范围,请使用 DROP 更改接受

    【讨论】:

    • 我认为我们都需要更多地学习和了解这个话题。
    猜你喜欢
    • 2012-09-25
    • 2015-02-18
    • 1970-01-01
    • 2021-02-24
    • 2014-12-13
    • 2020-04-13
    • 2016-08-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多