资讯专栏INFORMATION COLUMN

Linux SSH的SSL弱加密算法漏洞修复

社区管理员 / 1844人阅读

Linux在做漏洞扫描时,会发现有个名为SSH Weak Encryption Algorithms Supporte的漏洞,这是因为ssh通信时默认使用的加密算法中有部分是不再安全的算法。如:arcfour,arcfour128,arcfour256等都是弱加密算法。

1、扫描Linux SSH默认使用的加密算法列表

[root@blogs-v2 ~]# yum install nmap -y
[root@blogs-v2 ~]# nmap --script 'ssh2*' 192.168.0.221

Starting Nmap 6.40 ( http://nmap.org ) at 2022-03-08 15:28 CST
Nmap scan report for 192.168.0.221
Host is up (0.0020s latency).
Not shown: 998 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
| ssh2-enum-algos: 
|   kex_algorithms (12)
|       curve25519-sha256
|       curve25519-sha256@libssh.org
|       ecdh-sha2-nistp256
|       ecdh-sha2-nistp384
|       ecdh-sha2-nistp521
|       diffie-hellman-group-exchange-sha256
|       diffie-hellman-group16-sha512
|       diffie-hellman-group18-sha512
|       diffie-hellman-group-exchange-sha1
|       diffie-hellman-group14-sha256
|       diffie-hellman-group14-sha1
|       diffie-hellman-group1-sha1
|   server_host_key_algorithms (5)
|       ssh-rsa
|       rsa-sha2-512
|       rsa-sha2-256
|       ecdsa-sha2-nistp256
|       ssh-ed25519
|   encryption_algorithms (12)            # 当前使用的SSH加密算法列表
|       chacha20-poly1305@openssh.com
|       aes128-ctr
|       aes192-ctr
|       aes256-ctr
|       aes128-gcm@openssh.com
|       aes256-gcm@openssh.com
|       aes128-cbc
|       aes192-cbc
|       aes256-cbc
|       blowfish-cbc
|       cast128-cbc
|       3des-cbc
|   mac_algorithms (10)
|       umac-64-etm@openssh.com
|       umac-128-etm@openssh.com
|       hmac-sha2-256-etm@openssh.com
|       hmac-sha2-512-etm@openssh.com
|       hmac-sha1-etm@openssh.com
|       umac-64@openssh.com
|       umac-128@openssh.com
|       hmac-sha2-256
|       hmac-sha2-512
|       hmac-sha1
|   compression_algorithms (2)
|       none
|_      zlib@openssh.com
111/tcp open  rpcbind

Nmap done: 1 IP address (1 host up) scanned in 0.17 seconds

2、修改SSH通信默认加密算法

[root@192-168-0-221 ~]# vim /etc/ssh/sshd_config 
# Example of overriding settings on a per-user basis
#Match User anoncvs
#       X11Forwarding no
#       AllowTcpForwarding no
#       PermitTTY no
#       ForceCommand cvs server
Ciphers aes128-ctr,aes192-ctr,aes256-ctr                # 显式指定ssh通讯时使用的加密算法

[root@192-168-0-221 ~]# systemctl restart sshd.service  # 重启SSH服务

注:ssh_config和sshd_config都是ssh服务器的配置文件,二者区别在于,前者是针对客户端的配置文件,后者则是针对服务端的配置文件。

3、SSH加密算法修改效果验证

[root@blogs-v2 ~]# nmap --script 'ssh2*' 192.168.0.221

Starting Nmap 6.40 ( http://nmap.org ) at 2022-03-08 15:43 CST
Nmap scan report for 192.168.0.221
Host is up (0.0022s latency).
Not shown: 998 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
| ssh2-enum-algos: 
|   kex_algorithms (12)
|       curve25519-sha256
|       curve25519-sha256@libssh.org
|       ecdh-sha2-nistp256
|       ecdh-sha2-nistp384
|       ecdh-sha2-nistp521
|       diffie-hellman-group-exchange-sha256
|       diffie-hellman-group16-sha512
|       diffie-hellman-group18-sha512
|       diffie-hellman-group-exchange-sha1
|       diffie-hellman-group14-sha256
|       diffie-hellman-group14-sha1
|       diffie-hellman-group1-sha1
|   server_host_key_algorithms (5)
|       ssh-rsa
|       rsa-sha2-512
|       rsa-sha2-256
|       ecdsa-sha2-nistp256
|       ssh-ed25519
|   encryption_algorithms (3)          # 可以看出,SSH通讯加密算法只剩刚才自定义的三个了,说明修改成功
|       aes128-ctr
|       aes192-ctr
|       aes256-ctr
|   mac_algorithms (10)
|       umac-64-etm@openssh.com
|       umac-128-etm@openssh.com
|       hmac-sha2-256-etm@openssh.com
|       hmac-sha2-512-etm@openssh.com
|       hmac-sha1-etm@openssh.com
|       umac-64@openssh.com
|       umac-128@openssh.com
|       hmac-sha2-256
|       hmac-sha2-512
|       hmac-sha1
|   compression_algorithms (2)
|       none
|_      zlib@openssh.com
111/tcp open  rpcbind

Nmap done: 1 IP address (1 host up) scanned in 0.17 seconds


文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/128132.html

相关文章

  • SSL/TLS 存在Bar Mitzvah Attack漏洞

    摘要:详细描述该漏洞是由功能较弱而且已经过时的加密算法中一个问题所导致的。它能够在某些情况下泄露加密流量中的密文,从而将账户用户名密码信用卡数据和其他敏感信息泄露给黑客。解决办法服务器端禁止使用加密算法。客户端应在浏览器配置中禁止。 ...

    doodlewind 评论0 收藏0
  • 网络安全-常见面试题(Web、渗透测试、密码学、Linux等)

    摘要:攻击者可能会窃取或修改此类保护不力的数据,以实施信用卡欺诈身份盗用或其他犯罪活动。跨站脚本攻击漏洞的防御策略前端过滤字符,后端白名单例如,只允许固定的标签,设置,防止被读取。 目录 WEB安全 OWASP Top 10(2017) Injection - 注入攻击 Broken Authen...

    Caizhenhao 评论0 收藏0
  • 移动APP开发中8大安全问题

    摘要:但是有了加密算法并不以为着不会遭到攻击,随着技术的发展,加密算法也需要升级。如果您处理收集用户的大数据,请申请安全套接字认证,尽可能避免使用低级的加密算法,防止分析信息和广告信息的泄露。 showImg(https://segmentfault.com/img/bV20St?w=600&h=257); 每天都有大量的APP发布,并且大部分APP都涉及到重要的用户信息。这些APP容易遭到...

    Jonathan Shieber 评论0 收藏0
  • 简介:CII最佳实践徽章 - CNCF毕业标准要求之一

    摘要:已经实现并维护了核心基础结构计划的最佳实践徽章。年中国开源峰会提案征集现已开放在中国开源峰会上,与会者将共同合作及共享信息,了解最新和最有趣的开源技术,包括容器云技术网络微服务等并获得如何在开源社区中导向和引领的信息。 从沙箱或孵化状态毕业,或者作为一个新项目加入作为一个毕业项目,项目必须符合孵化阶段标准以及: 有来自至少两个机构的提交者。 已经实现并维护了核心基础结构计划(CII)...

    jzman 评论0 收藏0
  • 第四章网络安全学习笔记(超详细)

    摘要:网关欺骗主要是局域网与外界通信时,伪造假。因不在同网络,无法使用嗅探工具获得数据包,,存在盲目性。 ---------------------------网络安全-...

    techstay 评论0 收藏1

发表评论

0条评论

社区管理员

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<