-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Add GraphQL Auxiliary Scanner module #20216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add GraphQL Auxiliary Scanner module #20216
Conversation
1a7b77d
to
4075e1a
Compare
modules/auxiliary/scanner/http/graphql_introspection_scanner.rb
Outdated
Show resolved
Hide resolved
6110908
to
7277210
Compare
a514c80
to
9e4d0c9
Compare
name | ||
} | ||
types { | ||
...#{vars_map[:type_fragment]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we create a rex random identifier?
Thanks for your pull request! Before this can be merged, we need the following documentation for your module: |
Looks great @sjanusz-r7, a couple minor comments. Testing
Docker SetupI setup GraphQL in docker just because I prefer using it over docker setup
Files in
Run the container with:
|
This PR adds a GraphQL Introspection Scanner module.
This module can be used to query GraphQL endpoints to see if introspection is enabled.
Introspection allows us to query for the whole GraphQL schema, which could give us insight into which objects can be queried, their descriptions, types, and if they are deprecated. This can be used to query for information that should have been not accessible, e.g. not exposed to a UI, but can still be queried. As such, we register it as a vulnerability.
GraphQL Server
For this, I have used two GraphQL implementations, as well as remote GraphQL endpoints available at: https://github.com/graphql-kit/graphql-apis
Remote GraphQL Instances
https://docs.developer.yelp.com/graphql
Doesn't quite work; I assume because of some missing headers, other magic values, or this is coming from the server due to routing, load balancing or others. We get a 404 Not Found.
api.ean-search.org
This server gets an error on the full schema dump query:
Query depth limit exceeded.
. As such, we cancheck
if the host is vulnerable:JavaScript & Node.js
For setting up a JavaScript GraphQL server, I have followed this: https://www.apollographql.com/docs/apollo-server/getting-started
The following code can be pasted into a node.js project, and executed with
SERVER_PORT=4000 NODE_ENV=production npm start
andSERVER_PORT=4001 NODE_ENV=development npm start
Server code:
Ruby & Rails
For this, I have used the following tutorial: https://www.apollographql.com/blog/using-graphql-with-ruby-on-rails
TLDR: This implementation is different. Rails uses CSRF tokens. On a more barebones app (such as the tutorial linked), there is no programatic way to retrieve a CSRF token, as there is no endpoints for that in a
production
env.Verification
List the steps needed to make sure this thing works
msfconsole
use graphql_introspection_scanner
set
your optionscheck
andrun