修复Diffie-Hellman Key Agreement Protocol 资源管理错误漏洞(CVE-2002-20001)

查看Kexalgorithms-此举操作是确认客户端支持的kexalgorithms

[root@localhost ~]# ssh -Q kex

查看Kexalgorithms-此举操作是确认客户端支持的kexalgorithms

[root@localhost ~]# sshd -T | grep -w kexalgorithms

修复方法

通过修改sshd_config配置文件,屏蔽掉不安全的KexAlgorithjms,其中具体的sshd_config配置参数可以从man文档中查看

通过man文档查看当前openssh版本支持的算法列表和参数用法。

[root@localhost ~]# man sshd_config |grep -A 40 -w KexAlgorithms

未禁用diffie-hellman算法之前,可用正常使用ssh连接登录

[root@localhost ~]# ssh -v -oKexAlgorithms=diffie-hellman-group1-sha1 [email protected]

使用漏扫可以扫出该漏洞

禁用diffie-hellman算法

[root@localhost ~]# echo "KexAlgorithms curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521" >> /etc/ssh/sshd_config

[root@localhost ~]# systemctl restart sshd

[root@localhost ~]# sshd -T | grep -w kexalgorithms

再次使用禁用了diffie-hellman算法之后,带上被禁用的密钥算法登录,显示不能正常使用ssh登录

[root@localhost ~]# ssh -v -oKexAlgorithms=diffie-hellman-group1-sha1 [email protected]

使用奇安信漏扫,已无法扫出,漏洞修复

不加任何加密算法,正常使用ssh也可以登录

猜你喜欢

转载自blog.csdn.net/weixin_59679023/article/details/129745550