@@ -345,15 +345,16 @@ def checkSqlInjection(place, parameter, value):
345345 match = re .search (r"(\d+)-(\d+)" , test .request .columns )
346346 if match and not injection .data :
347347 _ = test .request .columns .split ('-' )[- 1 ]
348- if conf .uCols is None and _ .isdigit () and int ( _ ) > 10 :
348+ if conf .uCols is None and _ .isdigit ():
349349 if kb .futileUnion is None :
350- msg = "it is not recommended to perform "
351- msg += "extended UNION tests if there is not "
350+ msg = "it is recommended to perform "
351+ msg += "only basic UNION tests if there is not "
352352 msg += "at least one other (potential) "
353- msg += "technique found. Do you want to skip? [Y/n] "
354- kb .futileUnion = not readInput (msg , default = 'Y' , boolean = True )
353+ msg += "technique found. Do you want to reduce "
354+ msg += "the number of requests? [Y/n] "
355+ kb .futileUnion = readInput (msg , default = 'Y' , boolean = True )
355356
356- if kb .futileUnion is False :
357+ if kb .futileUnion and int ( _ ) > 10 :
357358 debugMsg = "skipping test '%s'" % title
358359 logger .debug (debugMsg )
359360 continue
@@ -499,14 +500,31 @@ def genCmpPayload():
499500
500501 return cmpPayload
501502
502- # Useful to set kb.matchRatio at first based on
503- # the False response content
503+ # Useful to set kb.matchRatio at first based on False response content
504504 kb .matchRatio = None
505505 kb .negativeLogic = (where == PAYLOAD .WHERE .NEGATIVE )
506506 Request .queryPage (genCmpPayload (), place , raise404 = False )
507507 falsePage , falseHeaders , falseCode = threadData .lastComparisonPage or "" , threadData .lastComparisonHeaders , threadData .lastComparisonCode
508508 falseRawResponse = "%s%s" % (falseHeaders , falsePage )
509509
510+ # Checking if there is difference between current FALSE, original and heuristics page (i.e. not used parameter)
511+ if not kb .negativeLogic :
512+ try :
513+ ratio = 1.0
514+ seqMatcher = getCurrentThreadData ().seqMatcher
515+
516+ for current in (kb .originalPage , kb .heuristicPage ):
517+ seqMatcher .set_seq1 (current )
518+ seqMatcher .set_seq2 (falsePage )
519+ ratio *= seqMatcher .quick_ratio ()
520+
521+ if ratio == 1.0 :
522+ continue
523+ except MemoryError :
524+ pass
525+
526+ kb .prevFalsePage = falsePage
527+
510528 # Perform the test's True request
511529 trueResult = Request .queryPage (reqPayload , place , raise404 = False )
512530 truePage , trueHeaders , trueCode = threadData .lastComparisonPage or "" , threadData .lastComparisonHeaders , threadData .lastComparisonCode
0 commit comments