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

Skip to content

Commit 7b93108

Browse files
committed
Favoring non-string specific boundaries in case of digit-like parameter values
1 parent 25ee333 commit 7b93108

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/controller/checks.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
See the file 'doc/COPYING' for copying permission
66
"""
77

8+
import copy
89
import httplib
910
import random
1011
import re
@@ -237,7 +238,13 @@ def checkSqlInjection(place, parameter, value):
237238
comment = agent.getComment(test.request) if len(conf.boundaries) > 1 else None
238239
fstPayload = agent.cleanupPayload(test.request.payload, origValue=value)
239240

240-
for boundary in conf.boundaries:
241+
# Favoring non-string specific boundaries in case of digit-like parameter values
242+
if value.isdigit():
243+
boundaries = sorted(copy.deepcopy(conf.boundaries), key=lambda x: any(_ in (x.prefix or "") or _ in (x.suffix or "") for _ in ('"', '\'')))
244+
else:
245+
boundaries = conf.boundaries
246+
247+
for boundary in boundaries:
241248
injectable = False
242249

243250
# Skip boundary if the level is higher than the provided (or

0 commit comments

Comments
 (0)