mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Ahead with enhancements on comparison algorithm: implemented content-length technique
This commit is contained in:
@@ -320,15 +320,16 @@ def checkStability():
|
||||
contentLengths.append(int(clHeader.group(1)))
|
||||
|
||||
if contentLengths:
|
||||
clSum = 0
|
||||
conf.contentLengths = ( min(contentLengths), max(contentLengths) )
|
||||
|
||||
for cl in contentLengths:
|
||||
clSum += cl
|
||||
warnMsg = "url is not stable, sqlmap inspected the headers "
|
||||
warnMsg += "and identified that Content-Length can be used "
|
||||
warnMsg += "in the comparison algorithm"
|
||||
logger.warn(warnMsg)
|
||||
|
||||
clAverage = clSum / len(contentLengths)
|
||||
kb.defaultResult = True
|
||||
|
||||
# TODO: go ahead here with the technique to compare True/False
|
||||
# based upon clAverage discard (conf.contentLengths)
|
||||
return True
|
||||
|
||||
# Prepare for the comparison algorithm based on page content's
|
||||
# stable lines subset
|
||||
@@ -356,6 +357,10 @@ def checkStability():
|
||||
|
||||
return True
|
||||
|
||||
if condition == True:
|
||||
logMsg = "url is stable"
|
||||
logger.info(logMsg)
|
||||
|
||||
return condition
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user