id: xwiki-detect

info:
  name: XWiki - Detection
  author: matejsmycka
  severity: info
  description: |
    XWiki Platform was discovered.
  metadata:
    verified: true
    max-request: 2
    vendor: xwiki
    product: xwiki
    shodan-query: html:"data-xwiki-reference"
    fofa-query: body="data-xwiki-reference"
  tags: xwiki,detect,tech

http:
  - method: GET
    path:
      - "{{BaseURL}}"
      - "{{BaseURL}}/xwiki/"

    host-redirects: true
    max-redirects: 2

    stop-at-first-match: true

    matchers-condition: and
    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200 || status_code == 401'
          - 'contains(body, "xwikiplatformversion")'
        condition: and

    extractors:
      - type: regex
        group: 1
        regex:
          - '<html.*?data-xwiki-page="(.*?)"'
# digest: 4a0a004730450221009c84fdfaf1740a1583d8bf5e02777b08284bc5d9f9bf45ff56621ee5874703850220207989fb0894782687d6767cc8780b9f2ee9131d1a44ff9eaafb3d4a8a8c16de:922c64590222798bb761d5b6d8e72950