OpenSSH CBC模式信息泄露漏洞修复指南

OpenSSH CBC模式信息泄露漏洞修复指南

漏洞编号

  • CNNVD编号:CNNVD-200811-321
  • CVE编号: CVE-2008-5161

危害等级

环境

  • 操作系统:CentOS7.5-1804
  • IP:10.2.29.53(测试环境)
  • SSH版本:OpenSSH_7.4p1

漏洞简介

OpenSSH是一种开放源码的SSH协议的实现,初始版本用于OpenBSD平台,现在已经被移植到多种Unix/Linux类操作系统下。如果配置为CBC模式的话,OpenSSH没有正确地处理分组密码算法加密的SSH会话中所出现的错误,导致可能泄露密文中任意块最多32位纯文本。在以标准配置使用OpenSSH时,攻击者恢复32位纯文本的成功概率为2^{-18} ,此外另一种攻击变种恢复14位纯文本的成功概率为2^{-14}。

漏洞检测

使用漏洞扫描工具进行检测


漏洞修复

(※注:在修改前请注意备份文件,或对虚拟机创建快照。以便操作出现意外时进行系统恢复。)

使用man sshd_config命令查看Ciphers节点配置

[root@localhost ~]# man sshd_config  
     #找到Ciphers节点  
     ...  
     Ciphers  
             Specifies the ciphers allowed.  Multiple ciphers must be comma-separated.  If the specified value begins with  
             a ‘+’ character, then the specified ciphers will be appended to the default set instead of replacing them.  
  
             The supported ciphers are:  
  
                       3des-cbc  
                       aes128-cbc  
                       aes192-cbc  
                       aes256-cbc  
                       aes128-ctr  
                       aes192-ctr  
                       aes256-ctr  
                       [email protected]  
                       [email protected]  
                       arcfour  
                       arcfour128  
                       arcfour256  
                       blowfish-cbc  
                       cast128-cbc  
                       [email protected]  
      
                 The default is:  
      
                       [email protected],  
                       aes128-ctr,aes192-ctr,aes256-ctr,  
                       [email protected],[email protected],  
                       aes128-cbc,aes192-cbc,aes256-cbc,  
                       blowfish-cbc,cast128-cbc,3des-cbc  
      
                 The list of available ciphers may also be obtained using "ssh -Q cipher".  
         ...  

去除-cbc结尾的加密算法,并保存于/etc/ssh/sshd_config文件中

找到例子中26行中The default is:下的内容,去除-cbc结尾的加密算法(此处请根据自身SSH版本加密修改,理论适用于所有SSH)。

1.  [email protected]  
2.  aes128-ctr  
3.  aes192-ctr  
4.  aes256-ctr  
5.  [email protected]  
6.  [email protected]  

共统计出6种加密方式,并对统计进行编排,以逗号相隔,并在头部添加Ciphers存处于/etc/ssh/sshd_config末尾即可,如图所示。

Ciphers [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]  

使用命令重启SSH服务systemctl restart sshd

[root@localhost ~]# systemctl restart sshd  

修复确认

修复完成,可使用漏洞扫描工具复测。


你可能感兴趣的:(OpenSSH CBC模式信息泄露漏洞修复指南)