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

Skip to content

Commit 612ee08

Browse files
committed
added response time kb attribute
1 parent 73dfb69 commit 612ee08

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/controller/checks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,9 @@ def checkConnection(suppressOutput=False):
734734
logger.info(infoMsg)
735735

736736
try:
737+
start = time.time()
737738
page, _ = Request.queryPage(content=True)
739+
kb.responseTime = time.time() - start
738740
conf.seqMatcher.set_seq1(page)
739741
except sqlmapConnectionException, errMsg:
740742
errMsg = getUnicode(errMsg)

lib/controller/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def start():
265265

266266
setupTargetEnv()
267267

268-
if not checkConnection(conf.forms) or not checkString() or not checkRegexp():
268+
if not checkConnection(suppressOutput=conf.forms) or not checkString() or not checkRegexp():
269269
continue
270270

271271
if conf.nullConnection:

lib/core/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,12 +1290,12 @@ def readXmlFile(xmlFile):
12901290
xfile.close()
12911291
return retVal
12921292

1293-
def calculateDeltaSeconds(start, epsilon=0.05):
1293+
def calculateDeltaSeconds(start, epsilon=0.1):
12941294
"""
12951295
Returns elapsed time from start till now (including expected
12961296
error set by epsilon parameter)
12971297
"""
1298-
return int(time.time() - start + epsilon)
1298+
return int(time.time() - start - kb.responseTime + epsilon)
12991299

13001300
def initCommonOutputs():
13011301
kb.commonOutputs = {}

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,7 @@ def __setKnowledgeBaseAttributes():
11701170
kb.partRun = None
11711171
kb.proxyAuthHeader = None
11721172
kb.queryCounter = 0
1173+
kb.responseTime = 0
11731174
kb.resumedQueries = {}
11741175
kb.retriesCount = 0
11751176
kb.tamperFunctions = []

0 commit comments

Comments
 (0)