当前位置:网站首页>Offensive and defensive world - leaking
Offensive and defensive world - leaking
2022-08-08 08:04:00 【Stealth rookie】
Enter the environment and give a piece of code
On npm,vm, vm2, Node.js sandbox escape
This is a question about Node.js sandbox escapes.Where var { VM } = require("vm2"); is the library of the official Node.js security sandbox (it is the code related to the Node.js sandbox)
In earlier node versions (before 8.0), when the Buffer constructor passes in a number, it will get a Buffer with the same length as the number, and this Buffer is not cleared
After 8.0The version can get the unemptied memory through another function Buffer.allocUnsafe(size)
Lower versions of node can use buffer() to view the memory. As long as the variables that have been called will exist in the memory, then a payload can be constructed to read the memory.
The limit of req.query.data.length can be passed throughEnter array bypass
1. The title obtains a string of code through access, this code prompts to be executed in the sandbox.
2. Due to the isolation mechanism of the sandbox, functions of the operating system such as eval() cannot be executed.
3. To get the flag, you need to let eval() execute.Use the escape sandbox vulnerability to get the flag.
After reading other people's problem-solving ideas, through the script, I found the eval() function executed when the memory leaked, and got the flag.
import requestsimport timeurl = 'http://ip:port/?data=Buffer(500)'response = ''while 'flag' not in response:req = requests.get(url)response = req.textprint(req.status_code)time.sleep(0.1)if 'flag{' in response:print(response)break
边栏推荐
猜你喜欢
随机推荐
BOSS直聘回应女大学生被性骚扰:高度重视求职者安全 可在App举报
mysql三种安装方式 你知道了哪种
数据治理(三):数据质量管理
C语言——按照指定分割符分割字符串
CesiumJS 更新日志 1.96 与 1.97 - 新构建工具 esbuild 体验及 Model API 更替完成
大文件上传时如何做到 秒传?
Spark2 struct SQL processing
攻防世界——leaking
oracle如何删除表并且释放表空间
js中call、bind、apply的区别?
WinForm(四)一种实现登录的方式
浏览器中输入URL后到底发生了什么?
阿里巴巴需求交付全流程职责划分
Task02:PyTorch进阶训练技巧
IIC通讯协议与EEPROM简介
The industry's first "Causal Inference Whole Process" Challenge!WAIC 2022 · Hackathon invites global developer elites to challenge
HTTS 为什么更安全?
XXL-JOB入门教学
jupyter notebook处理文件导致IOPub data rate exceeded
[Optimized scheduling] Based on particle swarm to realize economic scheduling optimization of microgrid under grid-connected model with matlab code