漏洞SSH Weak Algorithms Supported简析

来源:互联网 发布:js split("") 编辑:程序博客网 时间:2024/05/17 08:50

前言

        用nessus给linux设备进行漏洞扫描的时候,经常会爆出一个名为SSH WeakAlgorithms Supported的中危漏洞,而且往往一爆就是一大片,而且关键它还挂着个中危的头衔会导致报告的观赏度大大下降。恰逢老板追查,对这个问题稍作了研究和大家分享一下。

 

一、漏洞描述

nessus官方给的描述信息为:

Nessus has detected that the remote SSH server is configured to use the Arcfour stream cipher or no cipher at all. RFC 4253 advises against using Arcfour due to an issue with weak keys.

大意为nessus检测到了SSH服务配置中存在Arcfour加密算法或没有配置加密算法。

 

二、解决方案

    1、在ssh配置文件/etc/ssh/sshd_config中添加下面这行配置。

Ciphersaes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se

    2、重启ssh服务

 

三、漏洞简析

    根据nessus给的描述可以看出,这个漏洞属于SSH的配置缺陷,SSH服务启用了Arcfour (也称RC4)这个不安全算法,我们用man查看一下关于sshd_config文件的帮助,其中可以看到关于Ciphers的条目。

man sshd_config:

…Ciphers            Specifies the ciphers allowed for protocol version 2.  Multiple ciphers must be comma-sepa-            rated.  The supported ciphers are“3des-cbc”, “aes128-cbc”, “aes192-cbc”, “aes256-cbc”,            “aes128-ctr”, “aes192-ctr”, “aes256-ctr”, “arcfour128”, “arcfour256”,“arcfour”,            “blowfish-cbc”, “rijndael-cbc@lysator.liu.se”, and “cast128-cbc”.  The default is:                aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,               aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,               aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se…

    可以看到,在默认的情况下,sshd_config文件中如果没有指定加密算法的话,默认会使用的算法列表中存在Arcfour 算法。

    因此这个漏洞的修复只需要手动配置ssh加密算法,并去除Arcfour 算法即可。

   

四、arcfour算法的风险

    关于启用Arcfour 存在的风险,可以参考wiki上的词条:https://en.wikipedia.org/wiki/RC4

    简单的说就是RC4算法本身存在漏洞,在特定情况下,它密文可以被破译得到明文,因此这是一种不安全加密算法。


原创粉丝点击