diff --git a/lib/core/option.py b/lib/core/option.py index fa98d58a1..7a12a96f8 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -957,6 +957,7 @@ def __setConfAttributes(): conf.scheme = None #conf.seqMatcher = difflib.SequenceMatcher(lambda x: x in " \t") conf.seqMatcher = difflib.SequenceMatcher(None) + conf.seqLock = None conf.sessionFP = None conf.start = True conf.threadException = False diff --git a/lib/request/comparison.py b/lib/request/comparison.py index 229b6a4e0..6e15ee594 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -65,9 +65,15 @@ def comparison(page, headers=None, getSeqMatcher=False): else: return False + if conf.seqLock: + conf.seqLock.acquire() + conf.seqMatcher.set_seq2(page) ratio = round(conf.seqMatcher.ratio(), 3) + if conf.seqLock: + conf.seqLock.release() + # If the url is stable and we did not set yet the match ratio and the # current injected value changes the url page content if conf.matchRatio is None: diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index 6626b9d92..50c502d8d 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -153,6 +153,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None index = [ firstChar ] # As list for python nested function scoping idxlock = threading.Lock() iolock = threading.Lock() + conf.seqLock = threading.Lock() def downloadThread(): try: @@ -237,6 +238,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if conf.verbose >= 1 and not showEta and infoMsg: dataToStdout(infoMsg) + conf.seqLock = None else: index = firstChar