欢迎来到 黑吧安全网 聚焦网络安全前沿资讯,精华内容,交流技术心得!

Linux下检测SSH暴力破解攻击与防护功能

来源:本站整理 作者:佚名 时间:2015-12-27 TAG: 我要投稿

 网络上无聊的人一大堆,SSH端口密码扫描破解的人也很多,如果你的VPS被攻破那么会被用来攻击别人(如DDOS攻击),那么遇到严格的服务商,那么就会被关闭或者永久关闭,下面微饭给大家推荐个检测SSH破解及防护方法。

SSH暴力破解检测方法
如果你CPU/内存异常爆表,连接速度极慢,有异常进程等情况,有可能你的VPS被人扫描破解或者已经沦陷。。
可以用此方法检测下多少人在“盯着”你的VPS
 
# cat /var/log/secure | awk '/Failed/{print $(NF-3)}' | sort | uniq -c | awk '{print $2" = "$1;}'
1
# cat /var/log/secure | awk '/Failed/{print $(NF-3)}' | sort | uniq -c | awk '{print $2" = "$1;}'
通过上面的命令可以查看有哪些IP尝试过连接和破解次数,如下所示:
 
109.74.209.197 = 9113.195.145.70 = 740113.195.145.85 = 1038115.197.42.232 = 3115.239.212.132 = 19115.239.212.133 = 14115.239.212.134 = 17115.239.212.135 = 18115.239.212.136 = 16115.239.212.137 = 23115.239.212.138 = 16115.239.212.139 = 14115.47.26.53 = 10117.245.5.85 = 6118.69.223.246 = 28121.247.3.54 = 4123.141.29.11 = 31125.211.222.103 = 32128.199.84.180 = 771138.94.87.253 = 614.140.241.75 = 114.177.108.180 = 1158.69.195.20 = 74161.202.147.197 = 15161.202.41.20 = 15169.229.3.91 = 1177.220.212.90 = 131.85.21.39 = 31.85.62.39 = 24186.215.198.163 = 5187.110.243.90 = 1187.210.107.242 = 32188.130.145.134 = 18189.28.243.113 = 3191.243.17.43 = 1193.104.41.54 = 9193.189.117.120 = 1193.95.84.205 = 32198.251.79.54 = 38202.126.93.18 = 32202.198.129.78 = 32218.57.241.59 = 1218.98.39.43 = 30220.225.7.31 = 1221.232.129.51 = 61222.186.21.113 = 20222.186.50.141 = 1222.21.43.56 = 1227.254.67.185 = 227.75.167.208 = 837.58.97.4 = 1543.229.53.12 = 794743.229.53.50 = 5004346.146.220.219 = 146.161.40.34 = 650.57.160.46 = 27451.254.142.83 = 455.140.213.177 = 158.185.2.22 = 9785.8.66.101 = 359.29.245.226 = 3259.45.79.116 = 1050679.60.38.244 = 580.82.64.109 = 1780.82.78.57 = 181.18.133.246 = 182.138.1.118 = 3285.93.5.64 = 285.93.5.65 = 285.93.5.66 = 189.23.194.194 = 491.211.132.9 = 2493.190.143.30 = 1293.95.214.120 = 494.102.49.125 = 15
 
109.74.209.197 = 9
113.195.145.70 = 740
113.195.145.85 = 1038
115.197.42.232 = 3
115.239.212.132 = 19
115.239.212.133 = 14
115.239.212.134 = 17
115.239.212.135 = 18
115.239.212.136 = 16
115.239.212.137 = 23
115.239.212.138 = 16
115.239.212.139 = 14
115.47.26.53 = 10
117.245.5.85 = 6
118.69.223.246 = 28
121.247.3.54 = 4
123.141.29.11 = 31
125.211.222.103 = 32
128.199.84.180 = 771
138.94.87.253 = 6
14.140.241.75 = 1
14.177.108.180 = 1
158.69.195.20 = 74
161.202.147.197 = 15
161.202.41.20 = 15
169.229.3.91 = 1
177.220.212.90 = 13
1.85.21.39 = 3
1.85.62.39 = 24
186.215.198.163 = 5
187.110.243.90 = 1
187.210.107.242 = 32
188.130.145.134 = 18
189.28.243.113 = 3
191.243.17.43 = 1
193.104.41.54 = 9
193.189.117.120 = 1
193.95.84.205 = 32
198.251.79.54 = 38
202.126.93.18 = 32
202.198.129.78 = 32
218.57.241.59 = 1
218.98.39.43 = 30
220.225.7.31 = 1
221.232.129.51 = 61
222.186.21.113 = 20
222.186.50.141 = 1
222.21.43.56 = 12
27.254.67.185 = 2
27.75.167.208 = 8
37.58.97.4 = 15
43.229.53.12 = 7947
43.229.53.50 = 50043
46.146.220.219 = 1
46.161.40.34 = 6
50.57.160.46 = 274
51.254.142.83 = 45
5.140.213.177 = 1
58.185.2.22 = 978
5.8.66.101 = 3
59.29.245.226 = 32
59.45.79.116 = 10506
79.60.38.244 = 5
80.82.64.109 = 17
80.82.78.57 = 1
81.18.133.246 = 1
82.138.1.118 = 32
85.93.5.64 = 2
85.93.5.65 = 2
85.93.5.66 = 1
89.23.194.194 = 4
91.211.132.9 = 24
93.190.143.30 = 12
93.95.214.120 = 4
94.102.49.125 = 15
DenyHosts安装与配置演示:
1、下载DenyHosts 并解压
 
# wget http://soft.vpser.net/security/denyhosts/DenyHosts-2.6.tar.gz# tar zxvf DenyHosts-2.6.tar.gz# cd DenyHosts-2.6
 
# wget http://soft.vpser.net/security/denyhosts/DenyHosts-2.6.tar.gz
# tar zxvf DenyHosts-2.6.tar.gz
# cd DenyHosts-2.6
2、安装、配置和启动
安装前建议执行:
 
echo "" > /var/log/secure && service rsyslog restart # 清空以前的日志并重启一下rsyslog
1
echo "" > /var/log/secure && service rsyslog restart # 清空以前的日志并重启一下rsyslog
 
# python setup.py install

[1] [2]  下一页

【声明】:黑吧安全网(http://www.myhack58.com)登载此文出于传递更多信息之目的,并不代表本站赞同其观点和对其真实性负责,仅适于网络安全技术爱好者学习研究使用,学习中请遵循国家相关法律法规。如有问题请联系我们,联系邮箱admin@myhack58.com,我们会在最短的时间内进行处理。
  • 最新更新
    • 相关阅读
      • 本类热门
        • 最近下载