id: moodle-changelog

info:
  name: Moodle Changelog File Detect
  author: oppsec,lap1nou
  severity: info
  description: |
    Moodle has a file which describes API changes in core libraries and APIs, and can be used to discover Moodle version.
  reference:
    - https://moodledev.io/general/development/upgradenotes
    - https://moodle.atlassian.net/browse/MDL-81125
    - https://github.com/moodle/moodle
  metadata:
    verified: true
    max-request: 2
  tags: moodle,exposure,misc,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/lib/upgrade.txt"
      - "{{BaseURL}}/UPGRADING.md"

    stop-at-first-match: true

    matchers-condition: or
    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(tolower(content_type), "text/plain")'
          - 'contains(body, "This files describes API changes")'
        condition: and

      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(tolower(content_type), "text/")'
          - 'contains(body, "Developer update notes")'
        condition: and
# digest: 4a0a00473045022002b152907e31dd501ee822be9ecd04c4b7ec1e05380d3ad5fa1b9caaf74a3329022100e258dcef2de73bc3320526fc5a8350eb0acf546b8ec01d14e90616bddbfcf8c1:922c64590222798bb761d5b6d8e72950