我正在尝试在我的testing服务器上configurationfail2ban 。 我只想暂时阻止任何试图探测我的网站的脚本机器人。 所以一切都有cgi-bin , admin , setup.php等等。 我以前回顾了所有在我的access.log中用grep "HTTP/1.1\" 404" access.log | awk '{print $7 } ' | sort | uniq -c | sort -n生成404错误。 我确保我的网站没有一个没有这些部分。 所以在安装之后,我创build了jail.local ,并没有对jail.conf做任何事情。 我的文件看起来像这样(我想阻止IP 10分钟): [DEFAULT] ignoreip = 127.0.0.1 bantime = 600 destemail = myemail banaction = iptables-multiport action = %(action_mwl)s [apache-script-bots] enabled = true port = http,https filter […]
我已经对文件/etc/fail2ban/jail.local(/etc/fail2ban/jail.conf的副本)进行了一些更改并保存,但现在fail2ban无法启动。 如果我删除jail.local,然后重新开始。 所以问题是在这个文件(jail.local),但2小时后,因为这个问题,我真的不知道错误在哪里。 请有人帮我find问题吗? 谢谢。 这是文件 # # WARNING: heavily refactored in 0.9.0 release. Please review and # customize settings for your setup. # # Changes: in most of the cases you should not modify this # file, but provide customizations in jail.local file, # or separate .conf files under jail.d/ directory, eg: # # […]
我已经安装了fail2ban来禁止对ssh密码进行暴力破解。 有没有禁用密码authentication在这台机器的业务要求。 fail2ban安装使用相同的厨师食谱,有效地禁止ssh攻击其他机器。 有一个SSH监狱configuration: # service fail2ban status fail2ban-server (pid 5480) is running… WARNING 'pidfile' not defined in 'Definition'. Using default one: '/var/run/fail2ban/fail2ban.pid' Status |- Number of jail: 1 `- Jail list: ssh 手动禁止用户作品: # fail2ban-client set ssh banip 103.41.124.46 但似乎没有自动禁止任何人: # cat /var/log/fail2ban.log 2014-11-20 18:23:47,069 fail2ban.server [67569]: INFO Exiting Fail2ban 2014-11-20 18:44:59,202 fail2ban.server [5480]: […]
在安装和configurationfail2ban之后,我尝试用一个错误的密码通过sshlogin到我的服务器。 经过几次尝试,我试着用正确的密码成功。 所以,fail2ban没有禁止用户ip允许他login。 不pipe我设定的规则,maxretry = 1等 我的iptables -L输出: Chain INPUT (policy ACCEPT) target prot opt source destination fail2ban-SSH tcp — anywhere anywhere tcp dpt:ssh Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain fail2ban-SSH (1 references) target prot opt source destination RETURN all — anywhere […]
我configuration了fail2ban,但我想testing发送电子邮件。 例如,我希望在fail2ban启动或停止时收到电子邮件。
在我试图用fail2ban阻止失败的phpMyAdminlogin失败时,我创build了一个脚本来logging失败的尝试到一个文件: /var/log/phpmyadmin_auth.log 自定义日志 /var/log/phpmyadmin_auth.log文件的格式是: phpMyadmin login failed with username: root; ip: 192.168.1.50; url: http://somedomain.com/phpmyadmin/index.php phpMyadmin login failed with username: ; ip: 192.168.1.50; url: http://192.168.1.48/phpmyadmin/index.php 自定义filter [Definition] # Count all bans in the logfile failregex = phpMyadmin login failed with username: .*; ip: <HOST>; phpMyAdmin监狱 [phpmyadmin] enabled = true port = http,https filter = phpmyadmin action […]
我build立了一个垃圾邮件定制监狱,这给我带来了麻烦。 使用“bantime -1”我试图永久禁止僵尸networking。 我认为这是工作,但是当每周logrotate发生fail2ban unbanned所有的IP。 使用fail2ban永久和持续禁止IP的最佳方式是什么? 正在做这样的事情+logging永久禁止IP到一个单独的文件(不旋转)一个很好的解决scheme? 干杯,托马斯 PS:我想这样做没有新的cronjobs和脚本。 PPS:我正在使用Debian。
我configuration了fail2ban来监视我收到的某种恶意stream量模式,并禁止IP地址关联。 一切似乎都工作得很好 – 正则expression式正确地匹配模式,问题IP地址被添加到iptables。 但是,当我检查Apache日志时,我仍然从被禁止的IP地址获取命中。 就好像iptables没有运行一样。 所以让我分享一些细节,以确认一切正确configuration。 首先,我将清除并重新加载iptables规则: $ sudo iptables -F $ cat /etc/iptables.firewall.rules *filter # Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0 -A INPUT -i lo -j ACCEPT -A INPUT -d 127.0.0.0/8 -j REJECT # Accept all established inbound connections -A INPUT -m state –state […]
我试图在不重新启动Fail2Ban的情况下解锁IP地址,这样做的最好方法是什么? 或者你能指点我一个有用的指导方向吗? 正如你可以看到下面我试图删除的IP地址是:89.31.259.161 # iptables -L -n Chain INPUT (policy DROP) target prot opt source destination fail2ban-apache-badbots tcp — 0.0.0.0/0 0.0.0.0/0 multiport dports 80,443 fail2ban-httpd tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 fail2ban-sasl tcp — 0.0.0.0/0 0.0.0.0/0 multiport dports 25,465,143,220,993,110,995 fail2ban-SSH tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 fail2ban-httpd tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 fail2ban-httpd tcp […]
我想select社区的大脑关于Linux服务器安全,特别是暴力攻击和使用fail2ban vs定制iptables 。 这里有一些类似的问题,但是没有一个能够让我满意。 总之,我试图确定最好的解决scheme,以保护暴露在互联网(运行通常的服务,SSH,网页,邮件)的Linux服务器,从暴力攻击。 我有一个体面的服务器安全处理,即通过不允许root或密码login,更改默认端口,确保软件是最新的,检查日志文件,只允许某些主机访问服务器和利用安全性lockingssh审计工具,如Lynis ( https://cisofy.com/lynis/ ),一般安全合规性,所以这个问题不一定就是这样,尽pipeinput和build议总是受欢迎的 。 我的问题是我应该使用哪种解决scheme(fail2ban或iptables),我应该如何configuration它,还是应该使用两者的组合来抵御暴力攻击? 关于这个主题有一个有趣的回应( Denyhosts vs fail2ban vs iptables-防止暴力login的最好方法? )。 对我个人而言,最有趣的答案是( https://serverfault.com/a/128964),iptables 路由发生在内核中 ,而fail2ban则使用用户模式工具来parsing日志文件。 Fail2ban当然使用iptables,但是它仍然需要parsing日志文件并匹配模式,直到执行一个动作。 那么使用iptables并使用限速 ( https://www.rackaid.com/blog/how-to-block-ssh-brute-force-attacks/ )在一段时间内从IP上删除请求的时间,在特定的时间内连接尝试过多,而不pipe它尝试连接的协议是什么? 如果是这样,那么有一些有趣的想法使用drop vs reject这些包( http://www.chiark.greenend.org.uk/~peterb/network/drop-vs-reject ),对此有什么想法? Fail2ban允许自定义configuration的forms,能够编写自定义“ 规则 ”的服务,可能无法在默认configuration中解决。 它很容易安装和设置,function强大,但如果我试图实现的所有服务/协议超过一个x数量的两个失败的访问尝试是“ 阻止 ”从服务器的IP是一个矫枉过正的时间? 这里的目标是打开每日logging报告,而不必滚动浏览尝试失败的连接到服务器的页面。 感谢您花时间。