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

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

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

      - type: word
        words:
          - "Unknown directive '@abc'."
        part: body

      - type: word
        words:
          - 'Content-Type: text/html'
        part: header
        negative: true

      - type: word
        words:
          - '<html'
          - '<body'
        part: body
        condition: or
        negative: true
# digest: 4b0a00483046022100c785504f5b2af4eae915cfe152089af1dae4f01da595bb6aedbd6e0c3bd2fa22022100843879b27c14e543914f4ff57feecc2886bc33ce07a3cfec9a874bbe50d3f160:922c64590222798bb761d5b6d8e72950