mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-06-03 04:33:05 +03:00
minor improvement
This commit is contained in:
parent
5e853cae64
commit
23117e72ca
|
@ -23,6 +23,7 @@ from lib.core.common import findDynamicContent
|
||||||
from lib.core.common import Format
|
from lib.core.common import Format
|
||||||
from lib.core.common import getComparePageRatio
|
from lib.core.common import getComparePageRatio
|
||||||
from lib.core.common import getCompiledRegex
|
from lib.core.common import getCompiledRegex
|
||||||
|
from lib.core.common import getLastRequestHTTPError
|
||||||
from lib.core.common import getSortedInjectionTests
|
from lib.core.common import getSortedInjectionTests
|
||||||
from lib.core.common import getUnicode
|
from lib.core.common import getUnicode
|
||||||
from lib.core.common import intersect
|
from lib.core.common import intersect
|
||||||
|
@ -658,24 +659,29 @@ def checkDynParam(place, parameter, value):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
kb.matchRatio = None
|
kb.matchRatio = None
|
||||||
|
dynResult = None
|
||||||
|
randInt = randomInt()
|
||||||
|
|
||||||
infoMsg = "testing if %s parameter '%s' is dynamic" % (place, parameter)
|
infoMsg = "testing if %s parameter '%s' is dynamic" % (place, parameter)
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
||||||
randInt = randomInt()
|
try:
|
||||||
payload = agent.payload(place, parameter, value, getUnicode(randInt))
|
payload = agent.payload(place, parameter, value, getUnicode(randInt))
|
||||||
dynResult = Request.queryPage(payload, place, raise404=False)
|
dynResult = Request.queryPage(payload, place, raise404=False)
|
||||||
|
|
||||||
if True == dynResult:
|
if not dynResult:
|
||||||
return False
|
|
||||||
|
|
||||||
infoMsg = "confirming that %s parameter '%s' is dynamic" % (place, parameter)
|
infoMsg = "confirming that %s parameter '%s' is dynamic" % (place, parameter)
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
||||||
randInt = randomInt()
|
randInt = randomInt()
|
||||||
payload = agent.payload(place, parameter, value, getUnicode(randInt))
|
payload = agent.payload(place, parameter, value, getUnicode(randInt))
|
||||||
dynResult = Request.queryPage(payload, place, raise404=False)
|
dynResult = Request.queryPage(payload, place, raise404=False)
|
||||||
|
except sqlmapConnectionException:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if dynResult is None:
|
||||||
|
return None
|
||||||
|
else:
|
||||||
return not dynResult
|
return not dynResult
|
||||||
|
|
||||||
def checkDynamicContent(firstPage, secondPage):
|
def checkDynamicContent(firstPage, secondPage):
|
||||||
|
@ -965,7 +971,7 @@ def checkConnection(suppressOutput=False):
|
||||||
warnMsg += "which could interfere with the results of the tests"
|
warnMsg += "which could interfere with the results of the tests"
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
elif wasLastRequestHTTPError():
|
elif wasLastRequestHTTPError():
|
||||||
warnMsg = "the web server responded with an HTTP error code "
|
warnMsg = "the web server responded with an HTTP error code (%d) " % getLastRequestHTTPError()
|
||||||
warnMsg += "which could interfere with the results of the tests"
|
warnMsg += "which could interfere with the results of the tests"
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -2173,6 +2173,14 @@ def adjustTimeDelay(lastQueryDuration, lowerStdLimit):
|
||||||
singleTimeLogMessage(infoMsg)
|
singleTimeLogMessage(infoMsg)
|
||||||
kb.adjustTimeDelay = False
|
kb.adjustTimeDelay = False
|
||||||
|
|
||||||
|
def getLastRequestHTTPError():
|
||||||
|
"""
|
||||||
|
Returns last HTTP error code
|
||||||
|
"""
|
||||||
|
|
||||||
|
threadData = getCurrentThreadData()
|
||||||
|
return threadData.lastHTTPError[1] if threadData.lastHTTPError else None
|
||||||
|
|
||||||
def extractErrorMessage(page):
|
def extractErrorMessage(page):
|
||||||
"""
|
"""
|
||||||
Returns reported error message from page if it founds one
|
Returns reported error message from page if it founds one
|
||||||
|
|
Loading…
Reference in New Issue
Block a user