@@ -353,7 +353,7 @@ def getValue(expression, blind=True, inband=True, error=True, fromUser=False, ex
353353 expression = expression .replace ("DISTINCT " , "" )
354354
355355 if error and conf .errorTest :
356- value = errorUse (expression )
356+ value = goError (expression )
357357
358358 if not value :
359359 warnMsg = "for some reason(s) it was not possible to retrieve "
@@ -408,7 +408,12 @@ def goStacked(expression, silent=False):
408408 return payload , page
409409
410410def goError (expression , suppressOutput = False , returnPayload = False ):
411- #expression = cleanQuery(expression)
411+ """
412+ Retrieve the output of a SQL query taking advantage of an error-based
413+ SQL injection vulnerability on the affected parameter.
414+ """
415+
416+ result = None
412417
413418 if suppressOutput :
414419 pushValue (conf .verbose )
@@ -417,9 +422,21 @@ def goError(expression, suppressOutput=False, returnPayload=False):
417422 if conf .direct :
418423 return direct (expression ), None
419424
420- result , payload = errorUse (expression , returnPayload )
425+ condition = (
426+ kb .resumedQueries and conf .url in kb .resumedQueries .keys ()
427+ and expression in kb .resumedQueries [conf .url ].keys ()
428+ )
429+
430+ if condition :
431+ result = resume (expression , None )
432+
433+ if not result :
434+ result = errorUse (expression , returnPayload )
435+
436+ if not returnPayload :
437+ dataToSessionFile ("[%s][%s][%s][%s][%s]\n " % (conf .url , kb .injPlace , conf .parameters [kb .injPlace ], expression , result ))
421438
422439 if suppressOutput :
423440 conf .verbose = popValue ()
424441
425- return result , payload
442+ return result
0 commit comments