
Outil automatisé d'énumération de schémas GraphQL et d'extraction de données qui parcourt les documents d'introspection, reconstruit les requêtes et enregistre les réponses pour les tests de pénétration et les évaluations de sécurité des API.
Graphicator est un « scraper » / extracteur GraphQL. L'outil parcourt le document d'introspection renvoyé par le point de terminaison GraphQL ciblé, puis restructure le schéma sous une forme interne afin de pouvoir recréer les requêtes prises en charge. Lorsque ces requêtes sont créées, il les utilise pour envoyer des requêtes au point de terminaison et enregistre la réponse renvoyée dans un fichier.
Les réponses erronées ne sont pas enregistrées. Par défaut, l'outil met en cache les réponses correctes ainsi que les erreurs, de sorte que lorsqu'on le réexécute, il ne refasse pas les mêmes requêtes.
Utilisez-le judicieusement et uniquement sur des cibles pour lesquelles vous avez l'autorisation d'interagir.
Nous espérons que l'outil automatisera vos propres tests en tant que testeur d'intrusion et donnera un coup de pouce même à ceux qui ne font pas encore de tests GraphQL.
Pour apprendre à réaliser des évaluations sur les points de terminaison GraphQL : https://cybervelia.com/?p=736&preview=true
python3 -m pip install -r requirements.txt
docker run --rm -it -p8005:80 cybervelia/graphicator --target http://the-target:port/graphql --verbose
Lorsque la tâche est terminée, l'outil compresse les résultats et ce zip est fourni via un serveur web servi sur le port 8005. Pour arrêter le conteneur, appuyez sur CTRL+C. Lorsque le conteneur est arrêté, les données sont également supprimées. Vous pouvez également modifier le port hôte selon vos besoins.
python3 graphicator.py [args...]
La première étape consiste à configurer la cible. Pour cela, vous devez fournir soit une option --target, soit un fichier avec --file.
Setting a single target via arguments
python3 graphicator.py --target https://subdomain.domain:port/graphql
Setting multiple targets
python3 graphicator.py --target https://subdomain.domain:port/graphql --target https://target2.tld/graphql
Setting targets via a file
python3 graphicator.py --file file.txt
Le fichier doit contenir une URL par ligne comme suit :
http://target1.tld/graphql
http://sub.target2.tld/graphql
http://subxyz.target3.tld:8080/graphql
Vous pouvez connecter l'outil à n'importe quel proxy.
Connect to the default burp settings (port 8080)
python3 graphicator.py --target target --default-burp-proxy
Connect to your own proxy
python3 graphicator.py --target target --use-proxy
Connect via Tor
python3 graphicator.py --target target --use-tor
python3 graphicator.py --target target --header "x-api-key:60b725f10c9c85c70d97880dfe8191b3"
python3 graphicator.py --target target --verbose
python3 graphicator.py --target target --multi
python3 graphicator.py --target target --insecure
python3 graphicator.py --target target --no-cache
python3 graphicator.py --target http://localhost:8000/graphql --verbose --multi
_____ __ _ __
/ ___/____ ___ _ ___ / / (_)____ ___ _ / /_ ___ ____
/ (_ // __// _ `// _ \ / _ \ / // __// _ `// __// _ \ / __/
\___//_/ \_,_// .__//_//_//_/ \__/ \_,_/ \__/ \___//_/
/_/
By @fand0mas
[-] Targets: 1
[-] Headers: 'Content-Type', 'User-Agent'
[-] Verbose
[-] Using cache: True
************************************************************
0%| | 0/1 [00:00<?, ?it/s][*] Enumerating... http://localhost:8000/graphql
[*] Retrieving... => query {getArticles { id,title,views } }
[*] Retrieving... => query {getUsers { id,username,email,password,level } }
100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 35.78it/s]
$ cat reqcache/9652f1e7c02639d8f78d1c5263093072fb4fd06c.json
{
"data": {
"getUsers": [
{
"id": 1,
"username": "theo",
"email": "[email protected]",
"password": "1234",
"level": 1
},
{
"id": 2,
"username": "john",
"email": "[email protected]",
"password": "5678",
"level": 1
}
]
}
}
$ cat reqcache-queries/9652f1e7c02639d8f78d1c5263093072fb4fd06c.query
query {getUsers { id,username,email,password,level } }
Trois dossiers sont créés :
Le nom de fichier est le hachage qui tient compte de la requête et de l'URL.
Copyright 2023 Cybervelia Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
L'outil a été créé et maintenu par (@fand0mas).
Les contributions sont également les bienvenues.