使用fail2ban来阻止扫描攻击

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
头像
chenmingbao
帖子: 141
注册时间: 2009-11-06 11:24
联系:

使用fail2ban来阻止扫描攻击

#1

帖子 chenmingbao » 2009-12-12 13:55

http://bbs.gcshome.cn/thread-2648-1-1.html找到最新版本的 rpm 包来安装,装好后,稍微根据自己的情况改一下配置就可以使用了。vi /etc/fail2ban.conf#以 daemon 方式启动 fail2ban

  background = true#允许尝试次数

  maxfailures = 3#触发 maxfailures 之後的封锁时间(秒); 设为 -1 表示永远封锁

  bantime = 3600#以 findtime (秒) 时间内的错误记录作为 maxfailures 的计数基准

  findtime = 600#排除 IP 范围, 以空白隔开

  ignoreip = 127.0.0.1 192.168.0.0/24#不启用 mail 通知

  [MAIL]enabled = false#修改自 VSFTPD, 未提及的部份保持原设定

  [PROFTPD]enabled = true

  logfile = /var/log/proftpd/proftpd.log

  failregex = no such user|Incorrect password#未提及的部份保持原设定

  [SSH]enabled = true

  logfile = /var/log/secureservice fail2ban start这个服务启动以后,每天都能在 /var/log/fail2ban.log 中看到有攻击的肉鸡被 ban 了。

2008-08-01 09:13:33,532 WARNING: SSH: Ban (3600 s) 205.189.197.66


  2008-08-01 12:24:41,943 WARNING: SSH: Ban (3600 s) 121.52.209.5
下载地址:http://bbs.gcshome.cn/thread-2648-1-1.html
头像
link_01
帖子: 1024
注册时间: 2008-11-05 13:24

Re: 使用fail2ban来阻止扫描攻击

#2

帖子 link_01 » 2009-12-12 14:12

还没用过rpm,lz发错地方了吗?
笔记
-------------------------------------
http://blog.163.com/wqt_1101
回复