免费注册 查看新帖 |

Chinaunix

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

[FreeBSD] sshguard-pf 无法阻挡ssh攻击,不知何解 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-12-26 11:03 |只看该作者 |倒序浏览
安装配置sshguard
cd /usr/ports/security/sshguard-pf
make install clean
vi etc/syslog.conf
添加
  1. auth.info;authpriv.info     |exec /usr/local/sbin/sshguard
复制代码
服务器有两个网卡,so
vi /etc/pf.conf  内容如下
  1. table <sshguard> persist

  2. set skip on lo

  3. scrub in

  4. block in quick on egress proto tcp from <sshguard> to any port 22 label "ssh bruteforce"
  5. pass in
  6. pass out
复制代码
/etc/rc.d/syslog reload


top  found

  1. 7907 root        2  44    0  7184K  1612K nanslp  4   0:00  0.00% sshguard
复制代码
tail -f /var/log/auth.log
测试ssh攻击,看起来sshguard没有发挥作用

  1. Dec 26 10:29:47 b sshd[1077]: Server listening on 0.0.0.0 port 22.
  2. Dec 26 10:29:47 b sshguard[1079]: Started successfully [(a,p,s)=(4, 420, 1200)],now ready to scan.
  3. Dec 26 10:32:18 b sshd[1202]: error: PAM: authentication error for illegal user a from 10.0.0.88
  4. Dec 26 10:32:18 b sshd[1202]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49700 ssh2
  5. Dec 26 10:32:18 b sshd[1202]: error: PAM: authentication error for illegal user a from 10.0.0.88
  6. Dec 26 10:32:18 b sshd[1202]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49700 ssh2
  7. Dec 26 10:32:23 b sshd[1206]: Invalid user a from 10.0.0.88
  8. Dec 26 10:32:23 b sshd[1206]: error: PAM: authentication error for illegal user a from 10.0.0.88
  9. Dec 26 10:32:23 b sshd[1206]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49701 ssh2
  10. Dec 26 10:32:23 b sshd[1206]: error: PAM: authentication error for illegal user a from 10.0.0.88
  11. Dec 26 10:32:23 b sshd[1206]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49701 ssh2
  12. Dec 26 10:32:29 b sshd[1210]: Invalid user a from 10.0.0.88
  13. Dec 26 10:32:29 b sshd[1210]: error: PAM: authentication error for illegal user a from 10.0.0.88
  14. Dec 26 10:32:29 b sshd[1210]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49702 ssh2
  15. Dec 26 10:32:29 b sshd[1210]: error: PAM: authentication error for illegal user a from 10.0.0.88
  16. Dec 26 10:32:29 b sshd[1210]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49702 ssh2
  17. Dec 26 10:32:34 b sshd[1214]: Invalid user a from 10.0.0.88
  18. Dec 26 10:32:34 b sshd[1214]: error: PAM: authentication error for illegal user a from 10.0.0.88
  19. Dec 26 10:32:34 b sshd[1214]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49703 ssh2
  20. Dec 26 10:32:34 b sshd[1214]: error: PAM: authentication error for illegal user a from 10.0.0.88
  21. Dec 26 10:32:34 b sshd[1214]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49703 ssh2
  22. Dec 26 10:32:39 b sshd[1218]: Invalid user a from 10.0.0.88
  23. Dec 26 10:32:39 b sshd[1218]: error: PAM: authentication error for illegal user a from 10.0.0.88
  24. Dec 26 10:32:39 b sshd[1218]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49704 ssh2
  25. Dec 26 10:32:39 b sshd[1218]: error: PAM: authentication error for illegal user a from 10.0.0.88
  26. Dec 26 10:32:39 b sshd[1218]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49704 ssh2
  27. Dec 26 10:32:43 b sshd[1222]: Invalid user a from 10.0.0.88
  28. Dec 26 10:32:44 b sshd[1222]: error: PAM: authentication error for illegal user a from 10.0.0.88
  29. Dec 26 10:32:44 b sshd[1222]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49705 ssh2
  30. Dec 26 10:32:44 b sshd[1222]: error: PAM: authentication error for illegal user a from 10.0.0.88
  31. Dec 26 10:32:44 b sshd[1222]: Failed keyboard-interactive/pam for invalid user a from 10.0.0.88 port 49705 ssh2
  32. Dec 26 10:32:48 b sshd[1226]: Invalid user a from 10.0.0.88
复制代码

论坛徽章:
0
2 [报告]
发表于 2010-12-26 11:05 |只看该作者
环境
freebsd 8.1 release
sshguard 1.4
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP