0
点赞
收藏
分享

微信扫一扫

【论文笔记】X-Former: Unifying Contrastive and Reconstruction Learning for MLLMs

草原小黄河 2024-11-01 阅读 5

upload-labs靶场Pass-02

分析源码

$is_upload = false;
$msg = null;
if (isset($_POST['submit'])) {
    if (file_exists(UPLOAD_PATH)) {
        if (($_FILES['upload_file']['type'] == 'image/jpeg') || ($_FILES['upload_file']['type'] == 'image/png') || ($_FILES['upload_file']['type'] == 'image/gif')) {
            $temp_file = $_FILES['upload_file']['tmp_name'];
            $img_path = UPLOAD_PATH . '/' . $_FILES['upload_file']['name']            
            if (move_uploaded_file($temp_file, $img_path)) {
                $is_upload = true;
            } else {
                $msg = '上传出错!';
            }
        } else {
            $msg = '文件类型不正确,请重新上传!';
        }
    } else {
        $msg = UPLOAD_PATH.'文件夹不存在,请手工创建!';
    }
}

源码中

可以看出验证方式是文件类型,使用白名单验证
选择上传文件并抓包,修改文件类型可以绕过
上传php文件,本来是不容许的
在这里插入图片描述

抓包
在这里插入图片描述
修改Content-Typr字段为源码中提到的任意一种,放包
查看服务端,有了我们上传的php文件,由此绕过成功
在这里插入图片描述
OVER!

举报

相关推荐

0 条评论