-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ dist/ | |
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Perform Circular Query based on Introspection.""" | ||
from lib.utils import graph_query, curlify | ||
|
||
def circular_query_introspection(url, proxy, headers): | ||
"""Run a Circular Query using introspection.""" | ||
res = { | ||
'result':False, | ||
'title':'Introspection-based Circular Query', | ||
'description':'Circular-query using Introspection', | ||
'impact':'Denial of Service', | ||
'severity':'HIGH', | ||
'curl_verify':'' | ||
} | ||
|
||
q = 'query { __schema { types { fields { type { fields { type { fields { type { fields { type { name } } } } } } } } } } }' | ||
|
||
gql_response = graph_query(url, proxies=proxy, headers=headers, payload=q) | ||
res['curl_verify'] = curlify(gql_response) | ||
try: | ||
if len(gql_response.json()['data']['__schema']['types']) > 25: | ||
res['result'] = True | ||
except: | ||
pass | ||
|
||
return res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
"""Version details of graphql-cop.""" | ||
VERSION = '1.2' | ||
VERSION = '1.3' |