概述
CVE-2021-1732 是蔓灵花(BITTER)APT 组织在某次被披露的攻击行动中使用的 0day 漏洞,该高危漏洞可以在本地将普通用户进程的权限提升至最高的 SYSTEM 权限。
受影响版本
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
Windows Server, version 1909 (Server Core installation)
Windows 10 Version 1909 for ARM64-based Systems
Windows 10 Version 1909 for x64-based Systems
Windows 10 Version 1909 for 32-bit Systems
Windows Server 2019 (Server Core installation)
Windows Server 2019
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 Version 1803 for ARM64-based Systems
Windows 10 Version 1803 for x64-based Systems
漏洞原理
-
漏洞发生在 Windows 图形驱动 win32kfull!NtUserCreateWindowEx 中。
-
当驱动 win32kfull.sys 调用 NtUserCreateWindowEx 创建窗口时会判断tagWND->cbWndExtra(窗口实例额外分配内存数),该值不为空时调用 win32kfull!xxxClientAllocWindowClassExtraBytes 函数回调用户层 user32.dll!__xxxClientAllocWindowClassExtraBytes 创建内存,分配后的地址使用 NtCallbackReturn 函数修正堆栈后重新返回内核层并保存并继续运行,而当 tagWND->flag 值包含0x800属性时候对该值采用 offset 寻址。
-
使用 NtUserConsoleControl 修改 flag 包含0x800属性。
总的来说,漏洞是由 win32kfull!xxxCreateWindowEx 函数内一处由用户态回调导致的 flag 位设置与对应偏移设置不同步所导致的。
环境搭建
-
Linux操作系统(kali)
-
Windows 10 操作系统(1909)
-
利用工具
https://github.com/Ascotbe/Kernelhub
在msdn下载1909镜像然后进行安装
漏洞复现
创建一个普通的用户并且登录
运行git上下载的 exe 文件,执行 whoami 命令,发现成功由普通用户权限提升到了系统权限。
利用该工具,我们可以把普通用户 test 加入到管理员组中,来达到提权管理员的目的。
查看是否成功加入到管理员用户组中,发现加入成功。
由于在运行改脚本的时候,是提权到系统权限的,所以我们还可以来运行 MSF 生成的后门文件,来达到不需要其他提权方式就达到获取系统权限的 shell 效果。
修复建议
打微软官方的补丁
https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-1732
- End -
点击下方名片,发送“交流”可加入交流群
原文始发于微信公众号(NS Demon团队):Windows本地提权(CVE-2021-1732)漏洞复现
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论