<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>蠕虫 on SHELLPUB BLOG</title>
    <link>/tags/%E8%A0%95%E8%99%AB/</link>
    <description>Recent content in 蠕虫 on SHELLPUB BLOG</description>
    <generator>Hugo -- gohugo.io</generator>
    <copyright>&amp;copy; 2017. All rights reserved.</copyright>
    <lastBuildDate>Fri, 17 Jul 2020 13:45:36 +0800</lastBuildDate>
    
	<atom:link href="/tags/%E8%A0%95%E8%99%AB/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Windows DNS Server&#34;蠕虫级&#34;漏洞通知，请马上升级</title>
      <link>/2020/07/17/windows_dns_vuln.html</link>
      <pubDate>Fri, 17 Jul 2020 13:45:36 +0800</pubDate>
      
      <guid>/2020/07/17/windows_dns_vuln.html</guid>
      <description> Windows DNS Server &amp;ldquo;蠕虫级&amp;rdquo;漏洞通知，请马上升级  某些情形下，企业DNS Server和域控处于内网同一台服务器中，SIGRed漏洞影响的组件dns.exe是以System权限运行，目前网络上已有PoC公开，建议用户尽快升级，避免由于该漏洞导致域控沦陷。
 简介 微软公司在本月的安全补丁推送中修复了一个长达17年的“蠕虫级”漏洞。据国外研究机构checkpoint描述成功利用SIGRed漏洞可以达到远程提权的效果。其影响几乎市面上主流的所有Windows Server版本（Windows Server 2008 、2012、2016、2019以及之后的Windows Server, version 1903、1909、2004）。目前网络已经有公开的dns拒绝服务PoC代码，请务必重视！
漏洞原理简述 在Windows系统中，DNS客户端主要实现在dnsspi.dll中，而DNS服务端是由dns.exe负责响应和处理请求。而SIGRed漏洞就发生在dns.exe!SigWireRead函数。
可以看到RR_AllocateEx分配内存是通过16位寄存器cx，如果我们这里可以控制其第一个参数大于0xffff，那么就会产生整数溢出，紧接会触发到后面的memcpy导致崩溃。
触发漏洞 引用checkpoint的研究，利用DNS Pointer Compression。这里主要是一种类似指针指向的压缩编码方式。
c00c其中0xc0是引用这个packet内部值的标识。0x0c是基于dns header偏移位置，这里指向 () chain。也就是下图划线的部分。其中08是size，research是value。如果我们修改0x0c为0x0d，那么size就变成0x72,这就是导致unCompression数据长度发生变化，触发整数溢出。
处置建议  升级微软官方最新补丁
 临时处置建议
  通过设置注册表临时缓解，然后重启dns服务
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters DWORD = TcpReceivePacketSize Value = 0xFF00  如之后升级补丁，删除HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters即可。
参考 https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2020-1350
https://research.checkpoint.com/2020/resolving-your-way-into-domain-admin-exploiting-a-17-year-old-bug-in-windows-dns-servers/
关注我们 </description>
    </item>
    
  </channel>
</rss>