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

Skip to content

Commit 3532d23

Browse files
committed
automatically extending ranges for UNION tests in case where at least one other injection technique is usable (boundaries has been established)
1 parent eb73cab commit 3532d23

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

lib/controller/checks.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from lib.core.common import randomStr
3535
from lib.core.common import readInput
3636
from lib.core.common import showStaticWords
37+
from lib.core.common import singleTimeLogMessage
3738
from lib.core.common import singleTimeWarnMessage
3839
from lib.core.common import wasLastRequestDBMSError
3940
from lib.core.common import wasLastRequestHTTPError
@@ -108,6 +109,20 @@ def checkSqlInjection(place, parameter, value):
108109
logger.debug(debugMsg)
109110
continue
110111

112+
match = re.search(r"(\d+)-(\d+)", test.request.columns)
113+
if injection.data and match:
114+
lower, upper = int(match.group(1)), int(match.group(2))
115+
for _ in (lower, upper):
116+
if _ > 1:
117+
infoMsg = "automatically extending ranges "
118+
infoMsg += "for further UNION query injection technique tests as "
119+
infoMsg += "there is at least one other injection technique found"
120+
singleTimeLogMessage(infoMsg)
121+
122+
test.request.columns = re.sub(r"\b%d\b" % _, str(2 * _), test.request.columns)
123+
title = re.sub(r"\b%d\b" % _, str(2 * _), title)
124+
test.title = re.sub(r"\b%d\b" % _, str(2 * _), test.title)
125+
111126
# Skip test if the user's wants to test only for a specific
112127
# technique
113128
if conf.tech and isinstance(conf.tech, list) and stype not in conf.tech:

lib/techniques/union/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __orderByTest(cols):
5959
infoMsg += "This should reduce the time needed "
6060
infoMsg += "to find the right number "
6161
infoMsg += "of query columns. Automatically extending the "
62-
infoMsg += "range for UNION query injection technique"
62+
infoMsg += "range for current UNION query injection technique test"
6363
singleTimeLogMessage(infoMsg)
6464

6565
lowCols, highCols = 1, ORDER_BY_STEP

0 commit comments

Comments
 (0)