swisskyrepo / GraphQLmap

GraphQLmap is a scripting engine to interact with a graphql endpoint for pentesting purposes. - Do not use for illegal testing ;)
MIT License
1.37k stars 193 forks source link

KeyError: 'data' #32

Closed sh-o-aib closed 2 years ago

sh-o-aib commented 3 years ago

Whenever I run graphQLmap. I get this error. Kindly help!

GraphQLmap > dump_new ============= [SCHEMA] =============== e.g: name[Type]: arg (Type!)

Traceback (most recent call last): File "/media/mrn03ody/Shoaib/H_Scripts/web/whiteH_Exploits/PayloadsAllTheThings/GraphQL Injection/GraphQLmap/graphqlmap.py", line 78, in GraphQLmap(args) File "/media/mrn03ody/Shoaib/H_Scripts/web/whiteH_Exploits/PayloadsAllTheThings/GraphQL Injection/GraphQLmap/graphqlmap.py", line 53, in init dump_schema(self.url, self.method, 15, self.headers, self.use_json) File "/media/mrn03ody/Shoaib/H_Scripts/web/whiteH_Exploits/PayloadsAllTheThings/GraphQL Injection/GraphQLmap/attacks.py", line 36, in dump_schema for types in schema['data']['__schema']['types']: KeyError: 'data'

alexandrevvo commented 3 years ago

Whenever I run graphQLmap. I get this error. Kindly help!

GraphQLmap > dump_new ============= [SCHEMA] =============== e.g: name[Type]: arg (Type!)

Traceback (most recent call last): File "/media/mrn03ody/Shoaib/H_Scripts/web/whiteH_Exploits/PayloadsAllTheThings/GraphQL Injection/GraphQLmap/graphqlmap.py", line 78, in GraphQLmap(args) File "/media/mrn03ody/Shoaib/H_Scripts/web/whiteH_Exploits/PayloadsAllTheThings/GraphQL Injection/GraphQLmap/graphqlmap.py", line 53, in init dump_schema(self.url, self.method, 15, self.headers, self.use_json) File "/media/mrn03ody/Shoaib/H_Scripts/web/whiteH_Exploits/PayloadsAllTheThings/GraphQL Injection/GraphQLmap/attacks.py", line 36, in dump_schema for types in schema['data']['__schema']['types']: KeyError: 'data'

In my case the server was returning 502 "Internal Server Error".. The payload was not being sent correctly.

Use "--json true" when setting up the connection and maybe solve the problem.

zAbuQasem commented 3 years ago

did anyone manage to solve the issue?

Naelpuissant commented 3 years ago

@zAbuQasem yup, got the issue too, solved by putting a breakpoint here https://github.com/swisskyrepo/GraphQLmap/blob/master/attacks.py#L32 and finding what was wrong (my jwt was malformed )