Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d8408c

Browse files
committed
More fix for --technique resume
1 parent e96a533 commit 2d8408c

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

lib/controller/checks.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def checkSqlInjection(place, parameter, value):
8080
if kb.endDetection:
8181
break
8282

83+
proceed = True
8384
title = test.title
8485
stype = test.stype
8586
clause = test.clause
@@ -202,6 +203,21 @@ def checkSqlInjection(place, parameter, value):
202203
logger.debug(debugMsg)
203204
continue
204205

206+
if len(kb.injections) > 0:
207+
for resumedInj in kb.injections:
208+
if resumedInj.place == place and resumedInj.parameter \
209+
== parameter and stype in resumedInj.data:
210+
debugMsg = "skipping test '%s' because this " % title
211+
debugMsg += "technique has already been detected "
212+
debugMsg += "in a previous run"
213+
logger.debug(debugMsg)
214+
215+
proceed = False
216+
break
217+
218+
if not proceed:
219+
continue
220+
205221
infoMsg = "testing '%s'" % title
206222
logger.info(infoMsg)
207223

lib/controller/controller.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,18 @@ def start():
317317
# TODO: consider the following line in __setRequestParams()
318318
# __testableParameters = True
319319

320-
if (len(kb.injections) == 0 or (len(kb.injections) == 1 and kb.injections[0].place is None)) \
321-
and (kb.injection.place is None or kb.injection.parameter is None):
320+
proceed = False
322321

322+
if len(kb.injections) > 0:
323+
for resumedInj in kb.injections:
324+
for tech in conf.tech:
325+
if tech not in resumedInj.data:
326+
proceed = True
327+
break
328+
else:
329+
proceed = True
330+
331+
if proceed:
323332
if not conf.string and not conf.regexp:
324333
# NOTE: this is not needed anymore, leaving only to display
325334
# a warning message to the user in case the page is not stable

0 commit comments

Comments
 (0)