id: drupal-detect

info:
  name: Drupal - Detect
  author: 1nf1n7y,pathtaga
  severity: info
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
    cwe-id: CWE-200
    cpe: cpe:2.3:a:drupal:drupal:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 4
    vendor: drupal
    product: drupal
    shodan-query:
      - http.component:"drupal"
      - cpe:"cpe:2.3:a:drupal:drupal"
  tags: tech,drupal

http:
  - method: GET
    path:
      - "{{BaseURL}}"
      - "{{BaseURL}}/CHANGELOG.txt"
      - "{{BaseURL}}/core/install.php"
      - "{{BaseURL}}/user/login"

    stop-at-first-match: true
    matchers-condition: or
    matchers:
      - type: word
        part: body
        words:
          - 'Initial release'
          - 'Drupal 1.0.0'
        condition: and

      - type: word
        part: body
        words:
          - 'content="Drupal'

      - type: regex
        part: header
        regex:
          - '(?i)x-drupal'
          - "(?i)x-generator: drupal"
        condition: or

    extractors:
      - type: regex
        part: body
        name: version_by_install
        group: 1
        regex:
          - 'class="site-version">([0-9.x-]+)'
# digest: 4a0a0047304502204b8db21a61d4b068c5516548ab7c78857c358a3c740b002ff0b1e5d9921c6b5c0221009d21f2c0e5cc32167e8f4991987a7af56605b57b7e3db510117c77851ecc5729:922c64590222798bb761d5b6d8e72950