mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 08:14:24 +03:00
now showing trimmed output in for of warning message (UNION and ERROR techniques affected)
This commit is contained in:
parent
7993f3f12d
commit
1286cc0913
|
@ -52,6 +52,8 @@ def __oneShotErrorUse(expression, field):
|
|||
|
||||
while True:
|
||||
check = "%s(?P<result>.*?)%s" % (kb.misc.start, kb.misc.stop)
|
||||
trimcheck = "%s(?P<result>.*?)</" % (kb.misc.start)
|
||||
|
||||
nulledCastedField = agent.nullAndCastField(field)
|
||||
|
||||
if Backend.getIdentifiedDbms() == DBMS.MYSQL:
|
||||
|
@ -82,6 +84,18 @@ def __oneShotErrorUse(expression, field):
|
|||
|
||||
if output:
|
||||
output = getUnicode(output, kb.pageEncoding)
|
||||
else:
|
||||
trimmed = extractRegexResult(trimcheck, page, re.DOTALL | re.IGNORECASE) \
|
||||
or extractRegexResult(trimcheck, listToStrValue(headers.headers \
|
||||
if headers else None), re.DOTALL | re.IGNORECASE) \
|
||||
or extractRegexResult(trimcheck, threadData.lastRedirectMsg[1] \
|
||||
if threadData.lastRedirectMsg and threadData.lastRedirectMsg[0] == \
|
||||
threadData.lastRequestUID else None, re.DOTALL | re.IGNORECASE)
|
||||
|
||||
if trimmed:
|
||||
warnMsg = "trimmed output output detected: "
|
||||
warnMsg += trimmed
|
||||
logger.warn(warnMsg)
|
||||
|
||||
if isinstance(output, basestring):
|
||||
output = htmlunescape(output).replace("<br>", "\n")
|
||||
|
|
|
@ -44,6 +44,7 @@ def __oneShotUnionUse(expression, unpack=True):
|
|||
global reqCount
|
||||
|
||||
check = "(?P<result>%s.*%s)" % (kb.misc.start, kb.misc.stop)
|
||||
trimcheck = "%s(?P<result>.*?)</" % (kb.misc.start)
|
||||
|
||||
# Prepare expression with delimiters
|
||||
expression = agent.concatQuery(expression, unpack)
|
||||
|
@ -72,6 +73,15 @@ def __oneShotUnionUse(expression, unpack=True):
|
|||
|
||||
if output:
|
||||
output = getUnicode(output, kb.pageEncoding)
|
||||
else:
|
||||
trimmed = extractRegexResult(trimcheck, removeReflectiveValues(page, payload), re.DOTALL | re.IGNORECASE) \
|
||||
or extractRegexResult(trimcheck, removeReflectiveValues(listToStrValue(headers.headers \
|
||||
if headers else None), payload, True), re.DOTALL | re.IGNORECASE)
|
||||
|
||||
if trimmed:
|
||||
warnMsg = "trimmed output output detected: "
|
||||
warnMsg += trimmed
|
||||
logger.warn(warnMsg)
|
||||
|
||||
return output
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user