弱加密算法漏洞修复 SSH Weak Encryption Algorithms Supporte

SSH配置文件中加密算法没有指定,默认支持所有加密算法,包括arcfour,arcfour128,arcfour256等弱加密算法。但是目前RC4是不安全算法
若数据库安全性要求比较高,这个漏洞还是必须要修复的,下面记录下Oracle RAC修复过程,此修复过程不影响现有系统。
如有不当欢迎斧正。

1、root权限用户才能执行
[root@testdb2 ~]# ls -l /etc/ssh/sshd_config
-rw------- 1 root root 3717 Feb 4 2021 /etc/ssh/sshd_config

2、#备份
[root@testdb2 ~]# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
[root@testdb2 ~]# ls -l /etc/ssh/sshd_config.bak
-rw------- 1 root root 3717 Aug 24 15:04 /etc/ssh/sshd_config.bak

3、#修改
/*
#添加下面一行,屏蔽弱加密算法,最后添加一下内容(去掉 arcfour arcfour128 arcfour256 等弱加密算法)
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc
#ssh_config和sshd_config都是ssh服务器的配置文件,二者区别在于,前者是针对客户端的配置文件,后者则是针对服务端的配置文件。
*/
[root@testdb2 ~]# vi /etc/ssh/sshd_config
#新增一行
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc

4、#更新之后检查,直接返回无异常则可以重启
[root@testdb2 ~]# sshd -t
/etc/ssh/sshd_config line 113: Bad yes/no argument: sandbox
#将113 行注释掉,否则可能重启失败
[root@testdb2 ~]# vi /etc/ssh/sshd_config

#正常了
[root@testdb2 ~]# sshd -t

5、#保存重启生效
[root@testdb2 ~]# /etc/init.d/sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
[root@testdb2 ~]# exit
logout

6、#退出root,普通用户验证
/* 多种验证方式
nmap 、Nessus 等工具可以进行验证,这里用 ssh 登陆验证,nmap更直观
ssh -vv -oCiphers=aes128-cbc,3des-cbc,blowfish-cbc 服务器ip
ssh -vv -oMACs=hmac-md5 服务器ip
nmap --script ssh2-enum-algos -sV -p 22 192.168.10.100
ssh -vv -oCiphers=aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc mydb@192.168.10.100
*/
也可如下 arcfour128 无法登陆就可以了
ssh -vv -oCiphers=arcfour128 mydb@192.168.10.100
...
debug2: kex_parse_kexinit: reserved 0
no matching cipher found: client arcfour128 server aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc

参考
https://blog.csdn.net/qq_40606798/article/details/86512610
https://www.cnblogs.com/blue1997/p/14682341.html
https://www.jianshu.com/p/40cfd91024da

原文地址:https://www.cnblogs.com/ritchy/p/15194909.html