id: inertiajs-detect

info:
  name: Inertia.js - Detect
  author: antonkulyk
  severity: info
  description: |
    Detects Inertia.js, a stack for building single-page apps using classic server-side routing. Matching targets the server-rendered page payload embedded in the root element's data-page attribute (JSON with component, props, and url keys), which is the default integration pattern for adapters such as Laravel's inertia-laravel.
  reference:
    - https://inertiajs.com/
    - 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: word
        part: body
        words:
          - 'data-page="'
          - '&quot;component&quot;'
          - '&quot;props&quot;'
          - '&quot;url&quot;'
        condition: and

      - type: regex
        part: body
        regex:
          - "(?is)data-page\\s*=\\s*\"(?:[^\"\\\\]|\\\\.)*\\\\\"component\\\\\"(?:[^\"\\\\]|\\\\.)*\\\\\"props\\\\\"(?:[^\"\\\\]|\\\\.)*\\\\\"url\\\\\""
# digest: 490a00463044022005bb2a6b3783297e7f6d9cdf10e9899892a88549ec28211af6be1c83e0bc282c02201da00a9d22f8c045a0685cbcd021172c1fb9f1af90a6ff339dc390254efe2dd9:922c64590222798bb761d5b6d8e72950