Fail2ban不能在Ubuntu上运行

我注意到一大堆的请求来到我的Ubuntu 12.04服务器,所以我安装了fail2ban。 我按照这些说明设置了Fail2ban对w00tw00t的请求。 我确保正确命名这些文件,并在更改configuration后重新启动fail2ban。

我通过在URL中input各种w00tw00t参数来进行testing,就像攻击者一样,但是没有人会禁止我。 我没有将我的IP添加到忽略列表。 我甚至试过从我的手机上,仍然没有禁令。

在jail.conf中我有以下位于/etc/fail2ban/jail.conf

 [w00tw00t-scans] enabled = true action = iptables-allports sendmail-whois[name=SSH, dest=ubuntu, [email protected]] filter = w00tw00t logpath = /var/log/apache2/access.log maxretry = 1 bantime = 120 #testing so that I can verify and not be banned for a day! 

这里是位于/etc/fail2ban/filter.d/w00tw00t.conf中的w00tw00tfilter

 #block w00tw00t scans of all variations [Definition] failregex = ^<HOST> .*”GET \/w00tw00t* ignoreregex = 

我通过在我的URL中input了一个不明确的参数来validation日志path是否正确设置,然后检查access.log并确定它在那里。 之后我也确定重新启动fail2ban,我添加了规则。

有没有其他的设置,我需要做fail2ban开箱即用? 我安装了唯一的事情就是将filter和wootwoot位添加到jail.conf中。 我通过input/etc/init.d/fail2ban start来检查它是否正在运行,并且它响应* Socket file /var/run/fail2ban/fail2ban.sock is present

编辑 – 只显示/var/log/apache2/access.log上的请求的样子

这是一个恶意请求

 67.215.248.8 - - [12/Feb/2014:18:59:42 +0000] "GET /w00tw00t.at.blackhats.romanian.anti-sec:) HTTP/1.1" 404 1997 "-" "ZmEu" 

这是我提出的要求

 My.IP.Address - - [12/Feb/2014:21:41:13 +0000] "GET /w00tw00t HTTP/1.1" 404 1928 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36" 

那些引号看起来不正确,我是否使用了正确的文本编辑器来编写正则expression式? 尝试

 Failregex = ^<HOST> .*"GET /w00tw00t.*" 

根据fail2ban-regex来查找你的两个例子。