免费注册 查看新帖 |

Chinaunix

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

大家帮忙看看有什么办法吗?ssh暴力 [暂时解决] [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-07-03 17:17 |只看该作者 |倒序浏览
本帖最后由 wu633520 于 2010-07-05 16:55 编辑

我的服务器系统是freebsd8.0 在外省,这段时间,有个人一直在用ssh试途暴力登陆我的服务器,每次ip地址还不一样,不知哪位有什么好的办法吗,或是用shell脚本阻止他,看着这些信息我的头都快大了
提示信息:
Jul 2 10:02:56 me sshd[7448]: error: PAM: authentication error for illegal user oracle from 95.155.228.37
Jul 2 10:10:36 me sshd[7469]: error: PAM: authentication error for illegal user oracle from 213.76.166.158
Jul 2 10:14:44 me sshd[7484]: error: PAM: authentication error for illegal user oracle from 168.243.137.129
Jul 2 10:18:26 me sshd[7495]: error: PAM: authentication error for illegal user info from 122.224.135.163
Jul 2 10:22:28 me sshd[7518]: error: PAM: authentication error for illegal user info from 80.153.68.133
Jul 2 10:29:59 me sshd[7529]: error: PAM: authentication error for illegal user info from 115.168.71.87
Jul 2 10:33:49 me sshd[7552]: error: PAM: authentication error for illegal user info from 190.254.221.66
Jul 2 10:38:09 me sshd[7565]: error: PAM: authentication error for illegal user info from 86.58.149.70
Jul 2 10:42:09 me sshd[7576]: error: PAM: authentication error for illegal user info from 190.144.47.82
Jul 2 10:45:40 me sshd[7599]: error: PAM: authentication error for illegal user temp from 219.151.4.208
Jul 2 10:50:10 me sshd[7610]: error: PAM: authentication error for illegal user temp from 80.153.154.21
Jul 2 10:53:17 me sshd[7613]: error: PAM: authentication error for illegal user temp from 220.128.229.223
Jul 2 10:57:28 me sshd[7636]: error: PAM: authentication error for illegal user temp from 123.159.194.21

论坛徽章:
0
2 [报告]
发表于 2010-07-03 18:43 |只看该作者
方便把日志发给我?尝试用shell脚本分析分析。

论坛徽章:
0
3 [报告]
发表于 2010-07-03 20:01 |只看该作者
fb下安装的oracle,用这个的好像不是太多的,linux下用oracle不错的

论坛徽章:
0
4 [报告]
发表于 2010-07-03 21:34 |只看该作者
我很多服务器日志都有暴力破解的,网上无聊的黑客还真多,我觉得没必要在意,密码设置的复杂点,最好是22端口做个ip限制,或者是ssh用key认证,绝对安全!

论坛徽章:
0
5 [报告]
发表于 2010-07-03 22:51 |只看该作者
{:3_196:}其实不用担心太多,做个KEY认证,登陆用户名设置一个偏门一点的用户名即可。

论坛徽章:
0
6 [报告]
发表于 2010-07-03 23:26 |只看该作者
block in quick proto tcp from any os "Linux" to any port ssh
# (via @delphij)

论坛徽章:
0
7 [报告]
发表于 2010-07-04 09:29 |只看该作者
有兴趣的话可以看看这篇

http://bbs.chinaunix.net/thread-1730620-1-1.html

论坛徽章:
0
8 [报告]
发表于 2010-07-05 09:27 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
9 [报告]
发表于 2010-07-05 16:41 |只看该作者
根据6楼的提示,在网上找到解决办法,其实改端口不是一个好的办法,
使用bsd中的pf
**************************************************
禁止来自Linux的到22端口的TCP连接。

在 /etc/pf.conf 中加入:

block in quick proto tcp from any os "Linux" to any port ssh

然后启用pf:
代码:

echo 'pf_enable="YES"' >> /etc/rc.conf
/etc/rc.d/pf start  


*******************************************


原帖:http://www.freebsdchina.org/forum/viewtopic.php?p=249317#249317

我只是初次测试可以,还不知这样设置,对别的有没有影响,我对pf不懂,有哪位比较熟悉,帮忙看看
#pfctl -sa
No ALTQ support in kernel
ALTQ related functions disabled
FILTER RULES:
block drop in quick proto tcp from any os "Linux" to any port = ssh

INFO:
Status: Enabled for 0 days 00:04:43           Debug: Urgent

State Table                          Total             Rate
  current entries                        0
  searches                          151828          536.5/s
  inserts                                0            0.0/s
  removals                               0            0.0/s
Counters
  match                             151828          536.5/s
  bad-offset                             0            0.0/s
  fragment                               0            0.0/s
  short                                  0            0.0/s
  normalize                              0            0.0/s
  memory                                 0            0.0/s
  bad-timestamp                          0            0.0/s
  congestion                             0            0.0/s
  ip-option                              0            0.0/s
  proto-cksum                            1            0.0/s
  state-mismatch                         0            0.0/s
  state-insert                           0            0.0/s
  state-limit                            0            0.0/s
  src-limit                              0            0.0/s
  synproxy                               0            0.0/s

TIMEOUTS:
tcp.first                   120s
tcp.opening                  30s
tcp.established           86400s
tcp.closing                 900s
tcp.finwait                  45s
tcp.closed                   90s
tcp.tsdiff                   30s
udp.first                    60s
udp.single                   30s
udp.multiple                 60s
icmp.first                   20s
icmp.error                   10s
other.first                  60s
other.single                 30s
other.multiple               60s
frag                         30s
interval                     10s
adaptive.start             6000 states
adaptive.end              12000 states
src.track                     0s

LIMITS:
states        hard limit    10000
src-nodes     hard limit    10000
frags         hard limit     5000
tables        hard limit     1000
table-entries hard limit   200000

OS FINGERPRINTS:
696 fingerprints loaded

论坛徽章:
0
10 [报告]
发表于 2010-07-05 16:53 |只看该作者
方便把日志发给我?尝试用shell脚本分析分析。
laohuanggua 发表于 2010-07-03 18:43



   原帖中那些信息,就是日志文件中的信息,不知用shell用更好的解决办法吗
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP