Windows 远程桌面授权服务远程代码执行漏洞(CVE-2024-38077)

一、漏洞描述

微软披露最新的远程代码执行超高危漏洞CVE-2024-38077, CVSS评分高达9.8 ,可导致开启了远程桌面许可服务的Windwos服务器完全沦陷。漏洞影响Windows Server 2000到Windows Server 2025所有版本,已存在近30年。该漏洞可稳定利用、可远控、可勒索、可蠕虫等,破坏力极大,攻击者无须任何权限即可实现远程代码执行。

漏洞编码CVE-2024-38077CVE-2024-38077Windows 内核权限提升漏洞:CVE-2024-38153

漏洞类型:远程代码执行

影响范围:开启Windows Remote Desktop Licensing(RDL)Service 的Windows服务器,Windows Server 2000 - Windows Server 2025,具体如下:

Windows Serversion 2008 6.0.0 < version < 6.0.6003.22769
Windows Serversion 2008 R2 6.1.0 < version < 6.1.7601.27219
Windows Serversion 2012 6.2.0 < version < 6.2.9200.24975
Windows Serversion 2012 R2 6.3.0 < version < 6.3.9600.22074
Windows Serversion 2016 10.0.0 < version <10.0.14393.7159
Windows Serversion 2022 10.0.0 < version <10.0.20348.2582

开启该服务(Windows 远程桌面授权服务)并且操作系统版本在受影响范围的 Windows Server 受影响,没有开启该服务但是操作系统版本在受影响范围的Windows Server 不受影响,Windows 10、Windows 11 等非 Server 版本的操作系统,不论是否开启Windows 远程桌面(RDS),均不受影响。

综合风险评价:<利用难度>:容易;<威胁等级>:严重;高危漏洞

这一漏洞存在于Windows远程桌面许可管理服务(RDL)中,该服务被广泛部署于开启Windows远程桌面(3389端口)的服务器,用于管理远程桌面连接许可。攻击者无需任何前置条件,无需用户交互(零点击)便可直接获取服务器最高权限,执行任意操作。建议尽快通过官网公告更新安全补丁。深信服已率先提供解决方案,可通过相应产品进行防护。

二、漏洞复现及处理

2.1 漏洞复现

在这里插入图片描述
利用过程:Windows远程桌面许可服务在解码用户输入的许可密钥包时,会将用户输入的编码后的许可密钥包解码并存储到缓冲区上,但是在存储前没有正确地检验解码后数据长度与缓冲区大小之间的关系,导致缓冲区可以被超长的解码后数据溢出。攻击者可以利用这个漏洞进一步实现远程命令执行攻击。

2.2 漏洞排查

1)”Win+R”组合键调出“运行”,输入“winver”后执行确定,检查对应系统版本是否在上文中提到的漏洞影响范围内。

2)在服务器管理-角色管理里确认如下远程桌面授权服务(Remote Desktop License
Service/RDL)没有被安装使用,且未启用即可,启用时RDL会监听随机高位
端口;安装完成后,服务 Name为“TermServLicensing”,Display Name 为“Remote Desktop Licensing”,如非必要可禁用该服务。
在这里插入图片描述

在这里插入图片描述
或者通过命令行powershell来查看:Get-WindowsFeature -Name RDS-Licensing看到的状态为非installed且前面显示未选中,即当前未启用该功能,如下所示:

在这里插入图片描述

3)在“设置”-“更新与安全”-”Windows更新”-“更新历史”中检查是否存在以下表格中对应的系统补丁。现场为windows server2012 R2,如果存在以下补丁(KB5040569,内包括了 2024 年 6 月 11 日发布的更新KB5039294),则证明漏洞已修复。
在这里插入图片描述
漏洞补丁参考:
在这里插入图片描述

没有的手动下载KB5040569补丁包

在这里插入图片描述

上述补丁包可替换如下:
2023-适用于 Windows Server 2012 R2 的 02 服务堆栈更新,适合基于 x64 的系统 (KB5022922)
Windows Server 2012 R2 更新程序 (KB3021910)
2022-适用于 Windows Server 2012 R2 的 05 服务堆栈更新,适合基于 x64 的系统 (KB5014025)
2022-适用于 Windows Server 2012 R2 的 04 服务堆栈更新,适合基于 x64 的系统 (KB5012672)
2022-适用于 Windows Server 2012 R2 的 07 服务堆栈更新,适合基于 x64 的系统 (KB5016264)
2020-适用于 Windows Server 2012 R2 的 07 服务堆栈更新,适合基于 x64 的系统 (KB4566425)
2022-适用于 Windows Server 2012 R2 的 10 服务堆栈更新,适合基于 x64 的系统 (KB5018922)
2021-适用于 Windows Server 2012 R2 的 04 服务堆栈更新,适合基于 x64 的系统 (KB5001403)
2023-适用于 Windows Server 2012 R2 的 03 服务堆栈更新,适合基于 x64 的系统 (KB5023790)
2023-适用于 Windows Server 2012 R2 的 08 服务堆栈更新,适合基于 x64 的系统 (KB5029368)
2023-适用于 Windows Server 2012 R2 的 09 服务堆栈更新,适合基于 x64 的系统 (KB5030329)
2024-适用于 Windows Server 2012 R2 的 02 服务堆栈更新,适合基于 x64 的系统 (KB5034866)
2024-适用于 Windows Server 2012 R2 的 03 服务堆栈更新,适合基于 x64 的系统 (KB5035968)
2024-适用于 Windows Server 2012 R2 的 01 服务堆栈更新,适合基于 x64 的系统 (KB5034587)
2023-适用于 Windows Server 2012 R2 的 06 服务堆栈更新,适合基于 x64 的系统 (KB5027574)
2023-适用于 Windows Server 2012 R2 的 11 服务堆栈更新,适合基于 x64 的系统 (KB5032308)
2024-适用于 Windows Server 2012 R2 的 06 服务堆栈更新,适合基于 x64 的系统 (KB5039340)
2019-适用于 Windows Server 2012 R2 的 09 服务堆栈更新,适合基于 x64 的系统 (KB4512938)
2024-适用于 Windows Server 2012 R2 的 04 服务堆栈更新,适合基于 x64 的系统 (KB5037021)
2019-适用于 Windows Server 2012 R2 的 11 服务堆栈更新,适合基于 x64 的系统 (KB4524445)
2020-适用于 Windows Server 2012 R2 的 03 服务堆栈更新,适合基于 x64 的系统 (KB4540725)
2019-适用于 Windows Server 2012 R2 的 10 服务堆栈更新,适合基于 x64 的系统 (KB4521864)
2020-适用于 Windows Server 2012 R2 的 06 服务堆栈更新,适合基于 x64 的系统 (KB4562253)
2019-适用于 Windows Server 2012 R2 的 07 服务堆栈更新,适合基于 x64 的系统 (KB4504418)
2022-适用于 Windows Server 2012 R2 的 09 服务堆栈更新,适合基于 x64 的系统 (KB5017398)
Windows Server 2012 R2 更新程序 (KB3173424)

安装此更新后,Windows Server 可能会影响整个组织的远程桌面连接。 如果在远程桌面网关中使用旧协议 (通过 HTTP) 进行远程过程调用,则可能会发生此问题。 因此,远程桌面连接可能会中断。此问题可能会间歇性发生,例如每 30 分钟重复一次。 在此时间间隔内,登录会话会丢失,用户需要重新连接到服务器。 IT 管理员可以将此跟踪为 TSGateway 服务的终止,该服务因异常代码 0xc0000005而无响应。可禁止通过管道进行连接,以及通过 RD 网关的端口 \pipe\RpcProxy\3388。或者,编辑客户端设备的注册表(HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client),并将 RDGClientTransport 的值设置为 0x00000000 (0)

现场看最新的是KB3118401,从官网查询确认后并非最新:
在这里插入图片描述
在这里插入图片描述

有小伙伴反馈,上述2012 R2更新会出现重启后回退安装失败的情况,请参照:Windows 更新挂起,重启后卸载新更新的方法排查,或查看windowsupdate。log

在这里插入图片描述

三、2024年8月近期其他windows漏洞

1)Windows TCP/IP 协议栈远程执行代码漏洞(CVE-2024-38063)

漏洞等级:高危
漏洞描述:Windows TCP/IP 协议栈存在整数溢出漏洞,该漏洞会影响 Windows TCP/IP 堆栈,允许未经身份验证的攻击者通过发送特制的 IPv6 数据包在目标系统上执行任意代码。对于启用了 IPv6 的 Windows 系统均受影响,由于 Windows 默认启用了 IPv6 协议栈支持;对于拥有公网 IPv6 地址的 Windows 系统受此漏洞影响,对于无公网 IPv6 地址但是拥有 IPv6 本地链接地址(以fe80::开头)也受影响。禁用 IPv6 的系统不受此漏洞的影响。

修复,官方已补发补丁,参看CVE-2024-38063,一般会出现在你的windows更新里,直接更新就行;安装此更新后,可能无法更改用户帐户个人资料图片,错误代码为 0x80070520。
在这里插入图片描述
2)windows更新补丁安装失败: Windows 安装下列更新失败,错误为 0x800F0840

0x800F0840错误代码,表示安装Windows更新时出现问题。这通常意味着更新包已损坏或与你的系统不兼容。此错误的一些可能原因是:

A faulty or outdated device driver
A malware infection or a virus
A damaged or missing system file
A network or firewall issue
A low disk space or memory

处理,更多参看::

  • Run the Windows Update troubleshooter to diagnose and fix common problems with Windows Update1
  • Download and install the update manually from the Microsoft Update Catalog2.
  • Run the System File Checker (SFC) and the Deployment Image Servicing and Management (DISM) tools to scan and repair system files3.
  • Update your device drivers to the latest version using Device Manager or a third-party tool4.
  • Perform a clean boot to start Windows with a minimal set of drivers and services.
  • Free up some disk space by deleting temporary files, uninstalling unused programs, or using Disk Cleanup.
  • Increase your virtual memory by adjusting the paging file size.

升级完成效果如下,出现OS 内部版本 17763.6189即可:
在这里插入图片描述
3)对于windows server2012 R2修复漏洞CVE-2024-38153时报错不适用该版本

需要更新官方补丁之前,先更新你的操作系统安装最新的服务堆栈更新 (SSU) 。 因SU 提高了更新过程的可靠性,以缓解安装每月汇总并应用Microsoft安全修补程序时的潜在问题。下载 2024-适用于 Windows Server 2012 R2 的 08 服务堆栈更新,适合基于 x64 的系统 (KB5041588)
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

之后再安装补丁KB5041828就可以了,此累积安全更新包括 2024 年 7 月 9 日发布的更新KB5040456 的改进,同时修复 CVE-2024-37968漏洞,如下所示:
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

现场测试未通过,更新卡在升级后重启的用户界面进入配置过程中,超时自动回退,无法完成更新,报错Error 0x800f0922 (CBS_E_INSTALLERS_FAILED) ,该代码表示:当安装 Windows 更新时计划任务中断导致报出错误 0x800f0922,相关错误信息回写入到 CBS.log( C:\WINDOWS\Logs\CBS)文件,;待进一步调试。
在这里插入图片描述
Windows update getting rolled back on windows server 2012 R2 Servers;Error detail: Code 800F0922;错误代码800F0922表示Windows Update在安装更新时遇到了问题,这可能是由于网络连接问题、安全软件阻止更新、系统文件损坏或其他问题造成的。有时,安全软件可能会阻止Windows Update的安装。运行Windows Update故障排除工具。Windows Update疑难解答工具可以自动检测并修复与Windows Update相关的问题。BIOS里DISABLE SECURE BOOT重启后尝试;在这里插入图片描述

#Run as administrator运行如下命令,重置windows升级组件
net stop bits
net stop wuauserv
net stop appidsvc
net stop cryptsvc
taskkill /im wuauclt.exe /f
del /s /q /f "%ALLUSERSPROFILE%\ApplicationData\Microsoft\Network\Downloader\qmgr*.dat"
del /s /q /f "%ALLUSERSPROFILE%\Microsoft\Network\Downloader\qmgr*.dat"
del /s /q /f "%SYSTEMROOT%\winsxs\pending.xml.bak"
rmdir /s /q "%SYSTEMROOT%\SoftwareDistribution.bak"
rmdir /s /q "%SYSTEMROOT%\system32\Catroot2.bak"
del /s /q /f "%SYSTEMROOT%\WindowsUpdate.log.bak"
takeown /f "%SYSTEMROOT%\winsxs\pending.xml"
attrib -r -s -h /s /d "%SYSTEMROOT%\winsxs\pending.xml"
ren "%SYSTEMROOT%\winsxs\pending.xml" pending.xml.bak
attrib -r -s -h /s /d "%SYSTEMROOT%\SoftwareDistribution"
ren "%SYSTEMROOT%\SoftwareDistribution" SoftwareDistribution.bak
attrib -r -s -h /s /d "%SYSTEMROOT%\system32\Catroot2"
ren "%SYSTEMROOT%\system32\Catroot2" Catroot2.bak
attrib -r -s -h /s /d "%SYSTEMROOT%\WindowsUpdate.log"
ren "%SYSTEMROOT%\WindowsUpdate.log" WindowsUpdate.log.bak
sc.exe sdset wuauserv D:(A;CI;CCLCSWRPLORC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)S:(AU;FA;CCDCLCSWRPWPDTLOSDRCWDWO;;;WD)
sc.exe sdset bits D:(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)S:(AU;SAFA;WDWO;;;BA)
sc.exe sdset cryptsvc D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;CCLCSWRPWPDTLOCRRC;;;SO)(A;;CCLCSWLORC;;;AC)(A;;CCLCSWLORC;;;S-1-15-3-1024-3203351429-2120443784-2872670797-1918958302-2829055647-4275794519-765664414-2751773334)
sc.exe sdset trustedinstaller D:(A;CI;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCDCLCSWRPWPDTLOCRRC;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)S:(AU;SAFA;WDWO;;;BA)
cd /d %SYSTEMROOT%\system32
regsvr32.exe /s atl.dll
regsvr32.exe /s urlmon.dll
regsvr32.exe /s mshtml.dll
regsvr32.exe /s shdocvw.dll
regsvr32.exe /s browseui.dll
regsvr32.exe /s jscript.dll
regsvr32.exe /s vbscript.dll
regsvr32.exe /s scrrun.dll
regsvr32.exe /s msxml.dll
regsvr32.exe /s msxml3.dll
regsvr32.exe /s msxml6.dll
regsvr32.exe /s actxprxy.dll
regsvr32.exe /s softpub.dll
regsvr32.exe /s wintrust.dll
regsvr32.exe /s dssenh.dll
regsvr32.exe /s rsaenh.dll
regsvr32.exe /s gpkcsp.dll
regsvr32.exe /s sccbase.dll
regsvr32.exe /s slbcsp.dll
regsvr32.exe /s cryptdlg.dll
regsvr32.exe /s oleaut32.dll
regsvr32.exe /s ole32.dll
regsvr32.exe /s shell32.dll
regsvr32.exe /s initpki.dll
regsvr32.exe /s wuapi.dll
regsvr32.exe /s wuaueng.dll
regsvr32.exe /s wuaueng1.dll
regsvr32.exe /s wucltui.dll
regsvr32.exe /s wups.dll
regsvr32.exe /s wups2.dll
regsvr32.exe /s wuweb.dll
regsvr32.exe /s qmgr.dll
regsvr32.exe /s qmgrprxy.dll
regsvr32.exe /s wucltux.dll
regsvr32.exe /s muweb.dll
regsvr32.exe /s wuwebv.dll
netsh winsock reset
proxycfg.exe -d
sc.exe config wuauserv start= auto
sc.exe config bits start= delayed-auto
sc.exe config cryptsvc start= auto
sc.exe config TrustedInstaller start= demand
sc.exe config DcomLaunch start= auto
net start bits
net start wuauserv
net start appidsvc
net start cryptsvc
net start DcomLaunch
del /s /f /q "%TEMP%\*.*"
del /s /f /q "%SYSTEMROOT%\Temp\*.*"

参考链接How to fix Windows Update Error 0x800f0922

现场验证即使关闭防火墙也无效,且CBS日志里无明显错误,定位困难,未不必要的时间浪费,故将2012 R2升级到windows server 2019,之后就可以直接在“系统更新”里看到该漏洞的补丁包,不需要再手动打补丁了,如下所示:
在这里插入图片描述

评论 18
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

羌俊恩

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值