
Strumento automatizzato per l'enumerazione dello schema GraphQL e l'estrazione dei dati, che itera i documenti di introspezione, ricostruisce le query e salva le risposte per penetration testing e valutazioni di sicurezza delle API.
Graphicator è un "raschietto" / estrattore per GraphQL. Lo strumento itera sul documento di introspezione restituito dall'endpoint GraphQL di destinazione, e poi ristruttura lo schema in una forma interna in modo da poter ricreare le query supportate. Quando tali query vengono create, le utilizza per inviare richieste all'endpoint e salva la risposta ottenuta in un file.
Le risposte errate non vengono salvate. Per impostazione predefinita, lo strumento memorizza nella cache le risposte corrette e anche gli errori, quindi quando viene eseguito nuovamente non ripercorrerà le stesse query.
Usalo con saggezza e solo per target per i quali hai il permesso di interagire.
Speriamo che lo strumento automatizzi i tuoi test come penetration tester e dia una spinta anche a coloro che non hanno ancora eseguito test su GraphQL.
Per imparare come eseguire valutazioni su endpoint 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
Al termine dell'attività, i risultati vengono compressi in uno zip e tale zip è fornito tramite un webserver in ascolto sulla porta 8005. Per arrestare il container, premere CTRL+C. Quando il container viene fermato, anche i dati vengono eliminati. Puoi anche modificare la porta host secondo le tue esigenze.
python3 graphicator.py [args...]
Il primo passo è configurare il target. Per farlo devi fornire l'opzione --target o un file tramite --file.
Impostazione di un singolo target tramite argomenti
python3 graphicator.py --target https://subdomain.domain:port/graphql
Impostazione di più target
python3 graphicator.py --target https://subdomain.domain:port/graphql --target https://target2.tld/graphql
Impostazione di target tramite file
python3 graphicator.py --file file.txt
Il file deve contenere un URL per riga, come nell'esempio seguente:
http://target1.tld/graphql
http://sub.target2.tld/graphql
http://subxyz.target3.tld:8080/graphql
Puoi collegare lo strumento a qualsiasi proxy.
Connessione alle impostazioni predefinite di Burp (porta 8080)
python3 graphicator.py --target target --default-burp-proxy
Connessione al proprio proxy
python3 graphicator.py --target target --use-proxy
Connessione tramite 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 } }
Vengono create tre cartelle:
Il nome file è l'hash che tiene conto della query e dell'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.
Lo strumento è stato creato e mantenuto da (@fand0mas).
Anche i contributi sono benvenuti.