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

Skip to content

Commit 8c45ff0

Browse files
committed
bug fix
1 parent c0f4b46 commit 8c45ff0

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

lib/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2798,7 +2798,7 @@ def removeReflectiveValues(content, payload, suppressWarning=False):
27982798
if all([content, payload]) and isinstance(content, unicode) and kb.reflectiveMechanism:
27992799
payload = getUnicode(urldecode(payload.replace(PAYLOAD_DELIMITER, '')))
28002800

2801-
regex = filterStringValue(payload, r'[A-Za-z0-9]', REFLECTED_NON_ALPHA_NUM_REGEX.encode("string-escape"))
2801+
regex = r"\b%s\b" % filterStringValue(payload, r'[A-Za-z0-9]', REFLECTED_NON_ALPHA_NUM_REGEX.encode("string-escape"))
28022802

28032803
while 2 * REFLECTED_NON_ALPHA_NUM_REGEX in regex:
28042804
regex = regex.replace(2 * REFLECTED_NON_ALPHA_NUM_REGEX, REFLECTED_NON_ALPHA_NUM_REGEX)

lib/techniques/error/use.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def errorUse(expression, expected=None, resumeValue=True, dump=False):
202202

203203
initTechnique(PAYLOAD.TECHNIQUE.ERROR)
204204

205+
abortedFlag = False
205206
count = None
206207
start = time.time()
207208
startLimit = 0
@@ -374,6 +375,7 @@ def errorThread():
374375
runThreads(numThreads, errorThread)
375376

376377
except KeyboardInterrupt:
378+
abortedFlag = True
377379
warnMsg = "user aborted during enumeration. sqlmap "
378380
warnMsg += "will display partial output"
379381
logger.warn(warnMsg)
@@ -382,7 +384,7 @@ def errorThread():
382384
outputs = threadData.shared.outputs
383385
kb.suppressResumeInfo = False
384386

385-
if not outputs:
387+
if not outputs and not abortedFlag:
386388
outputs = __errorFields(expression, expressionFields, expressionFieldsList)
387389

388390
if outputs and isinstance(outputs, list) and len(outputs) == 1 and isinstance(outputs[0], basestring):

lib/techniques/union/use.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ def unionUse(expression, unpack=True, dump=False):
141141

142142
initTechnique(PAYLOAD.TECHNIQUE.UNION)
143143

144+
abortedFlag = False
144145
count = None
145146
origExpr = expression
146147
startLimit = 0
@@ -331,6 +332,8 @@ def unionThread():
331332
clearConsoleLine(True)
332333

333334
except KeyboardInterrupt:
335+
abortedFlag = True
336+
334337
warnMsg = "user aborted during enumeration. sqlmap "
335338
warnMsg += "will display partial output"
336339
logger.warn(warnMsg)
@@ -339,7 +342,7 @@ def unionThread():
339342
value = threadData.shared.value
340343
kb.suppressResumeInfo = False
341344

342-
if not value:
345+
if not value and not abortedFlag:
343346
expression = re.sub("\s*ORDER BY\s+[\w,]+", "", expression, re.I) # full inband doesn't play well with ORDER BY
344347
value = __oneShotUnionUse(expression, unpack)
345348

0 commit comments

Comments
 (0)