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

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

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

      - type: word
        words:
          - 'Syntax Error GraphQL (1:1)'
        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: 4a0a00473045022012e2b64ade43e5fe6a77d2af1d7f0034ede7850f1deee1509f6e7f174f454574022100c485a3324d7f32161cdca3ed7b4b6bdc1ec29cdfd99f96c1a7fe6a1bfdd1780c:922c64590222798bb761d5b6d8e72950