minor fix for end phase (Ctrl+C)

This commit is contained in:
Miroslav Stampar 2010-12-21 23:55:55 +00:00
parent fb75d0636b
commit d974a966b8
3 changed files with 8 additions and 6 deletions

View File

@ -78,11 +78,6 @@ def checkSqlInjection(place, parameter, value):
kb.testMode = True
for test in conf.tests:
# Check if there were any premature detection cancellation request
# from the user (Ctrl+C)
if not kb.testMode:
break
try:
title = test.title
stype = test.stype
@ -416,7 +411,7 @@ def checkSqlInjection(place, parameter, value):
elif test[0] in ("n", "N"):
break
elif test[0] in ("e", "E"):
kb.testMode = False
kb.endDetection = True
break
elif test[0] in ("q", "Q"):
raise sqlmapUserQuitException

View File

@ -351,6 +351,12 @@ def start():
injection = checkSqlInjection(place, parameter, value)
proceed = not kb.endDetection
# In case when user wants to end detection phase (Ctrl+C)
if not proceed:
break
if injection is not None and injection.place is not None:
kb.injections.append(injection)

View File

@ -1158,6 +1158,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
kb.dep = None
kb.docRoot = None
kb.dynamicMarkings = []
kb.endDetection = False
kb.formNames = []
kb.headersCount = 0
kb.headersFp = {}