• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mindedsecurity/graphqlschema2payload: Reverse engineers GQL Schema and generates ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

mindedsecurity/graphqlschema2payload

开源软件地址(OpenSource Url):

https://github.com/mindedsecurity/graphqlschema2payload

开源编程语言(OpenSource Language):

CSS 55.8%

开源软件介绍(OpenSource Introduction):

graphqlschema2payload

This little piece of software helps to recreate GraphQL payloads from a GraphQL Schema. It works by visiting the Schema and resolving all types. Its main purpose is to create tests that can be used for QA or pentesting.

Install

npm install 

Server Version

The server version integrates GraphiQL interface and populates the editor with an automatically generate template from the schema.

  1. Launch the server: npm start

  2. Visit http://localhost:4000/

  3. Add the remote URL and optional Headers (Ie. Authorization Bearer) separated by lines (eg. https://bahnql.herokuapp.com/graphql). image

  4. Click Continue in order to let GraphiQL fetch the Schema via the local server. Local server also instantiates GSchema which automatically extracts templates from gqlSchema.

  5. Use the dropdown menus Query and Mutations to populate the editor with a specific template.

image

  1. Edit the template with the arguments.

  2. Execute the query and get the response from the remote URL.

image

CLI Version Usage:

The CLI version helps exploring the GQL Schema.

Usage: node ./index.js [-r] [-q] [-m] [-a] [-f filename_schema]|[[-p] -u http://URL [-H 'NAME1=VALUE1|NAME2=VALUE2']] [action_name]
  -q : prints all queries
  -m : prints all mutations
  -f : schema path 
  -a : print all actions
  -u : url to download grapql schema
  -H : Header to add. Use format like NAME1=VALUE1|NAME2=VALUE2 for multiple pairs
  -p : print downloaded schema [to save it somewhere use redirection >/output_schema.json ]
  -r : prints the POST payload to be used as template for testing - NB: No Arguments Value Given. user needs to add them by hand -

eg. download one of https://github.com/APIs-guru/graphql-voyager/tree/master/demo/presets/

node index.js -f ./sample_schemas/graphbrainz.json.json -a

eg. Download Schema using introspection and print all query names:

node index.js -u 'https://api.github.com/graphql' -H 'Authorization= bearer TOKEN' -q

Examples

http://apis.guru/graphql-apis/

TODO

  • add compatibility to previous graphql versions. EG. :
https://pokeapi-graphiql.herokuapp.com/




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap