Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b824826

Browse files
committed
Minor enhancement to prefix payload in ORDER BY and GROUP BY clauses
1 parent bb40ab9 commit b824826

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/controller/checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def checkSqlInjection(place, parameter, value):
257257
if where == 1:
258258
origValue = value
259259
elif where == 2:
260-
origValue = "-%s" % value
260+
origValue = "-%s" % randomInt()
261261
elif where == 3:
262262
origValue = ""
263263

lib/core/agent.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def payload(self, place=None, parameter=None, value=None, newValue=None, negativ
8383
if where == 1:
8484
value = origValue
8585
elif where == 2:
86-
value = "-%s" % origValue
86+
value = "-%s" % randomInt()
8787
elif where == 3:
8888
value = ""
8989
else:
@@ -155,10 +155,12 @@ def prefixQuery(self, string):
155155
# payload, do not put a space after the prefix
156156
if kb.technique == 4:
157157
query = kb.injection.prefix
158-
elif kb.technique and kb.technique in kb.injection.data:
158+
elif (kb.technique and kb.technique in kb.injection.data) or \
159+
(kb.injection.clause == [2, 3] or kb.injection.clause == [ 2 ]):
159160
where = kb.injection.data[kb.technique].where
160161

161-
if where == 3:
162+
if where == 3 or (kb.injection.clause == [2, 3] or \
163+
kb.injection.clause == [ 2 ]):
162164
query = kb.injection.prefix
163165

164166
if query is None:

0 commit comments

Comments
 (0)