2020数字中国创新大赛-虎符网络安全赛道丨Web Writeup

本文是i春秋论坛作家「OPLV1H」表哥参加2020数字中国创新大赛-虎符网络安全赛道线上初赛的赛后总结,关于Web的Writeup记录,感兴趣的小伙伴快来学习吧。

2020数字中国创新大赛-虎符网络安全赛道丨Web Writeup_第1张图片

1、hash_file — 是使用给定文件的内容生成哈希值,和文件名称无关。

2、jwt令牌结构和jwt_tools的使用。

3、nodejs沙箱溢出进行Getshell。

正 文

Web 1 BabyUpload

直接贴出源码

getMessage();
}
} elseif ($direction === "download") {
try{
    $filename = basename(filter_input(INPUT_POST, 'filename'));
    $file_path = $dir_path."/".$filename;
    if(preg_match('/(\.\.\/|\.\.\\\\)/', $file_path)){
        throw new RuntimeException('invalid file path');
    }
    if(!file_exists($file_path)) {
        throw new RuntimeException('file not exist');
    }
    header('Content-Type: application/force-download');
    header('Content-Length: '.filesize($file_path));    header('Content-Disposition: attachment; filename="'.substr($filename, 0, -65).'"');
    if(readfile($file_path)){
        $download_result = "downloaded";
    }else{
        throw new RuntimeException('error while saving');
    }
} catch (Run![](https://xzfile.aliyuncs.com/media/upload/picture/20200422224456-d5ccdef2-84a7-1.png)timeException $e) {
    $download_result = $e->getMessage();
}
exit;
}
?>

题目大概的逻辑就是先将session存储在/var/babyctf/中&#x

你可能感兴趣的:(web安全,前端,安全)