Skip to content

Commit

Permalink
Merge pull request #13 from dolevf/add-morpheus
Browse files Browse the repository at this point in the history
add morpheus graphql
  • Loading branch information
dolevf authored Aug 22, 2022
2 parents 2ca0f88 + 3941a44 commit 6ded1aa
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ graphw00f currently attempts to discover the following GraphQL engines:
* Lighthouse - PHP
* Agoo - Ruby
* Mercurius - JavaScript
* morpheus-graphql - Haskell

# GraphQL Threat Matrix
The graphw00f project uses the [GraphQL Threat Matrix Project](https://github.com/nicholasaleks/graphql-threat-matrix/) as its technology security matrix database. When graphw00f successfully fingerprints a GraphQL endpoint, it will print out the threat matrix document. This document helps security engineers to identify how mature the technology is, what security features it offers, and whether it contains any CVEs.
Expand Down
6 changes: 6 additions & 0 deletions graphw00f/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ def get_engines():
'url':'https://github.com/mercurius-js/mercurius',
'ref':'https://github.com/nicholasaleks/graphql-threat-matrix/blob/master/implementations/agoo.md',
'technology':['JavaScript', 'Node.js', 'TypeScript']
},
'morpheus-graphql':{
'name':'morpheus-graphql',
'url':'https://github.com/morpheusgraphql/morpheus-graphql',
'ref':'https://github.com/nicholasaleks/graphql-threat-matrix/blob/master/implementations/morpheus-graphql',
'technology':['Haskell']
}
}

Expand Down
19 changes: 17 additions & 2 deletions graphw00f/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ def execute(self, url):
self.url = url
if self.engine_lighthouse():
return 'lighthouse'
if self.engine_mercurius():
return 'mercurius'
elif self.engine_morpheus():
return 'morpheus-graphql'
elif self.engine_mercurius():
return 'mercurius-graphql'
elif self.engine_graphql_yoga():
return 'graphql_yoga'
elif self.engine_agoo():
Expand Down Expand Up @@ -608,3 +610,16 @@ def engine_mercurius(self):
return True
return False

def engine_morpheus(self):
query = ''''
queryy {
__typename
}
'''
response = self.graph_query(self.url, payload=query)

if error_contains(response, 'expecting white space') or error_contains(response, 'offset'):
return True

return False

2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '1.1.4'
VERSION = '1.1.5'

0 comments on commit 6ded1aa

Please sign in to comment.