id: inertiajs-detect

info:
  name: Inertia.js - Detect
  author: antonkulyk,marcialpaulg
  severity: info
  description: |
    Detected Inertia.js passively using a single plain GET request with no special headers. It matched four server-emitted Inertia-specific signals on the initial document: three proximity-bound body patterns covering the embedded page object formats and one `Vary: X-Inertia` response header signal set by supported middleware adapters.
  reference:
    - https://inertiajs.com/
    - https://inertiajs.com/the-protocol
    - https://github.com/inertiajs/inertia
    - https://github.com/inertiajs/inertia-laravel
  metadata:
    max-request: 1
    product: inertia
    vendor: inertiajs
    shodan-query: html:"&quot;component&quot;" html:"data-page"
  tags: tech,inertiajs,inertia

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

    host-redirects: true
    max-redirects: 2

    matchers-condition: or
    matchers:
      - type: regex
        part: body
        regex:
          - 'data-page="[^"]*&quot;component&quot;[^"]*&quot;props&quot;[^"]*&quot;url&quot;'

      - type: regex
        part: body
        regex:
          - 'data-page=''[^'']*"component":[^'']*"props":[^'']*"url":'

      - type: regex
        part: body
        regex:
          - '<script[^>]*data-page=["''][^>]*>[^<]*"component":[^<]*"props":[^<]*"url":'

      - type: regex
        part: header
        regex:
          - '(?im)^vary:[^\r\n]*x-inertia'
# digest: 4a0a0047304502200d657a4c3e3a50a9436b90b899f0cbf698a285349b0868c044cfdd5f43fc56d3022100cfb1775c7d076834ba9d69b07431c1443752c43d8d311974b8f287f5c41f469b:922c64590222798bb761d5b6d8e72950