SiteStar V2.0没有正确限制文件的上传,远程攻击者可能利用此漏洞上传任意文件到Web目录,最终导致在服务器上执行任意命令。
/script/multiupload/uploadify.php 文件:
<?php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_POST['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
// 解决Windows中文文件名乱码
if (preg_match("/^WIN/i", PHP_OS)) {
$targetFile = iconv('UTF-8', 'GBK', $targetFile);
}
move_uploaded_file($tempFile, $targetFile);
echo "1";
}
?>
SiteStar V2.0 beta
过滤非法文件
暂无评论