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/
  metadata:
    verified: true
    max-request: 1
    shodan-query: http.title:"gitbook"
    fofa: 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: 490a00463044022051c8db0d578ee59a851dbbc2792ca3e5dea61176125b543fd9f2f0bc62d160dc02204e865046049fcecf4fcf21561162fa2a03f74407923f5ee40c6259a7cbcfc26a:922c64590222798bb761d5b6d8e72950
