id: gitbook-detect

info:
  name: GitBook Detect
  author: ffffffff0x,daffainfo
  severity: info
  description: GitBook is a collaborative documentation tool that allows anyone to document anything—such as products and APIs—and share knowledge through a user-friendly online platform.
  reference: https://www.gitbook.com/
  classification:
    cpe: cpe:2.3:a:gitbook:gitbook:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: gitbook
    product: gitbook
    shodan-query: http.title:"gitbook"
    fofa-query: app="Introduction-GitBook"
  tags: tech,gitbook

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

    matchers-condition: or
    matchers:
      - type: word
        part: body
        words:
          - 'gitbook.page.hasChanged'
          - '<meta name="generator" content="GitBook'
        condition: and

      - type: regex
        part: body
        regex:
          - "<title>.*[Gg]it[bB]ook</title>"
          - "<title>.*· [Gg]it[bB]ook.*</title>"
        condition: or

    extractors:
      - type: regex
        group: 1
        regex:
          - '<meta name="generator" content="GitBook ([0-9.]+)">'
          - '(?m)<meta name=generator content="GitBook ([0-9.]+)">'
# digest: 4a0a0047304502206c29dc0554bdbcfe515d52a51a6c9b0dafefd48ec48aae33e87a69c5e208e83f022100ddd37cf5f1a8b63aa05932d7b8763b548ec791e4c27bb2c682c46da10d72e987:922c64590222798bb761d5b6d8e72950