1717from lib .core .common import Backend
1818from lib .core .common import beep
1919from lib .core .common import extractRegexResult
20+ from lib .core .common import extractTextTagContent
2021from lib .core .common import findDynamicContent
2122from lib .core .common import Format
2223from lib .core .common import getComparePageRatio
@@ -329,9 +330,11 @@ def genCmpPayload():
329330 kb .matchRatio = None
330331 kb .negativeLogic = (where == PAYLOAD .WHERE .NEGATIVE )
331332 Request .queryPage (genCmpPayload (), place , raise404 = False )
333+ falsePage = threadData .lastComparisonPage
332334
333335 # Perform the test's True request
334336 trueResult = Request .queryPage (reqPayload , place , raise404 = False )
337+ truePage = threadData .lastComparisonPage
335338
336339 if trueResult :
337340 falseResult = Request .queryPage (genCmpPayload (), place , raise404 = False )
@@ -342,6 +345,15 @@ def genCmpPayload():
342345 logger .info (infoMsg )
343346
344347 injectable = True
348+ else :
349+ trueSet = set (extractTextTagContent (truePage ))
350+ falseSet = set (extractTextTagContent (falsePage ))
351+ candidate = reduce (lambda x , y : x or (y .strip () if y .strip () in (kb .pageTemplate or "" ) else None ), (trueSet - falseSet ), None )
352+ if candidate :
353+ conf .string = candidate
354+ infoMsg = "%s parameter '%s' is '%s' injectable (with --string='%s')" % (place , parameter , title , candidate )
355+ logger .info (infoMsg )
356+ injectable = True
345357
346358 # In case of error-based SQL injection
347359 elif method == PAYLOAD .METHOD .GREP :
0 commit comments