[随波逐流]CTF Flags

   [随波逐流]CTF Flags

软件版本:v1.0.0   数据版本: v20260201
返    回

web695

 广告模块
ID: 4356
标题: web695
描述: > 某赛某题 **此系列题目均收集自互联网,且进行了深度二开,直接搜答案提交是不行的** ``` router.post('/uploadfile', async (ctx, next) => { const file = ctx.request.body.files.file; if (!fs.existsSync(file.path)) { return ctx.body = "Error"; } if(file.path.toString().search("/dev/fd") != -1){ file.path="/dev/null" } const reader = fs.createReadStream(file.path); let fileId = crypto.createHash('md5').update(file.name + Date.now() + SECRET).digest("hex"); let filePath = path.join(__dirname, 'upload/') + fileId const upStream = fs.createWriteStream(filePath); reader.pipe(upStream) return ctx.body = "Upload success ~, your fileId is here:" + fileId; }); router.get('/downloadfile/:fileId', async (ctx, next) => { let fileId = ctx.params.fileId; ctx.attachment(fileId); try { await send(ctx, fileId, { root: __dirname + '/upload' }); }catch(e){ return ctx.body = "no_such_file_~" } }); ``` 侵删
类型: WEB入门.大赛原题
网站: ctfshow
题目链接: https://ctf.show/api/v1/challenges/1592
赛事: 大赛原题
年度: None
Flag值:
writeup: https://blog.csdn.net/2301_81040377/article/details/140815167
答案错误,我要更正