远程打印机漏洞复现

CVE-2021-1675复现
  复现用例参考:
  C++用例:https://github.com/hayasec/PrintNightmare
  python用例:https://github.com/cube0x0/CVE-2021-1675
  该漏洞发生在AddPrinterDriverEx函数,当第三参数传入APD_INSTALL_WARNED_DRIVER = 0x00008000时,会绕过Access的检查,成功调用InternalAddPrinterDriverEx进行DLL加载,该函数可以通过rpc的MS-RPRN协议的RpcAddPrinterDriverEx函数进行调用,MS-RPRN的guid为12345678-1234-ABCD-EF00- 0123456789AB,使用通过管道\pipe\spoolss进行rpc传输,其中例子1使用tcpip协议,例子2使用smb协议进行rpc调用
  测试如下:
  例子1:

   流量如下:

  例子2:

  使用的SMB3加密流量,无法从流量观察到攻击信息

 
二、CVE-2021-34527(PrintNightmare)复现
  该漏洞的POC使用Mimikatz中的RpcAsyncAddPrinterDriver进行复现,该API同样可以设置APD_INSTALL_WARNED_DRIVER,绕过权限检查,实现恶意DLL加载和代码执行,RpcAsyncAddPrinterDriver为MS-PAR协议的RPC调用,GUID为76F03F96-CDFD-44FC-A22C-64950A001209。
  测试用例:mimikatz

 
  其中流量如下:

 
三、参考:
  https://www.freebuf.com/vuls/279876.html
  https://422926799.github.io/posts/c257aa46.html

posted on 2023-12-05 00:24  ciyze0101  阅读(6)  评论(0编辑  收藏  举报

导航