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,discovery

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: 490a0046304402205927c56cafbb79abdc06a86c50c7c5f1b4b0689092a6246051cd1e4782c71730022022fa1098b91271c0c548ef051b0a69aafdb986ff80563349c41685b462649291:922c64590222798bb761d5b6d8e72950