id: graphql-wpgraphql-detect
info:
  name: Graphql wpgraphql Detect
  author: princechaddha
  severity: info
  reference:
    - https://github.com/dolevf/graphw00f/blob/main/graphw00f/lib.py
  tags: tech,graphql,wordpress

http:
  - method: POST
    path:
      - "{{BaseURL}}/graphql"
      - "{{BaseURL}}/api/graphql"
      - "{{BaseURL}}/query"
      - "{{BaseURL}}/"
    body: '{"query":"query { alias1$1:__typename }"}'
    headers:
      Content-Type: application/json
    redirects: true

    matchers-condition: and
    matchers:
      - type: status
        status:
          - 200
          - 400

      - type: word
        words:
          - 'Syntax Error: Expected Name, found $'
        part: body
# digest: 4a0a00473045022100b95c1eb3d7f7b7dd0d05b404f411b7c74454f4bcaa364e1f0fc8d0f747e1e5ac02204a58586f68555c5dd4ecafe11abf96af5c3181f8366318120db608116c9a8e1a:922c64590222798bb761d5b6d8e72950