From dd963a042d9ab7448f94400c57e25f40835f44e2 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 4 Mar 2021 08:26:23 +0100 Subject: [PATCH] Fixes #4591 --- lib/core/settings.py | 2 +- lib/request/comparison.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index b58c103c3..0eee8191e 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.5.3.1" +VERSION = "1.5.3.2" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/lib/request/comparison.py b/lib/request/comparison.py index 32409f5b4..9a32b476c 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -154,14 +154,18 @@ def _comparison(page, headers, code, getRatioValue, pageLength): seqMatcher.set_seq1(seq1) seqMatcher.set_seq2(seq2) - key = (hash(seq1), hash(seq2)) + try: + key = (hash(seq1), hash(seq2)) + except: + key = None if key in kb.cache.comparison: ratio = kb.cache.comparison[key] else: ratio = round(seqMatcher.quick_ratio() if not kb.heavilyDynamic else seqMatcher.ratio(), 3) - kb.cache.comparison[key] = ratio + if key: + kb.cache.comparison[key] = ratio # If the url is stable and we did not set yet the match ratio and the # current injected value changes the url page content