{"id":27838732,"url":"https://github.com/CyberRoute/graphspecter","last_synced_at":"2025-05-03T00:02:16.492Z","repository":{"id":287214626,"uuid":"949498385","full_name":"CyberRoute/graphspecter","owner":"CyberRoute","description":"GraphSpecter is a tool to audit GraphQL API","archived":false,"fork":false,"pushed_at":"2025-04-22T14:02:20.000Z","size":233,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T15:22:08.542Z","etag":null,"topics":["application-security","golang","graphql","security-audit","web-application-security"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyberRoute.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-16T15:44:31.000Z","updated_at":"2025-04-22T14:02:23.000Z","dependencies_parsed_at":"2025-04-15T00:13:58.462Z","dependency_job_id":null,"html_url":"https://github.com/CyberRoute/graphspecter","commit_stats":null,"previous_names":["cyberroute/graphspecter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fgraphspecter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fgraphspecter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fgraphspecter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fgraphspecter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyberRoute","download_url":"https://codeload.github.com/CyberRoute/graphspecter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252122908,"owners_count":21698323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["application-security","golang","graphql","security-audit","web-application-security"],"created_at":"2025-05-03T00:02:14.332Z","updated_at":"2025-05-03T00:02:16.474Z","avatar_url":"https://github.com/CyberRoute.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n   \u003cimg alt=\"GraphSpecter\" src=\"img/graphspecter.png\" width=\"200\" height=\"200\"/\u003e\n   \u003cp align=\"center\"\u003e\n   \u003c/p\u003e\n \u003c/p\u003e\n\n## Features\n\n- Check if GraphQL introspection is enabled\n- Export introspection data to JSON file\n- Exports queries and mutations ready to test\n- Executes queries and mutations in bulk or stand-alone\n\n## Project Structure\n\n```\n├── config.yml\n├── go.mod\n├── go.sum\n├── img\n│   └── graphspecter.png\n├── LICENSE\n├── main.go\n├── pkg\n│   ├── cli\n│   │   └── cli.go\n│   ├── cmd\n│   │   └── root.go\n│   ├── config\n│   │   ├── config.go\n│   │   └── merge.go\n│   ├── introspection\n│   │   └── introspection.go\n│   ├── logger\n│   │   └── logger.go\n│   ├── network\n│   │   └── client.go\n│   ├── schema\n│   │   └── schema.go\n│   ├── subscription\n│   │   └── client.go\n│   └── types\n│       └── types.go\n├── README.md\n\n```\n\n## Usage\n\n```\n# Run in detection mode\ngo run main.go --base http://192.168.1.1:5013 --detect\n\n# Execute a single query or mutation\ngo run main.go \\\n  --execute \\\n  --base http://your.server/graphql \\\n  --query-string 'query { users { id name } }'\n\n# Execute from files\ngo run main.go \\\n  --execute \\\n  --base http://your.server/graphql \\\n  --query-file getUser.graphql \\\n  --vars-file getUser.json\n\n# Batch execution of all ops in 'ops' directory\n# (expects pairs: *.graphql + optional *.json vars)\ngo run main.go \\\n  --batch-dir ./ops \\\n  --base http://your.server/graphql\n```\n\n### Options\n```\n  Usage of:\n\n  -all-mutations                Print all mutations\n  -all-queries                  Print all queries\n  -base string                  Base URL of the target (e.g. http://192.168.1.1:5013)\n  -batch-dir string             Directory of .graphql/.json pairs to execute in bulk (batch mode)\n  -config string                Path to config file (.yaml or .json)\n  -detect                       Enable detection mode to find a GraphQL endpoint\n  -execute                      Execute a query or mutation\n  -list string                  List queries, mutations or both (valid: 'queries', 'mutations', 'all')\n  -log-file string              Log to file in addition to stdout\n  -log-level string             Log level (debug, info, warn, error)\n  -max-depth int                Maximum depth for selection sets (default 10)\n  -mutation string              Print named mutations (comma-separated)\n  -no-color                     Disable colored output\n  -output string                Dump introspection schema (default \"introspection_\u003cendpoint\u003e.json\")\n  -query string                 Print named queries (comma-separated)\n  -query-file string            Path to file containing GraphQL query\n  -query-string string          GraphQL query string to execute\n  -schema-file string           File with the GraphQL schema (introspection JSON)\n  -sub-query string             Subscription query to execute\n  -subscribe                    Enable subscription mode\n  -timeout duration             Timeout for operations (e.g., 30s, 1m) (default 1s)\n  -vars string                  Query variables as JSON string\n  -vars-file string             Path to JSON file with variables\n  -ws-url string                WebSocket URL for subscriptions (default \"ws://192.168.1.100:5013/subscriptions\")\n```\n## Building\n\n```\ngo build -o graphspecter\n```\n\n## Example\n\n```\n# Check if introspection is enabled\n./graphspecter -base http://192.168.1.1:5013 -detect -output results.json\n```\n\n## Authentication\n\nYou can authenticate requests by setting the `AUTH_TOKEN` environment variable. When set, all requests will include an `Authorization: Bearer \u003ctoken\u003e` header.\n\nExample:\n```\n# Set the authentication token\nexport AUTH_TOKEN=\"your-token-here\"\n```\n\n## Security Notes\n\n- GraphQL introspection is a feature that allows clients to query a GraphQL server for information about its schema.\n- While useful for development, introspection should typically be disabled in production environments as it may expose sensitive information about your API structure.\n- The injections tests in `./ops` are run against https://github.com/dolevf/Damn-Vulnerable-GraphQL-Application, adding also #hackthebox attacks samples from https://academy.hackthebox.com/course/preview/attacking-graphql \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCyberRoute%2Fgraphspecter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCyberRoute%2Fgraphspecter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCyberRoute%2Fgraphspecter/lists"}