mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-29 02:03:08 +03:00
automatic adjustment of timeSec for delayed queries
This commit is contained in:
parent
71391874eb
commit
2001bad7e1
|
@ -26,7 +26,7 @@ from ConfigParser import DEFAULTSECT
|
||||||
from ConfigParser import RawConfigParser
|
from ConfigParser import RawConfigParser
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
from difflib import SequenceMatcher
|
from difflib import SequenceMatcher
|
||||||
from math import sqrt
|
from math import ceil, sqrt
|
||||||
from subprocess import PIPE
|
from subprocess import PIPE
|
||||||
from subprocess import Popen as execute
|
from subprocess import Popen as execute
|
||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
|
@ -1588,7 +1588,18 @@ def wasLastRequestDelayed():
|
||||||
warnMsg += "with less than %d response times" % MIN_TIME_RESPONSES
|
warnMsg += "with less than %d response times" % MIN_TIME_RESPONSES
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
return (threadData.lastQueryDuration >= average(kb.responseTimes) + TIME_STDEV_COEFF * deviation)
|
lowerLimit = average(kb.responseTimes) + TIME_STDEV_COEFF * deviation
|
||||||
|
retVal = (threadData.lastQueryDuration >= lowerLimit)
|
||||||
|
|
||||||
|
if not kb.testMode and retVal:
|
||||||
|
newVal = int(ceil((1 - (threadData.lastQueryDuration - lowerLimit) / threadData.lastQueryDuration) * conf.timeSec))
|
||||||
|
if newVal and newVal != conf.timeSec:
|
||||||
|
clearConsoleLine(True)
|
||||||
|
warnMsg = "adjusting time delay to %d seconds" % newVal
|
||||||
|
logger.warn(warnMsg)
|
||||||
|
conf.timeSec = newVal
|
||||||
|
|
||||||
|
return retVal
|
||||||
else:
|
else:
|
||||||
return threadData.lastQueryDuration - conf.timeSec
|
return threadData.lastQueryDuration - conf.timeSec
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user