Skip to content
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

Improve the atack generation of graphql queries and mutations #122

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove comments from inline as well
  • Loading branch information
bandronic committed Jul 25, 2023
commit 8041329f76002f2d85202a43f7895f7c1b73f855
5 changes: 2 additions & 3 deletions python/inql/attacker/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def __init__(self, editor):

def stripComments(self, code):
code = str(code)
return re.sub(r'(?m)^ *#.*\n?', '', code)
return re.sub(r'(?m) *#.*\n?', '', code)

def generate_attack_request(self):
info = helpers.analyzeRequest(self.editor.request)
headers = info.getHeaders()
raw = helpers.bytesToString(self.editor.request[info.getBodyOffset():])
body = str(raw) #.replace('\\r', '').replace('\\n', ' ').replace('\\t', '')
body = str(raw)
parsed = json.loads(body)
if isinstance(parsed, list):
parsed = parsed[0]
Expand Down Expand Up @@ -95,7 +95,6 @@ def generate_attack_request(self):
exploit +='op%s: %s%s%s%s{%s}%s' % (n+1, prefix, lead, item, rest, query, suffix)

#build the query
# attack = prefix + exploit + suffix\
attack = action + "{" + exploit + "}"

log.debug("attack query: %s" % attack)
Expand Down