『CVE』简析CVE-2024-48795 SSH协议前缀截断攻击(Terrapin攻击)(1)

文章目录

OpenSSH 9.6更新公告

*ssh(1), sshd(8):

implement protocol extensions to thwart the so-called “Terrapin attack” discovered by Fabian Bäumer, Marcus Brinkmann and Jörg Schwenk. This attack allows a MITM to effect a limited break of the integrity of the early encrypted SSH transport protocol by sending extra messages prior to the commencement of encryption, and deleting an equal number of consecutive messages immediately after encryption starts. A peer SSH client/server would not be able to detect that messages were deleted.


实施协议扩展以挫败 Fabian Bäumer、Marcus Brinkmann 和 Jörg Schwenk 发现的所谓 “Terrapin 攻击”。这种攻击允许中间人(adversary-in-the-middle, MITM) 在加密开始前发送额外信息,并在加密开始后立即删除相同数量的连续信息,从而有限度地破坏早期加密 SSH 传输协议的完整性。对等 SSH 客户端/服务器将无法检测到信息已被删除。

While cryptographically novel, the security impact of this attack is fortunately very limited as it only allows deletion of consecutive messages, and deleting most messages at this stage of the protocol prevents user user authentication from proceeding and results in a stuck connection.


虽然在密码学上很新颖,但幸运的是,这种攻击对安全的影响非常有限,因为它只允许删除连续的报文,而在协议的这一阶段删除大部分报文会阻止用户验证的进行,并导致连接卡死。

The most serious identified impact is that it lets a MITM to delete the SSH2_MSG_EXT_INFO message sent before authentication starts, allowing the attacker to disable a subset of the keystroke timing obfuscation features introduced in OpenSSH 9.5. There is no other discernable impact to session secrecy or session integrity.


已发现的最严重影响是,它使 MITM 能够删除在身份验证开始前发送的 SSH2_MSG_EXT_INFO 消息,使攻击者能够禁用 OpenSSH 9.5 中引入的按键定时混淆功能的一个子集。对会话保密性或会话完整性没有其他明显影响。

OpenSSH 9.6 addresses this protocol weakness through a new “strict KEX” protocol extension that will be automatically enabled when both the client and server support it. This extension makes two changes to the SSH transport protocol to improve the integrity of the initial key exchange.


OpenSSH 9.6 通过新的 **"严格 KEX "**协议扩展解决了这一协议弱点,当客户端和服务器都支持该扩展时,它将自动启用。该扩展对 SSH 传输协议做了两处修改,以提高初始密钥交换的完整性。

Firstly, it requires endpoints to terminate the connection if any unnecessary or unexpected message is received during key exchange (including messages that were previously legal but not strictly required like SSH2_MSG_DEBUG). This removes most malleability from the early protocol.


首先,它要求端点在密钥交换过程中收到任何不必要或意外信息(包括 SSH2_MSG_DEBUG 等以前合法但并非严格要求的信息)时终止连接。这就消除了早期协议的大部分可变性。

Secondly, it resets the Message Authentication Code counter at the conclusion of each key exchange, preventing previously inserted messages from being able to make persistent changes to the sequence number across completion of a key exchange. Either of these changes should be sufficient to thwart the Terrapin Attack.


其次,它在每次密钥交换结束时重置信息验证码计数器,防止先前插入的信息在密钥交换完成后对序列号进行持续更改。无论哪种变化,都足以挫败 Terrapin 攻击。

More details of these changes are in the PROTOCOL file in the OpenSSH source distribition.


有关这些更改的更多详情,请参阅 OpenSSH 源代码发行版中的 PROTOCOL 文件。

Terrapin攻击 (CVE-2023-48795)

基本信息

CVE-2023-48795: BaseScore N/A

CVSS:3.1/N/A

The SSH transport protocol with certain OpenSSH extensions, found in OpenSSH before 9.6 and other products, allows remote attackers to bypass integrity checks such that some packets are omitted (from the extension negotiation message), and a client and server may consequently end up with a connection for which some security features have been downgraded or disabled, aka a Terrapin attack. This occurs because the SSH Binary Packet Protocol (BPP), implemented by these extensions, mishandles the handshake phase and mishandles use of sequence numbers. For example, there is an effective attack against SSH’s use of ChaCha20-Poly1305 (and CBC with Encrypt-then-MAC). The bypass occurs in chacha20-poly1305@openssh.com and (if CBC is used) the -etm@openssh.com MAC algorithms.


在 9.6 之前的 OpenSSH 和其他产品中找到的具有某些 OpenSSH 扩展的 SSH 传输协议允许远程攻击者绕过完整性检查,从而省略某些数据包(来自扩展协商消息),因此客户端和服务器可能最终获得某些安全功能已降级或禁用的连接。 又名 Terrapin 攻击。这是因为这些扩展实现的 SSH 二进制数据包协议 (BPP) 错误地处理了握手阶段,并错误地处理了序列号的使用。例如,针对 SSH 使用 ChaCha20-Poly1305(以及带有 Encrypt-then-MAC 的 CBC)的攻击存在有效攻击。旁路发生在 chacha20-poly1305@openssh.com 和(如果使用 CBC)-etm@openssh.com MAC 算法中。

利用手段

中间人攻击、SSH握手、流量攻击

利用路径

在SSH双方建立安全通道前,有一次明文消息握手,中间人此时向SSH服务器发送X条报文,可以阻止Server在安全通道中发送给Client的前X条消息,可以干扰连接的设置,降低所使用的安全性

握手使用计数器计算收发包数,之后计数器用于验证握手过程是否完整。只要计数正确,允许继续连接。

利用条件

  1. 特定加密算法:ChaCha20-Poly1305和CBC with Encrypt-then-MAC
  2. 攻击者处于中间人位置,可以在 TCP/IP 层拦截和修改连接的流量
  3. 本地网络发起,从Internet发起很困难

The Terrapin attack requires an active Man-in-the-Middle attacker, that means some way for an attacker to intercept and modify the data sent from the client or server to the remote peer. This is difficult on the Internet, but can be a plausible attacker model on the local network.

利用原理及示意图

攻击者可以在初始密钥交换期间注入任意数量的SSH消息,并在交换完成后移除相同数量的消息,从而破坏SSH扩展协商(RFC8308),可降级连接的安全性。

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数网络安全工程师,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年网络安全全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上网络安全知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加VX:vip204888 (备注网络安全获取)
img

盖了95%以上网络安全知识点,真正体系化!**

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加VX:vip204888 (备注网络安全获取)
[外链图片转存中…(img-0l4PVgJs-1712732524971)]

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值