├── ch03 ├── .keep └── README.md ├── ch04 ├── README.md ├── common-graphql-endpoints.txt └── sdl.graphql ├── ch08 ├── README.md └── paste_from_file.txt ├── ch05 ├── README.md ├── safe-circular-query.graphql ├── array_based_batch_query.py ├── array_based_circular_queries.py ├── exploit_threaded_field_dup.py ├── exploit_directive_overloading.py ├── introspection.sdl ├── sdl.graphql └── field-duplication.graphql ├── ch06 ├── README.md ├── schema-introspection-canary-query.graphql ├── type-based-introspection-bypass-query.graphql └── cURL-schema-introspection-canary-query ├── ch09 ├── README.md ├── post_csrf_submit.html ├── get_csrf_submit_auto.html ├── post_csrf_submit_auto.html └── websockets_hijack.html ├── ch07 ├── README.md └── password-brute-force.graphql ├── ch10 └── README.md ├── Cover.png ├── ch01 └── README.md ├── ch02 └── README.md ├── resources └── non-production-graphql-urls.txt ├── README.md ├── tools └── README.md └── queries └── introspection_query.txt /ch03/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch04/README.md: -------------------------------------------------------------------------------- 1 | # Reconnaissance -------------------------------------------------------------------------------- /ch08/README.md: -------------------------------------------------------------------------------- 1 | # Injection 2 | -------------------------------------------------------------------------------- /ch05/README.md: -------------------------------------------------------------------------------- 1 | # Denial of Service 2 | -------------------------------------------------------------------------------- /ch03/README.md: -------------------------------------------------------------------------------- 1 | # GraphQL Attack Surface 2 | -------------------------------------------------------------------------------- /ch06/README.md: -------------------------------------------------------------------------------- 1 | # Information Disclosure 2 | -------------------------------------------------------------------------------- /ch09/README.md: -------------------------------------------------------------------------------- 1 | # Request Forgery and Hijacking 2 | -------------------------------------------------------------------------------- /ch07/README.md: -------------------------------------------------------------------------------- 1 | # Authentication and Authorization Bypasses 2 | -------------------------------------------------------------------------------- /ch10/README.md: -------------------------------------------------------------------------------- 1 | # Disclosed Vulnerabilities and Exploits 2 | -------------------------------------------------------------------------------- /Cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dolevf/Black-Hat-GraphQL/HEAD/Cover.png -------------------------------------------------------------------------------- /ch06/schema-introspection-canary-query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | __schema { 3 | __typename 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch06/type-based-introspection-bypass-query.graphql: -------------------------------------------------------------------------------- 1 | { 2 | __type(name:"Query") { 3 | name 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch01/README.md: -------------------------------------------------------------------------------- 1 | # A Primer on GraphQL 2 | 3 | Online REST & GraphQL API Lab 4 | - http://lab.blackhatgraphql.com/start 5 | -------------------------------------------------------------------------------- /ch08/paste_from_file.txt: -------------------------------------------------------------------------------- 1 |
This is an example paste from a file.
3 | 4 | -------------------------------------------------------------------------------- /ch06/cURL-schema-introspection-canary-query: -------------------------------------------------------------------------------- 1 | curl http://localhost:5013/graphql -H 'Content-Type: application/json' --data-binary '{“query”:“{__schema {__typename}}”}' -------------------------------------------------------------------------------- /ch05/safe-circular-query.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | pastes { 3 | owner { 4 | pastes { 5 | owner { 6 | name 7 | } 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch05/array_based_batch_query.py: -------------------------------------------------------------------------------- 1 | # Array-based Batch Queries using Python 2 | 3 | import requests 4 | 5 | queries = [ 6 | {"query":"query {systemHealth}"}, 7 | {"query":"query {systemHealth}"} 8 | ] 9 | 10 | r = requests.post('http://localhost:5013/graphql', json=queries) 11 | 12 | print(r.json()) 13 | -------------------------------------------------------------------------------- /ch02/README.md: -------------------------------------------------------------------------------- 1 | # Setting up a GraphQL Security Lab 2 | 3 | ## Kali Linux Virtual Machine 4 | **Version**: `2021.4a` (64-bit) - this is the version used in the Black Hat GraphQL book. 5 | 6 | **Links**: 7 | - VMware Workstation - https://kali.download/virtual-images/kali-2021.4a/kali-linux-2021.4a-vmware-amd64.7z.torrent 8 | - Oracle VirtualBox - https://kali.download/virtual-images/kali-2021.4a/kali-linux-2021.4a-virtualbox-amd64.ova.torrent 9 | 10 | -------------------------------------------------------------------------------- /ch04/common-graphql-endpoints.txt: -------------------------------------------------------------------------------- 1 | /graphql 2 | /graphiql 3 | /v1/graphql 4 | /v2/graphql 5 | /v3/graphql 6 | /v1/graphiql 7 | /v2/graphiql 8 | /v3/graphiql 9 | /playground 10 | /v1/playground 11 | /v2/playground 12 | /v3/playground 13 | /api/v1/playground 14 | /api/v2/playground 15 | /api/v3/playground 16 | /console 17 | /api/graphql 18 | /api/graphiql 19 | /explorer 20 | /api/v1/graphql 21 | /api/v2/graphql 22 | /api/v3/graphql 23 | /api/v1/graphiql 24 | /api/v2/graphiql 25 | /api/v3/graphiql 26 | -------------------------------------------------------------------------------- /ch09/post_csrf_submit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
7 |
8 | |
9 |
10 | Black Hat GraphQL is for anyone interested in learning how to break and protect GraphQL APIs with the aid of offensive security testing. Whether you’re a penetration tester, security analyst, or software engineer, you’ll learn how to attack GraphQL APIs, develop hardening procedures, build automated security testing into your development pipeline, and validate controls, all with no prior exposure to GraphQL required. 11 | 12 | |
13 |