GraphQLmap/bin/graphqlmap

83 lines
3.0 KiB
Plaintext
Raw Permalink Normal View History

2020-05-13 22:55:51 +00:00
#!/usr/bin/env python3
2020-02-05 12:43:03 +00:00
try:
import readline
except ImportError:
import pyreadline as readline
2020-02-05 12:22:13 +00:00
2022-01-17 15:22:22 +00:00
from graphqlmap.attacks import *
2020-01-14 20:49:49 +00:00
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
2020-02-05 12:05:56 +00:00
class GraphQLmap(object):
2020-02-05 12:05:56 +00:00
author = "@pentest_swissky"
version = "1.1"
endpoint = "graphql"
2020-02-05 12:05:56 +00:00
method = "POST"
args = None
2020-02-05 12:05:56 +00:00
url = None
headers = None
2020-05-14 18:31:55 +00:00
use_json = False
def __init__(self, args_graphql):
print(" _____ _ ____ _ ")
print(" / ____| | | / __ \| | ")
print(" | | __ _ __ __ _ _ __ | |__ | | | | | _ __ ___ __ _ _ __ ")
print(" | | |_ | '__/ _` | '_ \| '_ \| | | | | | '_ ` _ \ / _` | '_ \ ")
print(" | |__| | | | (_| | |_) | | | | |__| | |____| | | | | | (_| | |_) |")
print(" \_____|_| \__,_| .__/|_| |_|\___\_\______|_| |_| |_|\__,_| .__/ ")
print(" | | | | ")
print(" |_| |_| ")
2020-02-05 12:05:56 +00:00
print(" " * 30, end='')
print(f"\033[1mAuthor\033[0m: {self.author} \033[1mVersion\033[0m: {self.version} ")
self.args = args_graphql
self.url = args_graphql.url
self.method = args_graphql.method
self.headers = None if not args_graphql.headers else json.loads(args_graphql.headers)
2020-05-14 18:31:55 +00:00
self.use_json = True if args_graphql.use_json else False
self.proxy = {
"http" : args_graphql.proxy,
}
while True:
query = input("GraphQLmap > ")
cmdlist.append(query)
if query == "exit" or query == "q":
exit()
elif query == "help":
display_help()
2020-02-05 12:05:56 +00:00
elif query == "debug":
display_types(self.url, self.method, self.proxy, self.headers, self.use_json)
2019-06-21 14:42:05 +00:00
elif query == "dump_via_introspection":
dump_schema(self.url, self.method, 15, self.proxy, self.headers, self.use_json)
2019-06-21 14:42:05 +00:00
elif query == "dump_via_fragment":
dump_schema(self.url, self.method, 14, self.proxy, self.headers, self.use_json)
2019-06-21 14:42:05 +00:00
elif query == "nosqli":
blind_nosql(self.url, self.method, self.proxy, self.headers, self.use_json)
2019-06-21 14:42:05 +00:00
elif query == "postgresqli":
blind_postgresql(self.url, self.method, self.proxy, self.headers, self.use_json)
2019-06-21 14:42:05 +00:00
elif query == "mysqli":
blind_mysql(self.url, self.method, self.proxy, self.headers, self.use_json)
2019-07-29 16:22:11 +00:00
elif query == "mssqli":
blind_mssql(self.url, self.method, self.proxy, self.headers, self.use_json)
2019-06-21 14:42:05 +00:00
else:
print(self.headers)
exec_advanced(self.url, self.method, query, self.headers, self.use_json, self.proxy)
2019-06-21 14:42:05 +00:00
2020-02-05 12:05:56 +00:00
2019-06-21 14:42:05 +00:00
if __name__ == "__main__":
readline.set_completer(auto_completer)
readline.parse_and_bind("tab: complete")
args = parse_args()
GraphQLmap(args)