GLPI 0.85.5 上传漏洞分析
在exp-db上面看到的漏洞,这是原文链接:https://www.exploit-db.com/exploits/38407/
但是POC给的很简单,这是原来的描述:
"
The application allows users to upgrade their own profile. The user has
the possibility to add a new photo as attachment.
The photo that he uploads will be stored into "GLPI_ROOT/files/_pictures/".
This file, for example named "photo.jpeg", will be directly accessible
through "http://host/GLPI_ROOT/files/_pictures/XXXX.jpeg", where "XXXX"
is an ID automatically generated by the system and visible in the HTML
source code.
Besides, the server does not check the extension of the uploaded file,
but only the first bytes within it, that indicates which kind of file is.
Exploiting this flaw, an attacker may upload a tampered jpeg file that
contains php code placed at the end of the file, so that, just changing
the file extention to ".php", by default the php code will be interpreted!
To trigger this vulnerability it is necessary to have an account.
This vulnerability is a combination of two issues:
- predictable uploaded file names and path
- upload of any kind of file, not limited to images
"
大概意思就是说对上传的文件不检查后缀,只检查文件内容的前一个字节,如果判定是合法内容就会上传,利用方式就是在一个正常的图片文件后面加入PHP代码即可,而且路径也好找。
本着要对漏洞形成原因知根知底的态度,还是需要看看源码的,问题是在./inc/user.class.php中
关键代码如下:
// Move uploaded file
$filename = $this->fields['id'];
$tmp = explode(".", $_FILES['picture']['name']);
$extension = array_pop($tmp); //获取原始文件的后缀
$picture_path = GLPI_PICTURE_DIR."/$filename.".$extension; //直接拼接原来的后缀
self::dropPictureFiles($filename.".".$extension);
也不知道是开发人员忘了处理后缀还是怎么回事,估计也有可能是想对图片内容做二次渲染,所以就算是原来的后缀也可以不尿恶意攻击者,然而开发者忘了?
总之上传洞就这么产生了~~
GLPI 0.85.5 上传漏洞分析的更多相关文章
- 【代码审计】JTBC(CMS)_PHP_v3.0 任意文件上传漏洞分析
0x00 环境准备 JTBC(CMS)官网:http://www.jtbc.cn 网站源码版本:JTBC_CMS_PHP(3.0) 企业版 程序源码下载:http://download.jtbc. ...
- PHPCMS v9.6.0 任意文件上传漏洞分析
引用源:http://paper.seebug.org/273/ 配置了php debug的环境,并且根据这篇文章把流程走了一遍,对phpstorm的debug熟练度+1(跟pycharm一样) 用户 ...
- 1.5 webshell文件上传漏洞分析溯源(1~4)
webshell文件上传漏洞分析溯源(第一题) 我们先来看基础页面: 先上传1.php ----> ,好吧意料之中 上传1.png ----> 我们查看页面元素 -----> ...
- phpcms v9.6.0任意文件上传漏洞(CVE-2018-14399)
phpcms v9.6.0任意文件上传漏洞(CVE-2018-14399) 一.漏洞描述 PHPCMS 9.6.0版本中的libs/classes/attachment.class.php文件存在漏洞 ...
- 【代码审计】UKCMS_v1.1.0 文件上传漏洞分析
0x00 环境准备 ukcms官网:https://www.ukcms.com/ 程序源码下载:http://down.ukcms.com/down.php?v=1.1.0 测试网站首页: 0x0 ...
- 【代码审计】QYKCMS_v4.3.2 任意文件上传漏洞分析
0x00 环境准备 QYKCMS官网:http://www.qykcms.com/ 网站源码版本:QYKCMS_v4.3.2(企业站主题) 程序源码下载:http://bbs.qingyunke. ...
- 【代码审计】BootCMS v1.1.3 文件上传漏洞分析
0x00 环境准备 BootCMS官网:http://www.kilofox.net 网站源码版本:BootCMS v1.1.3 发布日期:2016年10月17日 程序源码下载:http://w ...
- 【代码审计】CLTPHP_v5.5.3 前台任意文件上传漏洞分析
0x00 环境准备 CLTPHP官网:http://www.cltphp.com 网站源码版本:CLTPHP内容管理系统5.5.3版本 程序源码下载:https://gitee.com/chich ...
- UEditor编辑器两个版本任意文件上传漏洞分析
0x01 前言 UEditor是由百度WEB前端研发部开发的所见即所得的开源富文本编辑器,具有轻量.可定制.用户体验优秀等特点 ,被广大WEB应用程序所使用:本次爆出的高危漏洞属于.NET版本,其它的 ...
随机推荐
- Python list 字符串 注册 登录
#list #列表 python中 数组.array等都用列表 list表示#创建一个liststu = ['xiaoming','xiaoli','xiaohuang','alex','lily', ...
- [Algo] 175. Decompress String II
Given a string in compressed form, decompress it to the original string. The adjacent repeated chara ...
- We don't wanna work!
We don't wanna work! [JAG Asia 2016] 两个set,一个代表工作的,一个代表不工作的 其实是一个很简单的模拟,但是我竟然排序之前标号.... 检查代码的时候要从头开始 ...
- 【网络流+贪心】Homework
题目描述 Taro is a student of Ibaraki College of Prominent Computing. In this semester, he takes two cou ...
- Solving ordinary differential equations I(nonstiff problems),exercise 1.1
Solve equation $y'=1-3x+y+x^2+xy$ with another initial value $y(0)=1$. Solve: We solve this by using ...
- 通过java语言实现MD5加密
通过java语言实现MD5加密public static String getMd5(String str) { try { MessageDigest md5 = MessageDigest.get ...
- LeetCode No.94,95,96
No.94 InorderTraversal 二叉树的中序遍历 题目 给定一个二叉树,返回它的中序 遍历. 示例 输入: [1,null,2,3] 1 \ 2 / 3 输出: [1,3,2] 进阶:递 ...
- python学习笔记(19)-切片
转自https://www.jianshu.com/p/15715d6f4dad 在利用python解决各种实际问题的过程中,经常会遇到从某个对象中抽取部分值的情况,切片操作正是专门用于完成这一操作的 ...
- 项目部署篇之三——安装tomcat7.0
1.下载tomcat 百度云下载 链接:https://pan.baidu.com/s/1UGPYHmR-1ehQRvdKGhSlyQ 提取码:3c0g 直接通过指令下载 wget http://mi ...
- 1.redis安装配置
Redis 1.Redis安装: 说明: 1.也是一种类似于Memcached的kev-value机制的存储服务 2.是非关系型数据库(NoSQL)的一种. 3.官网:www.redis.io,中文网 ...