From 88c00e61d341421f51543d796f282de0848463c3 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 9 Nov 2010 23:35:37 +0000 Subject: [PATCH] another update --- lib/core/settings.py | 1 + lib/request/comparison.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index bd9fb6d89..96fdb7aed 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -23,6 +23,7 @@ SITE = "http://sqlmap.sourceforge.net" # minimum distance of ratio from conf.matchRatio to result in True DIFF_TOLERANCE = 0.05 +CONSTANT_RATIO = 0.9 # sqlmap logger logging.addLevelName(9, "PAYLOAD") diff --git a/lib/request/comparison.py b/lib/request/comparison.py index 60fc3b64e..65c5a5464 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -15,6 +15,7 @@ from lib.core.common import wasLastRequestError from lib.core.data import conf from lib.core.data import kb from lib.core.data import logger +from lib.core.settings import CONSTANT_RATIO from lib.core.settings import DIFF_TOLERANCE def comparison(page, headers=None, getSeqMatcher=False, pageLength=None): @@ -102,7 +103,7 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None): logger.debug("setting match ratio for current parameter to %.3f" % conf.matchRatio) elif not kb.pageStable or ( kb.pageStable and ratio < 0.6 ): - conf.matchRatio = 0.900 + conf.matchRatio = CONSTANT_RATIO logger.debug("setting match ratio for current parameter to default value 0.900") # If it has been requested to return the ratio and not a comparison @@ -116,7 +117,7 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None): # If the url is not stable it returns sequence matcher between the # first untouched HTTP response page content and this content else: - if kb.pageStable: - return (ratio - conf.matchRatio) > DIFF_TOLERANCE + if conf.matchRatio == CONSTANT_RATIO or conf.thold: + return ratio > conf.matchRatio else: - return ratio > conf.matchRatio \ No newline at end of file + return (ratio - conf.matchRatio) > DIFF_TOLERANCE