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

Skip to content

Commit 88c00e6

Browse files
committed
another update
1 parent 47720a4 commit 88c00e6

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
# minimum distance of ratio from conf.matchRatio to result in True
2525
DIFF_TOLERANCE = 0.05
26+
CONSTANT_RATIO = 0.9
2627

2728
# sqlmap logger
2829
logging.addLevelName(9, "PAYLOAD")

lib/request/comparison.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from lib.core.data import conf
1616
from lib.core.data import kb
1717
from lib.core.data import logger
18+
from lib.core.settings import CONSTANT_RATIO
1819
from lib.core.settings import DIFF_TOLERANCE
1920

2021
def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
@@ -102,7 +103,7 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
102103
logger.debug("setting match ratio for current parameter to %.3f" % conf.matchRatio)
103104

104105
elif not kb.pageStable or ( kb.pageStable and ratio < 0.6 ):
105-
conf.matchRatio = 0.900
106+
conf.matchRatio = CONSTANT_RATIO
106107
logger.debug("setting match ratio for current parameter to default value 0.900")
107108

108109
# 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):
116117
# If the url is not stable it returns sequence matcher between the
117118
# first untouched HTTP response page content and this content
118119
else:
119-
if kb.pageStable:
120-
return (ratio - conf.matchRatio) > DIFF_TOLERANCE
120+
if conf.matchRatio == CONSTANT_RATIO or conf.thold:
121+
return ratio > conf.matchRatio
121122
else:
122-
return ratio > conf.matchRatio
123+
return (ratio - conf.matchRatio) > DIFF_TOLERANCE

0 commit comments

Comments
 (0)